Hi all, How soon can we do our alpha (binary gem) release? 1. I would like to get the samples working a bit better, but am ok simply documenting most of the current problems. Do the samples crash every few minutes for other people? Or is it just me? I would like to have a copyright/license comment at the top of every sample file before the alpha release. 2. I would like to receive and merge a patch that causes get_ruby_object to return Qnil when null is passed in. 3. The gem I built didn''t seem to work on my system (Ubuntu GNU/Linux Dapper 6.06). I know almost nothing about gems. The spec looked reasonable at a glance (it included both wx.rb and wxruby2.so). I would be happy to debug it if someone who knows gems could guide me. How close are we to having binary gems for our three main platforms? Anything else? Kevin
Kevin Smith wrote:> 2. I would like to receive and merge a patch that causes get_ruby_object > to return Qnil when null is passed in. >Does the attached do the trick? IANAC++P but it seems to work.> 3. The gem I built didn''t seem to work on my system (Ubuntu GNU/Linux > Dapper 6.06). I know almost nothing about gems. The spec looked > reasonable at a glance (it included both wx.rb and wxruby2.so). I would > be happy to debug it if someone who knows gems could guide me.What happened? - Did it install ok (running ''gem install wxruby'')? - If so, what do you get when you run ''ruby -rubygems -e ''require "wxruby"''?> How close > are we to having binary gems for our three main platforms? >Good to go on OS X PPC. Following some advice on clr, I''m guessing it''s best we build our OS X gem on 10.3, not 10.4. I assume OS X i686 = 10.4 which I hope Sean will be able to help with. alex -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Window.i.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060816/973fd8eb/attachment-0001.pl
> Good to go on OS X PPC. Following some advice on clr, I''m guessing it''s > best we build our OS X gem on 10.3, not 10.4. I assume OS X i686 = 10.4 > which I hope Sean will be able to help with.I''ll do my best, it all depends when the release happens and when my wife gives birth :) The birth should be sometime in the next 2 weeks not sure about the alpha release. Sean
Kevin Smith
2006-Aug-17 23:48 UTC
[Wxruby-users] get_ruby_object patch (was: wxruby2 alpha status)
On Wed, 2006-08-16 at 02:02 +0100, Alex Fenton wrote:> Kevin Smith wrote: > > 2. I would like to receive and merge a patch that causes get_ruby_object > > to return Qnil when null is passed in. > > > Does the attached do the trick? IANAC++P but it seems to work.Looks good to me. I didn''t have a test case so I don''t know for sure if it actually works. I committed it. Thanks, Kevin
Kevin Smith
2006-Aug-17 23:55 UTC
[Wxruby-users] wxruby gem not working (was: wxruby2 alpha status)
On Wed, 2006-08-16 at 02:02 +0100, Alex Fenton wrote:> Kevin Smith wrote: > > 3. The gem I built didn''t seem to work on my system (Ubuntu GNU/Linux > > Dapper 6.06). I know almost nothing about gems. The spec looked > > reasonable at a glance (it included both wx.rb and wxruby2.so). I would > > be happy to debug it if someone who knows gems could guide me.> What happened? > - Did it install ok (running ''gem install wxruby'')?kevins at aria:~/work/wxruby2$ rake gem (in /home/kevins/work/wxruby2) Successfully built RubyGem Name: wxruby Version: 1.9.0 File: wxruby-1.9.0-i486-linux.gem kevins at aria:~/work/wxruby2$ sudo gem install wxruby-1.9.0-i486-linux.gem Attempting local installation of ''wxruby-1.9.0-i486-linux.gem'' Successfully installed wxruby, version 1.9.0 kevins at aria:~/work/wxruby2$ ruby samples/minimal/minimal.rb Unable to load wxruby. Searched: /usr/local/lib/site_ruby/1.8 /usr/local/lib/site_ruby/1.8/i486-linux /usr/local/lib/site_ruby/1.8/i386-linux /usr/local/lib/site_ruby /usr/lib/ruby/1.8 /usr/lib/ruby/1.8/i486-linux /usr/lib/ruby/1.8/i386-linux . The problem seems to be with $LOAD_PATH on my end: kevins at aria:~/work/wxruby2$ irb irb(main):001:0> puts $LOAD_PATH /usr/local/lib/site_ruby/1.8 /usr/local/lib/site_ruby/1.8/i486-linux /usr/local/lib/site_ruby/1.8/i386-linux /usr/local/lib/site_ruby /usr/lib/ruby/1.8 /usr/lib/ruby/1.8/i486-linux /usr/lib/ruby/1.8/i386-linux . Shouldn''t those duplicates have /lib/ on the end of the second one in each case?> - If so, what do you get when you run ''ruby -rubygems -e ''require "wxruby"''?kevins at aria:~/work/wxruby2$ ruby -rubygems -e ''require "wxruby"'' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'': no such file to load -- wxruby (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' from -e:1 -------------------------------- Hm. It put stuff here: kevins at aria:~/work/wxruby2$ dir /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.0-i486-linux/lib/ wx.rb wxruby2.so Kevin
Kevin Smith wrote:> kevins at aria:~/work/wxruby2$ rake gem > (in /home/kevins/work/wxruby2) > Successfully built RubyGem > Name: wxruby > Version: 1.9.0 > File: wxruby-1.9.0-i486-linux.gem >looks good> kevins at aria:~/work/wxruby2$ sudo gem install wxruby-1.9.0-i486-linux.gem > Attempting local installation of ''wxruby-1.9.0-i486-linux.gem'' > Successfully installed wxruby, version 1.9.0 >looks good> kevins at aria:~/work/wxruby2$ ruby samples/minimal/minimal.rb >As you surmised, looks like you need to tell ruby to try requiring from gems directories as well as the usual LOAD_PATH. try ruby -rubygems samples/minimal/minimal.rb or, alternatively, export RUBYOPT=rubygems to affect all subsequent invocations of ruby. This option is typically added to default environment variables automatically by the windows installer for example, so transparent to them.>> - If so, what do you get when you run ''ruby -rubygems -e ''require "wxruby"''? >> > > kevins at aria:~/work/wxruby2$ ruby -rubygems -e ''require "wxruby"'' >Sorry, my bad should be ruby -rubygems -e ''require "wx"''> kevins at aria:~/work/wxruby2$ > dir /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.0-i486-linux/lib/ > wx.rb wxruby2.solooks correct cheers alex
On Fri, 2006-08-18 at 01:04 +0100, Alex Fenton wrote:> As you surmised, looks like you need to tell ruby to try requiring from > gems directories as well as the usual LOAD_PATH. try > > ruby -rubygems samples/minimal/minimal.rb > > or, alternatively, > > export RUBYOPT=rubygemsThanks for your quick reply. Here are those results: kevins at aria:~/work/wxruby2$ ruby -rubygems samples/minimal/minimal.rb /usr/local/lib/site_ruby/1.8/wx.rb:20: uninitialized constant Wxruby2 (NameError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' from samples/minimal/minimal.rb:1 kevins at aria:~/work/wxruby2$ export RUBYOPT=rubygems kevins at aria:~/work/wxruby2$ ruby samples/minimal/minimal.rb /usr/local/lib/site_ruby/1.8/wx.rb:20: uninitialized constant Wxruby2 (NameError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' from samples/minimal/minimal.rb:1 I just updated gem, in case that was a problem. No change. More data, in case it helps: kevins at aria:~/work/wxruby2$ ruby --version ruby 1.8.4 (2005-12-24) [i486-linux] kevins at aria:~/work/wxruby2$ irb -rubygems irb(main):001:0> puts $LOAD_PATH /usr/local/lib/site_ruby/1.8 /usr/local/lib/site_ruby/1.8/i486-linux /usr/local/lib/site_ruby/1.8/i386-linux /usr/local/lib/site_ruby /usr/lib/ruby/1.8 /usr/lib/ruby/1.8/i486-linux /usr/lib/ruby/1.8/i386-linux . => nil Kevin
I just fixed my gem problem. Sorry for the noise on this list. It seems that half of my gem stuff was in /usr/lib and the other half was in /usr/local/lib. I ended up blowing away everything gem, then reinstalling gem 0.9.0. After re-fixing my $RUBYOPT (which was not the problem before), it now works. HOORAY! So I installed the wx gem, and was able to run the minimal app. Sweet. Should rake install build and install the gem, by default? Is it possible to tell gem to install over an existing gem, even if the version is the same? Kevin
On Sun, 2006-08-13 at 15:19 -0400, Kevin Smith wrote:> Hi all, > > How soon can we do our alpha (binary gem) release?How about this weekend?> 1. I would like to get the samples working a bit better, but am ok > simply documenting most of the current problems. Do the samples crash > every few minutes for other people? Or is it just me? I would like to > have a copyright/license comment at the top of every sample file before > the alpha release.I can add license comments to all the samples. For the known bugs, and problems running samples, perhaps we could mention the most serious problems in README, but also include a link to a page on the wiki. That way we could update the problem list even after the release. We don''t expect this release to have a long life, so I think something quick and dirty is sufficient. I plan to be very clear in the README that this is a very early release, so people don''t expect too much from it. That same message needs to come through clearly in all release announcements.> 2. I would like to receive and merge a patch that causes get_ruby_object > to return Qnil when null is passed in.This was done.> 3. The gem I built didn''t seem to work on my system (Ubuntu GNU/Linux > Dapper 6.06). I know almost nothing about gems. The spec looked > reasonable at a glance (it included both wx.rb and wxruby2.so). I would > be happy to debug it if someone who knows gems could guide me. How close > are we to having binary gems for our three main platforms?My gem problem has been solved. Any other issues with the gem?> Anything else?It would be cool to include the API docs, but could we just point to an online copy for now? Anything else else? Kevin
Kevin Smith wrote:> I ended up blowing away everything gem, then reinstalling gem 0.9.0. > After re-fixing my $RUBYOPT (which was not the problem before), it now > works. >Nice one! Thanks for your patience.> Should rake install build and install the gem, by default?Maybe not? - when testing new features etc I usually do ruby -Ilib samples/foo/bar.rb To run the code against my changes - but also keep a ''stable'' reference version installed in gems.> Is it possible to tell gem to install over an existing gem, even if the > version is the same?It seems to me to do this by default, if you say ''sudo gem install wxruby''. See below. Maybe the --force option but I don''t think it''s intended for this. cheers alex SCIPIUS alex$ ls -al /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.0-powerpc-darwin7.9.0/lib total 27984 drwxr-xr-x 4 root wheel 136 18 Aug 05:37 . drwxr-xr-x 4 root wheel 136 18 Aug 05:37 .. -rw-r--r-- 1 root wheel 512 18 Aug 05:42 wx.rb -rw-r--r-- 1 root wheel 14321420 18 Aug 05:42 wxruby2.bundle SCIPIUS alex$ mv lib/wxruby2.bundle lib/wxruby2.bundle_real SCIPIUS alex$ touch lib/wxruby2.bundle SCIPIUS alex$ rake gem (in /Users/alex/code/wxruby2) Successfully built RubyGem Name: wxruby Version: 1.9.0 File: wxruby-1.9.0-powerpc-darwin7.9.0.gem mv wxruby-1.9.0-powerpc-darwin7.9.0.gem wxruby-1.9.0-powerpc-darwin.gem SCIPIUS alex$ sudo gem install wxruby Attempting local installation of ''wxruby'' Successfully installed wxruby, version 1.9.0 SCIPIUS alex$ ls -al /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.0-powerpc-darwin7.9.0/lib total 8 drwxr-xr-x 4 root wheel 136 18 Aug 05:37 . drwxr-xr-x 4 root wheel 136 18 Aug 05:37 .. -rw-r--r-- 1 root wheel 512 18 Aug 05:44 wx.rb -rw-r--r-- 1 root wheel 0 18 Aug 05:44 wxruby2.bundle
> > How soon can we do our alpha (binary gem) release? > > How about this weekend?I am working on TreeCtrl and hope to have a better version ready to upload later tonight or tomorrow. Besides that all the patches I have made have been committed. Sean
Kevin Smith wrote:> On Sun, 2006-08-13 at 15:19 -0400, Kevin Smith wrote: > >> Hi all, >> >> How soon can we do our alpha (binary gem) release? >> > > How about this weekend? >I''m available to do a build. The things I''m working on are all incremental and not worth delaying for.> I plan to be very clear in the README that this is a very early release, > so people don''t expect too much from it. That same message needs to come > through clearly in all release announcements. >Yep. We don''t want to over-promise and disappoint. Equally, I think we should mention what is exciting and new about this release, from an end-user perspective. Otherwise, people might be like ''They spent years re-engineering and 18 months since last release - for what?'' - Looks much better on Linux (I hear) b/c of GTK-2 support - Vastly improved support for OS X - Lots of new classes and methods - UTF-8 support by default - Binary packages for all major platforms - Better future development potential via SWIG.> It would be cool to include the API docs, but could we just point to an > online copy for now? >Yep.> Anything else else?Not that I can think of think of ;) alex
On Fri, 2006-08-18 at 06:43 +0100, Alex Fenton wrote:> Kevin Smith wrote: > >> How soon can we do our alpha (binary gem) release? > >> > > How about this weekend?As "this weekend" comes to an end, it''s clear the release won''t happen quite that soon. I am optimistic that we may have a release ready before the end of this coming week. I am waiting to hear from a couple Linux gem testers. The samples still need license notices. The README (or some file) should describe "known problems" in some detail, including cases where the samples don''t work as expected, and also general library problems. Those are the only tasks I can think of that are holding up the release.> Equally, I think we should mention what is exciting and new about this > release, from an end-user perspective. Otherwise, people might be like > ''They spent years re-engineering and 18 months since last release - for > what?''Very true. I just overhauled the README file, and included a lengthy FAQ section that addresses this issue. I have pasted that section below, and would appreciate any feedback, or suggestions for additional questions to include. (Apologies for the formatting here due to email wrapping at 65 characters). Kevin ------------------------FAQ--------------------------- - Why would I choose wxruby over FXRuby, Ruby/GTK, or one of the other GUI toolkits? Isn''t wxruby arriving "too late"? There are several great GUI toolkits available for Ruby, but we like wxruby better because it has a combination of features that no other toolkit has: - Cross-platform (MSWindows, Mac OS X, Linux) - Native widgets when possible - Provides a wide selection of widgets - Mature foundation (wxWidgets has been around for over 10 years) - Simple license that is compatible with proprietary and Free Software The really big feature is native widgets. The only other cross-platform toolkits that use native widgets are either limited (Tk) or expensive if you want to develop proprietary software (Qt). We are not saying that those toolkits are bad! Just that wxruby offers a unique set of features. - Why are native widgets important or helpful? For one thing, it means that end-users do not have to adjust to a "foreign" interface. It also ensures maximum compatibility with "assistive technology" such as screen readers for blind users. It also allows apps to respect any themes the user may have chosen through their operating system. No matter how hard a toolkit may try to emulate a particular UI, there will always be differences in the look or behavior. - How does wxruby2 relate to wxruby (and the wxruby 0.6.0 release)? wxruby2 is the "next generation" of wxruby. It is being developed by the same wxruby team, and is intended to replace the older code base. wxruby2 is built using SWIG, a powerful tool that makes it much easier to create and maintain wrappers around C/C++ libraries. - Why should I use wxruby2 instead of wxruby? First, because development on the original wxruby codebase has stopped. Everyone is working on wxruby2, so it will continue to improve. Beyond that, wxruby2 has these advantages over wxruby 0.6.0: - Available as binary gems for MSWindows, OS X, and Linux (GTK) - Support for more classes, and more methods within classes - Unicode support - Vastly improved support for OS X - Looks much better under Linux because it uses GTK+2 - Simpler and more permissive license - Wraps wxWidgets 2.6.3 instead of the older 2.4 series - Is wxruby2 ready for "production" use? No. We are still working on memory handling, so the current wxruby2 code has memory leaks, double-free crashes, and other problems. Thanks to the power of SWIG, wxruby2 will soon be more stable and reliable than wxruby 0.6.0 (which also was never really stable enough for heavy-duty "production" use). - Does wxruby2 support the Xxx class? See the "Documentation" section of the README file, or check the wxruby web site: http://wxruby.org - How are the wxruby 0.6.0 and wxruby2 licenses different? wxruby 0.6.0 was released under the wxWindows license, which is a modified LGPL. It is a good, fair license, allowing use in both Free Software and proprietary applications. However, it is long and complex, and is more appropriate for compiled code. wxruby2 is available under a *very* simple MIT-style license, which allows just about any use with very few restrictions. - The API doesn''t seem very Ruby-like The current API is basically a straight port of the wxWidgets C++ interface. Well, actually it has several of the same adjustments that wxPython also had to adopt due to language constraints. This interface is a bit clumsy in spots, thanks to its long history. Over time, we plan to create a Ruby-specific layer on top of the basic wx API, similar to what FXRuby has done for FOX. This enhanced API will be simpler to use, and will be oriented toward the Ruby Way. - I am getting an error trying to compile wxruby2 Please double-check the requirements. You may be using the wrong version of SWIG or some other tool. - I am getting an error trying to run any wxruby2 application, such as the samples that are included in the gem. If you are using Linux, be sure you have configured your system to have RUBYOPT=-rubygems. This can be done in .bashrc or /etc/environment, depending on your distribution and preferences. [More details to follow]. - Why aren''t the wx network, file, date, and other non-GUI classes supported? Because Ruby has its own versions of each of them. We assume you are writing your application in Ruby, so it makes sense to keep as much code as possible in Ruby. We have only wrapped the wx classes that are necessary to write GUI code. - Why has it taken so long for wxruby2 to be released? Nobody is getting paid to develop wxruby, so each of the wxruby developers are limited in the amount of time they can dedicate to the project. We are always looking for more volunteers to help code, test, document, manage the bug list, handle publicity, or do other necessary chores.
On Fri, 2006-08-18 at 05:48 +0100, Alex Fenton wrote:> Kevin Smith wrote: > > Should rake install build and install the gem, by default? > Maybe not? - when testing new features etc I usually do > > ruby -Ilib samples/foo/bar.rb > > To run the code against my changes - but also keep a ''stable'' reference > version installed in gems.That probably makes sense. For the last few months I have been doing much more patch merging than actual coding, so I haven''t bothered to keep a stable copy around. I have been doing ''rake install'' whenever I have wanted to test a new build. I will probably create some kind of alias that includes -Ilib.> > Is it possible to tell gem to install over an existing gem, even if the > > version is the same? > It seems to me to do this by default, if you say ''sudo gem install > wxruby''. See below. Maybe the --force option but I don''t think it''s > intended for this.It does indeed seem to work. Cool. Kevin
In other news, I got farther running SpaceMonkey than I think I have gotten in a long, long while. I didn''t manage to crash it for a good 35-45 seconds. Of course, since I have no clue what I''m doing, I think I could improve my times. :) Roy
On Sun, 2006-08-20 at 23:11 -0400, Roy Sutton wrote:> In other news, I got farther running SpaceMonkey than I think I have > gotten in a long, long while. I didn''t manage to crash it for a good > 35-45 seconds. Of course, since I have no clue what I''m doing, I think > I could improve my times. :)Wow. That''s great. I actually tried running it myself yesterday, but hit an error pretty quickly with Sizer#add. Have you modified the source code, and if so could you email me some patches or a tarball? I would love to have monkeys working soon after the alpha release, as yet another example of wxruby code. Thanks, Kevin
> Very true. I just overhauled the README file, and included a lengthy FAQ > section that addresses this issue. I have pasted that section below, and > would appreciate any feedback, or suggestions for additional questions > to include.Kevin - I think this FAQ is superb; haven''t got anything to add at the moment. Will copy up to the Wiki when we release. alex
I didn''t modify the source. Once I figured out a little better what I was supposed to be doing I could make it crash a little faster. It wouldn''t be bad to start testing with it to locate bugs once we fix all the demos. Roy Kevin Smith wrote:> On Sun, 2006-08-20 at 23:11 -0400, Roy Sutton wrote: > >> In other news, I got farther running SpaceMonkey than I think I have >> gotten in a long, long while. I didn''t manage to crash it for a good >> 35-45 seconds. Of course, since I have no clue what I''m doing, I think >> I could improve my times. :) >> > > Wow. That''s great. I actually tried running it myself yesterday, but hit > an error pretty quickly with Sizer#add. Have you modified the source > code, and if so could you email me some patches or a tarball? > > I would love to have monkeys working soon after the alpha release, as > yet another example of wxruby code. > > Thanks, > > Kevin > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
I had to remove parameters from 3 or 4 calls to Sizer#add. Very curious that you did not. So now the main screen comes up. As soon as I move the mouse in the playing area, it crashes immediately. Typically your first moves in the game would be to start building a ship, but as soon as I click on a build button once or twice, it crashes. I agree it would make kind of a cool testing platform. Especially if other folks started adding more of the game features that are described in the rules but not yet implemented. Thanks, Kevin On Wed, 2006-08-23 at 09:38 -0400, Roy Sutton wrote:> I didn''t modify the source. Once I figured out a little better what I > was supposed to be doing I could make it crash a little faster. It > wouldn''t be bad to start testing with it to locate bugs once we fix all > the demos. > > Roy > > Kevin Smith wrote: > > On Sun, 2006-08-20 at 23:11 -0400, Roy Sutton wrote: > > > >> In other news, I got farther running SpaceMonkey than I think I have > >> gotten in a long, long while. I didn''t manage to crash it for a good > >> 35-45 seconds. Of course, since I have no clue what I''m doing, I think > >> I could improve my times. :) > >> > > > > Wow. That''s great. I actually tried running it myself yesterday, but hit > > an error pretty quickly with Sizer#add. Have you modified the source > > code, and if so could you email me some patches or a tarball? > > > > I would love to have monkeys working soon after the alpha release, as > > yet another example of wxruby code. > > > > Thanks, > > > > Kevin > > > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users
On Windows, I can build several turns but as soon as a ship would be ready it crashes. Other functions crash it, such as resizing the window past a certain point. I think some problems will be fixed when we get SWIG behaving properly. Sadly, the SWIG people have not responded at all to my call for help. I''ll go stick it in their bug tracker later and maybe write a followup e-mail. I suspect some people may be on vacation so I don''t want to rock things too much. Roy Kevin Smith wrote:> I had to remove parameters from 3 or 4 calls to Sizer#add. Very curious > that you did not. > > So now the main screen comes up. As soon as I move the mouse in the > playing area, it crashes immediately. Typically your first moves in the > game would be to start building a ship, but as soon as I click on a > build button once or twice, it crashes. > > I agree it would make kind of a cool testing platform. Especially if > other folks started adding more of the game features that are described > in the rules but not yet implemented. > > Thanks, > > Kevin > > > On Wed, 2006-08-23 at 09:38 -0400, Roy Sutton wrote: > >> I didn''t modify the source. Once I figured out a little better what I >> was supposed to be doing I could make it crash a little faster. It >> wouldn''t be bad to start testing with it to locate bugs once we fix all >> the demos. >> >> Roy >> >> Kevin Smith wrote: >> >>> On Sun, 2006-08-20 at 23:11 -0400, Roy Sutton wrote: >>> >>> >>>> In other news, I got farther running SpaceMonkey than I think I have >>>> gotten in a long, long while. I didn''t manage to crash it for a good >>>> 35-45 seconds. Of course, since I have no clue what I''m doing, I think >>>> I could improve my times. :) >>>> >>>> >>> Wow. That''s great. I actually tried running it myself yesterday, but hit >>> an error pretty quickly with Sizer#add. Have you modified the source >>> code, and if so could you email me some patches or a tarball? >>> >>> I would love to have monkeys working soon after the alpha release, as >>> yet another example of wxruby code. >>> >>> Thanks, >>> >>> Kevin >>> >>> >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> >>> >>> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
On Wed, 2006-08-23 at 14:01 -0400, Roy Sutton wrote:> Sadly, the SWIG people have not responded at all to my call for help. > I''ll go stick it in their bug tracker later and maybe write a followup > e-mail. I suspect some people may be on vacation so I don''t want to > rock things too much.You might try contacting the Ruby SWIG developer(s) directly, since this is clearly ruby-specific. That would be Charlie Savage (who I do not know) and Lyle Johnson (who has been very helpful in the past). While I would love to have those problems fixed, I don''t believe they are the cause of most of our crashes. Object ownership and garbage collection are causing most of my problems, in my opinion. I have done some reading, and I have at least one small interesting test case[1], so I hope to research this over the next few days. Kevin [1] Run samples/minimal/minimal.rb. If I bring up the About box at any time, then I get a segfault upon exit. If I avoid the About box, it exits cleanly. So far, my gdb sessions to try to figure this out have not revealed any easy answers.
As discussed previously, I just checked in a change that renames bigdemo/Main.rbw to bigdemo/bigdemo.rb, for consistency with the other samples. Kevin P.S. For some reason, when I tried to post this as a non-reply, rubyforge rejected my message (twice) because it supposedly had Chinese encoding. Odd.
Kevin Smith wrote:> [1] Run samples/minimal/minimal.rb. If I bring up the About box at any > time, then I get a segfault upon exit. If I avoid the About box, it > exits cleanly. So far, my gdb sessions to try to figure this out have > not revealed any easy answers. > >(Un)fortunately this doesn''t crash on Windows with the non-debug build. I may recompile debug to see what happens. I think I was able to get the debugger working once and I didn''t write down what I did so it''s lost to me again. If anyone has any clues for debugging with VC++ they should really post them somewhere. Roy
Kevin Smith
2006-Aug-25 05:26 UTC
[Wxruby-users] Minimal.rb crashes on exit (was: Monkeys in Space...)
On Fri, 2006-08-25 at 00:47 -0400, Roy Sutton wrote:> Kevin Smith wrote: > > [1] Run samples/minimal/minimal.rb. If I bring up the About box at any > > time, then I get a segfault upon exit. If I avoid the About box, it > > exits cleanly. So far, my gdb sessions to try to figure this out have > > not revealed any easy answers. > > > > > (Un)fortunately this doesn''t crash on Windows with the non-debug build. > I may recompile debug to see what happens.Just in case you (or someone else) tries to debug this, here is what I found (at least what I can remember of it): During the main frame destructor, every bit of data I could find looked correct. However, a call to a virtual method crashed because it was calling to a bad (non-code) address. It seemed like the vtable of virtual method pointers had been trashed somehow. Based on the extensive debug output (I had wxDEBUG defined), it sure didn''t look like a double-free problem. If anyone knows how to view the vtable of an object in gdb, please let me know. Kevin
On Fri, 2006-08-25 at 01:26 -0400, Kevin Smith wrote:> During the main frame destructor, every bit of data I could find looked > correct. However, a call to a virtual method crashed because it was > calling to a bad (non-code) address. It seemed like the vtable of > virtual method pointers had been trashed somehow. Based on the extensive > debug output (I had wxDEBUG defined), it sure didn''t look like a > double-free problem.Turns out the problem is simpler...and more complex...than this. If anyone here is really familiar with C++ wxWidgets, please speak up! For Help/About, we create a MessageDialog, and call show_modal on it. When that dialog is closed (with the OK button), the underlying GTK widget is automatically destroyed, and the m_widget member of the dialog is set to NULL. But the dialog itself is not deleted. Ok. When the app terminates, the main window is deleted. Fine. But *after that*, the MessageDialog object is deleted. At one point, the code checks m_parent->GetDefaultItem(). But m_parent is still the main Frame object, which has been deleted, leading to a segfault. So I tried forcing the MessageDialog to be deleted right away. I tried calling destroy() and close(), but both of them fail by throwing an assert (in a DEBUG build) because you can''t call destroy() or close() if m_widget is null. Which it is. So at this point, I can''t see a solution. At least this particular crash is not a ruby garbage collection problem. It''s not a double-free. It''s a sequence problem, and I can''t see how to solve it. The puzzling thing is that the docs for C++ wxWidgets repeatedly say you are supposed to call Destroy after ShowModal on a dialog. That''s the equivalent of what I''m doing in wxRuby, and it''s not working. Elsewhere on the wxWidgets site they say to favor Close over Destroy in that case, but that doesn''t work for me either. I guess I''ll have to write a C++ sample to try to figure out why the wxRuby case is different. At the moment, it looks like a couple bad asserts in wxWidgets. Kevin
On Fri, 2006-08-25 at 19:36 -0400, Kevin Smith wrote:> For Help/About, we create a MessageDialog, and call show_modal on it. > When that dialog is closed (with the OK button), the underlying GTK > widget is automatically destroyed, and the m_widget member of the dialog > is set to NULL. But the dialog itself is not deleted. Ok.Great news! I fixed the bug. Turns out the fix was relatively simple, although it does have some significant effects (see the ***NOTE*** items below). We had declared Dialog to have a superclass of Window, but at least on my platform, it actually extends TopLevelWindow. Because we had it wrong, calls to Dialog#destroy were being routed incorrectly, leading to the asserts I was puzzled by. After fixing the inheritance, I also had to fix the minimal.rb sample to clean up its MessageDialog right away. After coming back from show_modal, you must call MessageDialog#destroy. Otherwise, the dialog may remain in memory until after the main frame has been deleted, and you will get a segfault on app exit. ***NOTE*** This means that ALL the samples need to be updated to call destroy on any dialogs that get created. ***NOTE*** My fix may not work on all platforms. I believe it will, but there is a chance you might get a compile error. If so, we''ll have to figure out how to work around it. ***NOTE*** On my platform (and I believe on the others as well), Dialog actually extends DialogBase, which extends TopLevelWindow. There don''t seem to be any virtual methods in DialogBase, so for now we don''t have to expose it. However, I believe in the long run it would be safer to do so. It''s frustrating that it took me so long to diagnose a relatively simple problem. I have been hit by this before, so for all future bugs one of the first things I will look at is the full inheritance chain. Kevin