# Segmentation Fault (GC)

**URL:** <https://www.ruby-forum.com/t/segmentation-fault-gc/144681>\
**Category:** wxRuby\
**Created:** [August 1, 2008, 4:24am UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681 "2008-08-01T04:24:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryan-ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bryan-ash](https://www.ruby-forum.com/u/bryan-ash)\
**Post date:** [August 1, 2008, 4:24am UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681/1 "2008-08-01T04:24:04Z")

</div>

I’ve been ignoring a Garbage Collection Segmentation Fault for some time  
now with the help of GC.disable in my Wx::App.

I’m running Windows XP with:  
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]  
wxruby (1.9.7)  
activerecord (2.1.0)  
sqlite3-ruby (1.2.2)

The application stores the time spent working on tasks in SQLite when  
the user starts and stops a task from the TaskBarIcon.

It uses the following Wx components: Frame, Button, BoxSizer, Grid,  
GridTableBase, GridCellAttr, Panel, StaticText, TaskBarIcon, Image,  
Bitmap, Menu, MiniFrame, SystemSettings, TextCtrl

The segfaults occur when I open and close the “Edit time entries” and  
“Timesheet” frames.

I’ve attached a cut down version that doesn’t interface to SQLite or  
ActiveRecord that still exhibits the problem.

Please let me know what other information I can provide to help this  
investigation.

Thanks in advance,  
Bryan

---

<div class="post-metadata">

**Author:** ![bryan-ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bryan-ash](https://www.ruby-forum.com/u/bryan-ash)\
**Post date:** [August 15, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681/2 "2008-08-15T13:26:03Z")

</div>

Hi Bryan

Bryan A. wrote:

> the user starts and stops a task from the TaskBarIcon.

Thanks for the report, and particularly for taking the time to produce a  
self-contained runnable version. It really helps investigates these  
things.

I could reproduce your crash on OS X / ruby 1.8.6 with version 1.9.7 (I  
don’t have an XP machine easily to hand right now, but I’d guess it’s  
the same error). I traced the crash to problems with the memory  
management of destroyed Menus (as popped-up by the TaskBarIcon).

However, I also tried it with the latest SVN HEAD and the crashes don’t  
occur. I recently applied a fix for some similar Menu bugs and I think  
this has resolved the problem you’re finding too.

Unless you have a compiler set up, there’s no workaround for now except  
to keep using GC.disable. However I’ll test on Windows before the next  
release to confirm this is fixed there too. Hopefully we will have a  
next release in a week or two.

cheers  
alex

---

<div class="post-metadata">

**Author:** ![bryan-ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bryan-ash](https://www.ruby-forum.com/u/bryan-ash)\
**Post date:** [August 29, 2008, 4:53am UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681/3 "2008-08-29T04:53:13Z")

</div>

RubyForge just told me that 1.9.8 is available.

I’d love to test if this bug is fixed, is there a plan to publish a Gem  
for x86-mswin32?

Thanks,  
Bryan

---

<div class="post-metadata">

**Author:** ![bryan-ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bryan-ash](https://www.ruby-forum.com/u/bryan-ash)\
**Post date:** [August 29, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681/4 "2008-08-29T16:26:53Z")

</div>

Bryan A. wrote:

> RubyForge just told me that 1.9.8 is available.

Rubyforge sends out those automatic notices as the first file in a  
release is uploaded, which was last night. Withthe amount of compiling  
involved, it can take a few days to have a full collection of binary  
builds available.

> I’d love to test if this bug is fixed, is there a plan to publish a Gem  
> for x86-mswin32?  
> Yes, I’m just looking for a copy of the MSVC compiler at the moment.

You should be able to use the MingW build which is now available. This  
is really intended for the new, improved windows version of ruby  
([http://dump.mmediasys.com/installer3/](http://dump.mmediasys.com/installer3/)) but in fact I find this build  
also works with my version of the One-Click Installer (1.8.6)

So if you’re keen to try, download the -mingw gem and install it - you  
might need to use --force or something. Your feedback’s welcome..

cheers  
alex

---

<div class="post-metadata">

**Author:** ![bryan-ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bryan-ash](https://www.ruby-forum.com/u/bryan-ash)\
**Post date:** [August 29, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/segmentation-fault-gc/144681/5 "2008-08-29T20:30:20Z")

</div>

Alex,

it seems that YOU are the MAN!

This issue appears fixed in version 1.9.8.

Good work, thanks for your help,  
Bryan
