# Segmentation fault on exiting program

**URL:** <https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132>\
**Category:** wxRuby\
**Created:** [May 16, 2009, 3:31pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132 "2009-05-16T15:31:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Lane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/85e7bf/32.png) [@Peter\_Lane](https://www.ruby-forum.com/u/Peter_Lane)\
**Post date:** [May 16, 2009, 3:31pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132/1 "2009-05-16T15:31:55Z")

</div>

Hi,

I have been using wxRuby for a while now, but hit a problem on  
upgrading. I  
have ruby1.9.1p129 installed, along with wxruby 2.0.0. My system is  
Ubuntu  
8.10, with wxWidgets 2.8-0 from the repository.

Whenever I exit an application, I get an error message. My programs  
seem to  
work fine, it’s just the error as you exit which is irritating. I’ve  
not  
noticed this with any non-wxruby ruby programs. Has anyone else come  
across  
the same problem? Is there a fix?

many thanks,

```
Peter.

```

For instance, the following program:

require ‘wx’

class SimpleFrame \< Wx::Frame  
def initialize  
super(nil, :title =\> “Simple Frame Title”)  
end  
end

Wx::App.run do  
SimpleFrame.new.show  
end

$ ruby simple-frame.rb

: [BUG] Segmentation fault ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
## – control frame ---------- c:0001 p:0000 s:0002 b:0002 l:000404 d:000404 TOP

– Ruby level backtrace  
information-----------------------------------------

## – C level backtrace information

0x812d558 ruby(rb\_vm\_bugreport+0x48) [0x812d558]  
0x815bb31 ruby [0x815bb31]  
0x815bba8 ruby(rb\_bug+0x28) [0x815bba8]  
0x80d8ae6 ruby [0x80d8ae6]  
0xb7fa4410 [0xb7fa4410]  
0xb5c6ab8e /lib/libselinux.so.1 [0xb5c6ab8e]  
0xb5c631d8 /lib/libselinux.so.1 [0xb5c631d8]  
0xb5c73350 /lib/libselinux.so.1 [0xb5c73350]  
0xb7f98153 /lib/ld-linux.so.2 [0xb7f98153]  
0xb7dc6d69 /lib/tls/i686/cmov/libc.so.6(exit+0x89) [0xb7dc6d69]  
0xb7dae68d /lib/tls/i686/cmov/libc.so.6(\_\_libc\_start\_main+0xed)  
[0xb7dae68d]  
0x805bda1 ruby [0x805bda1]

[NOTE]  
You may encounter a bug of Ruby interpreter. Bug reports are welcome.  
For details: [http://www.ruby-lang.org/bugreport.html](http://www.ruby-lang.org/bugreport.html)

Aborted

---

<div class="post-metadata">

**Author:** ![Peter\_Lane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/85e7bf/32.png) [@Peter\_Lane](https://www.ruby-forum.com/u/Peter_Lane)\
**Post date:** [May 19, 2009, 3:03am UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132/2 "2009-05-19T03:03:21Z")

</div>

Hi Peter

Peter Lane wrote:

> I have been using wxRuby for a while now, but hit a problem on  
> upgrading. I have ruby1.9.1p129 installed, along with wxruby 2.0.0.  
> My system is Ubuntu 8.10, with wxWidgets 2.8-0 from the repository.
> 
> Whenever I exit an application, I get an error message. My programs  
> seem to work fine, it’s just the error as you exit which is  
> irritating. I’ve not noticed this with any non-wxruby ruby programs.  
> Has anyone else come across the same problem? Is there a fix?

Thanks for the report. I’m seeing the same thing with Ruby 1.9 on my  
Ubuntu machine, haven’t quite figured out why yet. I will definitely  
want to fix this for the upcoming 2.0.1 release.

alex

---

<div class="post-metadata">

**Author:** ![Peter\_Lane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/85e7bf/32.png) [@Peter\_Lane](https://www.ruby-forum.com/u/Peter_Lane)\
**Post date:** [May 19, 2009, 9:32am UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132/3 "2009-05-19T09:32:13Z")

</div>

Hi,

On Tue, May 19, 2009 at 3:00 AM, Alex F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks for the report. I’m seeing the same thing with Ruby 1.9 on my Ubuntu  
> machine, haven’t quite figured out why yet. I will definitely want to fix  
> this for the upcoming 2.0.1 release.

I suspect a binary incompatibility introduced by the ruby1.9.1p129  
related with native extensions.

With ruby1.9.1p0, I haven’t noticed such kind of problems on Ubuntu  
8.10 and wxRuby-2.0.  
I have upgraded to Ubuntu 9.04 recently, and I just run the test case  
still with ruby1.9.1p0 and wxRuby-2.0 without any problem.

Conversely, on my MinGW installation, I have upgraded to ruby1.9.1p129  
and I’ve noticed that the corresponding wxRuby-2.0 binary gem (built  
with ruby1.9.1p0) does not work at all. I’ve just rebuilt the  
wxRuby-2.0 lib with ruby1.9.1p129 and then everything works again.

Can you try to rebuild wxRuby ?

Anyway, I will check soon what I suspect on Ubuntu 9.10 :

- upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0  
binary gem : the error at the exit should occur
- rebuild wxRuby-2.0 for ruby1.9.1p129 and see if the error doesn’t  
occur any more.

Cheers.

Chauk-Mean.

---

<div class="post-metadata">

**Author:** ![Peter\_Lane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/85e7bf/32.png) [@Peter\_Lane](https://www.ruby-forum.com/u/Peter_Lane)\
**Post date:** [May 20, 2009, 2:01am UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132/4 "2009-05-20T02:01:15Z")

</div>

On Tue, May 19, 2009 at 9:28 AM, Chauk-Mean P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I suspect a binary incompatibility introduced by the ruby1.9.1p129  
> related with native extensions.

I was wrong …

> Anyway, I will check soon what I suspect on Ubuntu 9.10 :
> 
> - upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0  
> binary gem : the error at the exit should occur

No error at the exit.  
Alex has more luck than me 🙂

Cheers.

Chauk-Mean.

---

<div class="post-metadata">

**Author:** ![Peter\_Lane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/85e7bf/32.png) [@Peter\_Lane](https://www.ruby-forum.com/u/Peter_Lane)\
**Post date:** [May 20, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-exiting-program/168132/5 "2009-05-20T22:58:42Z")

</div>

Chauk-Mean P. wrote:

> On Tue, May 19, 2009 at 9:28 AM, Chauk-Mean P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > I suspect a binary incompatibility introduced by the ruby1.9.1p129  
> > related with native extensions.
> 
> I was wrong …
> 
> > Anyway, I will check soon what I suspect on Ubuntu 9.10 :
> > 
> > - upgrade to ruby1.9.1p129 then try your test case with the wxRuby-2.0  
> > binary gem : the error at the exit should occur
> 
> No error at the exit.  
> Alex has more luck than me 🙂
> 
> Cheers.
> 
> Chauk-Mean.

So the key could be to upgrade Ubuntu ?

Thanks for exploring this. I tried the binary gem when I upgraded ruby  
to 1.9.1, and I got the same problem on both p129 and an earlier  
release.

cheers,

```
Peter.

```
