mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	Kernel: Limit the size of stack traces
Let's not allow infinitely long stack traces. Cap it at 4096 frames.
This commit is contained in:
		
							parent
							
								
									7b50d3cda4
								
							
						
					
					
						commit
						b0b51c3955
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -1161,9 +1161,10 @@ Vector<FlatPtr> Processor::capture_stack_trace(Thread& thread, size_t max_frames | ||||||
| 
 | 
 | ||||||
|     auto walk_stack = [&](FlatPtr stack_ptr) |     auto walk_stack = [&](FlatPtr stack_ptr) | ||||||
|     { |     { | ||||||
|  |         static constexpr size_t max_stack_frames = 4096; | ||||||
|         stack_trace.append(eip); |         stack_trace.append(eip); | ||||||
|         size_t count = 1; |         size_t count = 1; | ||||||
|         while (stack_ptr) { |         while (stack_ptr && stack_trace.size() < max_stack_frames) { | ||||||
|             FlatPtr retaddr; |             FlatPtr retaddr; | ||||||
| 
 | 
 | ||||||
|             count++; |             count++; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling