# wxRuby - Segmentation fault

**URL:** <https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489>\
**Category:** wxRuby\
**Created:** [February 5, 2009, 1:07am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489 "2009-02-05T01:07:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmcghee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@rmcghee](https://www.ruby-forum.com/u/rmcghee)\
**Post date:** [February 5, 2009, 1:07am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489/1 "2009-02-05T01:07:52Z")

</div>

# Windows XP Professional + SP3

# ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

# wxruby (1.9.9)

If you can tell me how to update to 1.9.10, I’d be happy to run  
this and a few other tests. Also, if I should be posting bugs  
somewhere else, please let me know.

## Here’s a bit of code to reproduce a seg fault:

require ‘wx’  
include Wx

class MyGui \< App  
def on\_init  
frame = Frame.new(nil, -1, ‘Seg fault’)  
panel = Panel.new(frame, -1)

500.times { Window.new(frame) }

```
    frame.show()
end

```

end

## MyGui.new.main\_loop()

If the number is 64 (instead of 500), it doesn’t seg fault  
(on my system).

Keep up the good work Alex. I’m looking forward to the  
new release.

---

<div class="post-metadata">

**Author:** ![rmcghee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@rmcghee](https://www.ruby-forum.com/u/rmcghee)\
**Post date:** [February 5, 2009, 4:04am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489/2 "2009-02-05T04:04:56Z")

</div>

Ridge M. wrote:

> # Windows XP Professional + SP3
> 
> # ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> 
> # wxruby (1.9.9)
> 
> If you can tell me how to update to 1.9.10, I’d be happy to run  
> this and a few other tests.

It can sometimes take a little time for the gem indexes to update, but  
it seems to have happened now:

Abaddon:~ alex$ sudo gem install wxruby  
Successfully installed wxruby-1.9.10-universal-darwin-9  
1 gem installed  
Abaddon:~ alex$ ruby -v  
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

As an alternative, you can always download the gem file from  
[http://rubyforge.org/frs/?group\_id=35](http://rubyforge.org/frs/?group_id=35) and then do “gem install  
” to install from a local file.

> Also, if I should be posting bugs  
> somewhere else, please let me know.

Here is fine. If you have a rubyforge account, you can instead post bugs  
direct to the rubyforge tracker  
[http://rubyforge.org/tracker/?atid=218&group\_id=35](http://rubyforge.org/tracker/?atid=218&group_id=35) which helps us track  
them. Being logged in when filing a bug ensures we can get further  
information if needed.

> 500.times { Window.new(frame) }
> 
> ```
> frame.show()
> end
> 
> ```
> 
> end
> 
> ## MyGui.new.main\_loop()

Thanks for the sample code. It works fine for me on OS X; I’ll try it on  
Windows when I get a chance.

alex

---

<div class="post-metadata">

**Author:** ![rmcghee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@rmcghee](https://www.ruby-forum.com/u/rmcghee)\
**Post date:** [February 5, 2009, 1:21am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489/3 "2009-02-05T01:21:05Z")

</div>

Ridge M. wrote:

> # Windows XP Professional + SP3
> 
> # ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> 
> # wxruby (1.9.9)
> 
> If you can tell me how to update to 1.9.10, I’d be happy to run  
> this and a few other tests. Also, if I should be posting bugs  
> somewhere else, please let me know.
> 
> ## Here’s a bit of code to reproduce a seg fault:
> 
> require ‘wx’  
> include Wx
> 
> class MyGui \< App  
> def on\_init  
> frame = Frame.new(nil, -1, ‘Seg fault’)  
> panel = Panel.new(frame, -1)
> 
> 500.times { Window.new(frame) }
> 
> ```
> frame.show()
> end
> 
> ```
> 
> end
> 
> ## MyGui.new.main\_loop()
> 
> If the number is 64 (instead of 500), it doesn’t seg fault  
> (on my system).
> 
> Keep up the good work Alex. I’m looking forward to the  
> new release.

I should note that:

“gem install wxruby” still points to 1.9.9 (as of 2009-Feb-04 16:00:00  
PST)  
“gem install wxruby2” doesn’t work (and probably isn’t supposed to)

---

<div class="post-metadata">

**Author:** ![rmcghee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@rmcghee](https://www.ruby-forum.com/u/rmcghee)\
**Post date:** [February 7, 2009, 4:44am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489/4 "2009-02-07T04:44:38Z")

</div>

Alex F. wrote:

> Ridge M. wrote:
> 
> > # Windows XP Professional + SP3
> > 
> > # ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> > 
> > # wxruby (1.9.9)
> > 
> > If you can tell me how to update to 1.9.10, I’d be happy to run  
> > this and a few other tests.
> 
> It can sometimes take a little time for the gem indexes to update, but  
> it seems to have happened now:

Yep, I just installed 1.9.10 - thanks.

> Thanks for the sample code. It works fine for me on OS X; I’ll try it on  
> Windows when I get a chance.

I just tried it on 1.9.10 and it still seg faults (on exit).

Ridge

---

<div class="post-metadata">

**Author:** ![rmcghee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@rmcghee](https://www.ruby-forum.com/u/rmcghee)\
**Post date:** [February 7, 2009, 10:36am UTC](https://www.ruby-forum.com/t/wxruby-segmentation-fault/159489/5 "2009-02-07T10:36:50Z")

</div>

Hi Ridge,

2009/2/7 Ridge M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I just tried it on 1.9.10 and it still seg faults (on exit).

I’ve been able to reproduce the seg fault with ruby-1.9.1 on MinGW.  
On Linux, the exit takes some time but does not seg faults.

Chauk-Mean.
