SEGV by STDIN.gets(0,0)

STDIN.gets(0,0) e$B$Ge(B SEGV e$B$7$^$9!#e(B

% ./ruby -e ‘p STDIN.gets(0,0)’
-e:1: [BUG] Segmentation fault
ruby 1.9.0 (2008-07-19 revision 18132) [i686-linux]

– control frame ----------
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :gets
c:0003 p:0018 s:0007 b:0006 l:000005 d:000005 TOP -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
:private_class_method
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

DBG> : “-e:1:in gets'" DBG> : "-e:1:in'”
– backtrace of native function call (Use addr2line) –
0x81026c5
0x8129aee
0x8129b4b
0x80caf42
0xb7fb0440
0x810a161
0x8070ad0
0x8070e20
0x8070e55
0x80f355e
0x80f55ac
0x80f8519
0x80fc42b
0x80fc650
0x805a3bf
0x805bcce
0x8058d65
0xb7e11ea8
0x8058c61

zsh: abort (core dumped) ./ruby -e ‘p STDIN.gets(0,0)’
nute(4:34:53)% gdb ruby core.18834
GNU gdb 6.4.90-debian
Copyright © 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i486-linux-gnu”…Using host libthread_db
library “/lib/tls/i686/cmov/libthread_db.so.1”.

warning: Can’t read pathname for load map: Input/output error.
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0…done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/librt.so.1…done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /lib/tls/i686/cmov/libdl.so.2…done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libcrypt.so.1…done.
Loaded symbols for /lib/tls/i686/cmov/libcrypt.so.1
Reading symbols from /lib/tls/i686/cmov/libm.so.6…done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /lib/tls/i686/cmov/libc.so.6…done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2…Reading symbols from
/usr/lib/debug/lib/ld-2.3.6.so…done.
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/encdb.so…done.
Loaded symbols for
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/encdb.so
Reading symbols from
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/trans/transdb.so…done.
Loaded symbols for
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/trans/transdb.so
Reading symbols from /lib/libgcc_s.so.1…done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `./ruby -e p STDIN.gets(0,0)’.
Program terminated with signal 6, Aborted.
#0 0xb7fb0410 in ?? ()
(gdb) bt
#0 0xb7fb0410 in ?? ()
#1 0xbfb9681c in ?? ()
#2 0x00000006 in ?? ()
#3 0x00004992 in ?? ()
#4 0xb7e25811 in raise () from /lib/tls/i686/cmov/libc.so.6
#5 0xb7e26fb9 in abort () from /lib/tls/i686/cmov/libc.so.6
#6 0x08129b50 in rb_bug (fmt=0x8156dcd “Segmentation fault”) at
error.c:226
#7 0x080caf42 in sigsegv (sig=11) at signal.c:564
#8 0xb7fb0440 in ?? ()
#9 0x0000000b in ?? ()
#10 0xbfb969ac in ?? ()
#11 0xbfb96a2c in ?? ()
#12 0x0000000b in ?? ()
#13 0x00000000 in ?? ()
(gdb)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs