Bug #4032


Segmentation Fault on Random Lines

Added by kabaka (Kyle Johnson) over 11 years ago. Updated about 11 years ago.

Target version:
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]


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:


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 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).


segfault.txt (3.7 KB) segfault.txt Full segfault output kabaka (Kyle Johnson), 11/07/2010 10:37 AM
Actions #1

Updated by sorah (Sorah Fukumori) over 11 years ago

I think this problem is already fixed on trunk.

Please try it on trunk too.


Actions #2

Updated by kabaka (Kyle Johnson) over 11 years ago

Yep, fixed on trunk. Neat.


Actions #3

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Status changed from Open to Closed

And has been backported to 1.9.2 already.
Wait for the next release.


Also available in: Atom PDF