Actions
Bug #4274
closedSEGFAULT: ARGF.gets will crash if first file is not readable!
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p136 (2010-12-25) [i686-linux]
Backport:
Description
=begin
Hi, welcome to crash golf ;).
ruby -e 'gets rescue gets' CRASH!
or some alternative forms of it:
ARGV.unshift 'filename_that_does_not_exist'
ARGF.gets rescue nil
ARGF.gets
or
$*.unshift'X'
$<.fileno rescue $<.fileno
However, if the first arg is readable, everything will be fine.
I've produced that error on various 1.9 versions.
1.8.7 (tested on p330) does not segfault, but displays a weird error message:
ruby -e 'gets rescue gets' CRASH!
-e:1:in gets': private method
gets' called for false:FalseClass (NoMethodError)
Appended the segfault info and a patch.
J-_-L
=end
Files
Actions
Like0
Like0