Bug #13324
closedIRB Segmentation Fault from eval infinite loop
Description
I am not sure if this has already been taken care of or not but I am using ruby 2.3.0 and irb 0.9.6(09/06/30) and when I run the below code I get a segmentation fault
a = "eval a"; eval a
when running the same code with just the ruby interpreter I get the below error which is what I would expect
-e:1:in `eval': stack level too deep (SystemStackError)
	from (eval):1:in `<main>'
	from (eval):1:in `eval'
	from (eval):1:in `<main>'
	from (eval):1:in `eval'
	from (eval):1:in `<main>'
	from (eval):1:in `eval'
	from (eval):1:in `<main>'
	from (eval):1:in `eval'
	 ... 9507 levels...
	from (eval):1:in `eval'
	from (eval):1:in `<main>'
	from -e:1:in `eval'
	from -e:1:in `<main>'
        
           Updated by srodman7689@gmail.com (Sean Rodman) over 8 years ago
          Updated by srodman7689@gmail.com (Sean Rodman) over 8 years ago
          
          
        
        
      
      The command I use to run it directly on the ruby interpreter is ruby -e "a = "eval a"; eval a"
        
           Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          Updated by nobu (Nobuyoshi Nakada) over 8 years ago
          
          
        
        
      
      - Description updated (diff)
        
           Updated by ko1 (Koichi Sasada) over 8 years ago
          Updated by ko1 (Koichi Sasada) over 8 years ago
          
          
        
        
      
      - Status changed from Open to Closed
Fundamentally, we can't control machine stack overflow.
We will improve the situation (but can't solve completely).
        
           Updated by srodman7689@gmail.com (Sean Rodman) over 8 years ago
          Updated by srodman7689@gmail.com (Sean Rodman) over 8 years ago
          
          
        
        
      
      - Status changed from Closed to Open
The issue is not the stack overflow but the segmentation fault I described when running the same code in the above listed irb version.
        
           Updated by ko1 (Koichi Sasada) over 8 years ago
          Updated by ko1 (Koichi Sasada) over 8 years ago
          
          
        
        
      
      - Status changed from Open to Closed
srodman7689@gmail.com (Sean Rodman) wrote:
The issue is not the stack overflow but the segmentation fault I described when running the same code in the above listed irb version.
SEGV because of machine stack overflow.
        
           Updated by usa (Usaku NAKAMURA) over 8 years ago
          Updated by usa (Usaku NAKAMURA) over 8 years ago
          
          
        
        
      
      - Status changed from Closed to Rejected