[#51213] [ruby-trunk - Bug #7645][Open] BigDecimal#== slow when compared to true/false — "mathie (Graeme Mathieson)" <mathie@...>

11 messages 2013/01/01

[#51328] [ruby-trunk - Bug #7676][Open] Comparison of Float::NAN in array behaves unexpectedly — "simonrussell (Simon Russell)" <spam+ruby@...>

11 messages 2013/01/09

[#51347] [ruby-trunk - Bug #7679][Open] IRB history is broken — "zzak (Zachary Scott)" <zachary@...>

15 messages 2013/01/10

[#51389] [ruby-trunk - Bug #7688][Open] Error hiding with rb_rescue() on Comparable#==, #coerce and others — "Eregon (Benoit Daloze)" <redmine@...>

34 messages 2013/01/11

[#51430] [ruby-trunk - Bug #7696][Open] Lazy enumerators with state can't be rewound — "marcandre (Marc-Andre Lafortune)" <ruby-core@...>

15 messages 2013/01/14

[#51437] [ruby-trunk - Bug #7698][Open] RubyGems 2.0 has an incompatibility about installation of extension libraries — "mrkn (Kenta Murata)" <muraken@...>

21 messages 2013/01/15

[#51454] [CommonRuby - Feature #7701][Open] Non-optional (required) keyword args — "headius (Charles Nutter)" <headius@...>

31 messages 2013/01/15

[#51499] [ruby-trunk - Feature #7712][Open] Add .txt extensions to all plain-text documentation files for Windows users — "postmodern (Hal Brodigan)" <postmodern.mod3@...>

9 messages 2013/01/18

[#51619] [ruby-trunk - Feature #7738][Open] Deprecate Set#+ as an alias of Set#|, use it for symmetric difference. Introduce Hash#| for Hash#reverse_merge in Rails. — "alexeymuranov (Alexey Muranov)" <redmine@...>

11 messages 2013/01/24

[#51623] [ruby-trunk - Feature #7739][Open] Define Hash#| as Hash#reverse_merge in Rails — "alexeymuranov (Alexey Muranov)" <redmine@...>

24 messages 2013/01/24

[#51714] [CommonRuby - Feature #7747][Open] Expanded API for Binding semantics — "jballanc (Joshua Ballanco)" <jballanc@...>

19 messages 2013/01/27

[#51742] [ruby-trunk - Bug #7756][Open] clang 3.2 sees through UNINITIALIZED_VAR macro, gives warning — "drbrain (Eric Hodel)" <drbrain@...7.net>

10 messages 2013/01/29

[#51763] [ruby-trunk - Bug #7758][Open] Ruby on Windows crashes when active codepage is codepage 65001 and outputting unicode character — "joshc (Josh C)" <josh.nw@...>

16 messages 2013/01/30

[ruby-core:51378] [Backport93 - Backport #7291] split gives core dump on large file

From: "usa (Usaku NAKAMURA)" <usa@...>
Date: 2013-01-11 09:29:42 UTC
List: ruby-core #51378
Issue #7291 has been updated by usa (Usaku NAKAMURA).


I don't have any reproducible environment, so I can't debug it.

If mame-san's expectation is right, current rb_memsearch_ss() implementaion
may still have this bug, because the difference between 1.9.3 and 2.0.0 is
only 2 point.
  (1) r37793 (performance implovement)
  (2) using memmem(3), if it exists
So, if (1) does not fix this, all platforms without memmem(3) should have same
bug on 2.0.0.

Mame-san, can you help me to debug?
----------------------------------------
Backport #7291: split gives core dump on large file
https://bugs.ruby-lang.org/issues/7291#change-35353

Author: niels_tolstrup (Niels Tolstrup)
Status: Assigned
Priority: Normal
Assignee: usa (Usaku NAKAMURA)
Category: 
Target version: 


When applying split on a large file, we get a segmentation fault.

We have tried on ubuntu 12.04LTS with ruby 1.9.2p180 and ruby 1.9.3p194.


The bug can be reproduced with this code:

data = ">ENSG00000010072|ENST00000008440|1|1|231474002|231488267|SprT-like N-terminal domain [Source:HGNC Symbol;Acc:25356]
GACGGGCCGTCTCGAGAGCCGGCATCTCCTAGGAGCTAGTCCTGGTCCTCGGCTAGGCGG
CTTGGGGTCGCGGCGTAACTGGGGAGCCAGCCTGACGCCGGCGGACCCCGCCTGTGATCC
TGGCAACGATGGATGATGACTTGATGTTGGCACTGCGGCTTCAGGAGGAGTGGAACTTGC
AGGAGGCGGAGCGCGATCATGCCCAGGAGTCCCTGTCGCTAGTGGACGCGTCGTGGGAGT
TGGTGGACCCCACACCGGACTTGCAGGCACTGTTTGTTCAGTTTAACGACCAATTCTTCT
GGGGCCAGCTGGAGGCCGTCGAGGTGAAGTGGAGCGTGCGAATGACCCTGTGAGTTCCGA
GCCCCGCTGGGGAAAGAGGCGGGACTGGCAGCTTTCCTGCAGCCCCCGGCCCTGGTTTTC
TCTCCTTTCTCTAGTCCGACGGTCCCAGGGGGCGTTAAATGAGGGGAGTCTGGTTTTGGA
CCTGGCAATTCCTGCCTCGGCGTGTTTCTGTCTTCCTTACCTTTTCTCCCACTCGAACAA"


fh = File.open('test.txt','w')
(1..15000000).each {|i| fh.puts(data)}
fh.close


str = File.read("test.txt")

str.split(/>ENS/).each do |match|

  if match.split(">ENS").length > 1
    puts match
    exit
  end

end

We get this error:


segfault.rb:22: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

-- control frame ----------
c:0007 p:---- s:0021 b:0021 l:000020 d:000020 CFUNC  :split
c:0006 p:0013 s:0017 b:0017 l:0012d8 d:000016 BLOCK  segfault.rb:22
c:0005 p:---- s:0014 b:0014 l:000013 d:000013 FINISH
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC  :each
c:0003 p:0093 s:0009 b:0009 l:0012d8 d:0002c0 EVAL   segfault.rb:20
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0012d8 d:0012d8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
segfault.rb:20:in `<main>'
segfault.rb:20:in `each'
segfault.rb:22:in `block in <main>'
segfault.rb:22:in `split'

-- C level backtrace information -------------------------------------------
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_vm_bugreport+0x61) [0x7ffa89323101]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x5f24e) [0x7ffa8920d24e]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_bug+0xa5) [0x7ffa8920e075]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x10b874) [0x7ffa892b9874]
/lib/x86_64-linux-gnu/libc.so.6(+0x364c0) [0x7ffa88e254c0]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_memsearch+0x68) [0x7ffa89295758]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1298f5) [0x7ffa892d78f5]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x16e5a6) [0x7ffa8931c5a6]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x164978) [0x7ffa89312978]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x16a80b) [0x7ffa8931880b]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_yield+0x47) [0x7ffa8931dcf7]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_ary_each+0x46) [0x7ffa891def16]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x16e5a6) [0x7ffa8931c5a6]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x164978) [0x7ffa89312978]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x16a80b) [0x7ffa8931880b]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_iseq_eval_main+0xb1) [0x7ffa8931e631]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x65292) [0x7ffa89213292]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_exec_node+0x1d) [0x7ffa8921414d]
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_run_node+0x1e) [0x7ffa8921640e]
ruby(main+0x4b) [0x40082b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ffa88e1076d]
ruby() [0x400859]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted (core dumped)

best regards

Niels and Jesper


-- 
http://bugs.ruby-lang.org/

In This Thread