Ruby – Segmentation fault

October 9, 2008 at 8:53 pm Leave a comment

Today I had a really nasty Ruby error, that bugged me quite a while.

I wanted to extract parts of an XML file and insert them into another one using the libxml-ruby gem. From time to time I got the following segementation fault error.

[BUG] Segmentation fault
ruby 1.8.7 (2008-05-31 patchlevel 0) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I tracked down the place in my code, where it happened, but could not really explain why it did. I tried to rewrite my code several times, always with the same result. The only thing that helped in the end, was to make sure that the Ruby garbage collector was running with GC.enable and to start it with GC.start after each XML file was processed.

What bugs me most, is the fact that I am not sure, what the real problem is. Otherwise I could write a bug report to ruby or libxml.

Advertisements

Entry filed under: ruby. Tags: .

Ruby Warrior OfflineSearch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Archives

del.icio.us

Feeds


%d bloggers like this: