Bug #4032
closedSegmentation Fault on Random Lines
Description
=begin
I am running Arch Linux x86_64 using the current Ruby available from the official repos (ruby 1.9.2_p0-4 according to pacman). All packages on the system are up-to-date.
I'm working on a log parser for IRC logs. This is the third re-write and I continue to have the same problem: segfaults on random lines. The attached segfault occurred on: if c == "\n"
When it does not segfault, it generally continues until it throws an error such as:
:in `puts': wrong argument type #Class:0x000000009b4f88 (expected Data) (TypeError)
The only fix I have found for both of these is to disable the garbage collector with GC.disable, but that is obviously not a final solution.
In every segfault, I always see both of the following:
/usr/lib/libruby.so.1.9(rb_gc_finalize_deferred+0x30)
/usr/lib/libruby.so.1.9(rb_io_fptr_finalize+0x25)
It consistently fails when the parser reads one small file and then reads a portion of another small file, so long as neither file is empty.
The code for the project is at https://github.com/kabaka/Ruby-IRC-Log-Processor and will not be updated while I wait for an answer on this. (Excuse the poor quality of the code — it's hard to work on it when it segfaults every time I run it).
=end
Files
Updated by sorah (Sorah Fukumori) about 14 years ago
=begin
I think this problem is already fixed on trunk.
Please try it on trunk too.
--sora_h
=end
Updated by kabaka (Kyle Johnson) about 14 years ago
=begin
Yep, fixed on trunk. Neat.
Thanks.
=end
Updated by nobu (Nobuyoshi Nakada) about 14 years ago
- Status changed from Open to Closed
=begin
And has been backported to 1.9.2 already.
Wait for the next release.
=end