Alex Ciarlillo
2007-Jul-10 16:08 UTC
Seg Fault caused by StatusBar. Am I doing something wrong?
Some odd bug cropped up when I made a bunch of code changes to my app recently. I started getting the following everytime I closed the app: ---------------------------------- [BUG] Segmentation fault ruby 1.8.6 (2007-03-13) [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. ---------------------------------------------- So I just started commenting everything out that wasn''t completely necessary until it stopped. Here is the line which is responsible: class MyFrame < Wx::Frame def initialize(*args) super(*args) ### cut a bunch of commented out code that appears fine ### @statbar = StatusBar.new(self, -1) ### cut a bunch more code ### end end If I comment out the statbar line the app exits fine, if I leave it in I get the seg fault. Anyone have an idea why? Am I initializing it incorrectly or something? thanks, -alex
Mario Steele
2007-Jul-11 04:37 UTC
[Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong?
Hello Mr. Ciarlillo, First thing I notice, is that StatusBar.new isn''t with the Wx namespace, are you ensuring that the Wx namespace is being included in the top source? If it is, then class MyFrame < Wx::Frame is not needed, it can be changed to class MyFrame < Frame. Otherwise, I see no problems with the Initialization of the StatusBar class. May be a memory bug, which will be solved with the 1.9 Pre-Beta release. Speaking of which, Mr. Fenton, are you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? Just kinda curious there, cause I''m thinking of starting up a new project for a complete IDE, including a wxDialog Editor, similar to what wxGlade does, maybe even allow it to generate the wxRuby2 Code itself. Dunno, maybe allow preference to the developer on how that is setup. L8ers, Mario Steele On Tue, 10 Jul 2007 11:08:48 -0500, Alex Ciarlillo <ac251404 at ohio.edu> wrote:> Some odd bug cropped up when I made a bunch of code changes to my app > recently. I started getting the following everytime I closed the app: > ---------------------------------- > [BUG] Segmentation fault > ruby 1.8.6 (2007-03-13) [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. > ---------------------------------------------- > > So I just started commenting everything out that wasn''t completely > necessary until it stopped. Here is the line which is responsible: > > class MyFrame < Wx::Frame > def initialize(*args) > super(*args) > ### cut a bunch of commented out code that appears fine ### > @statbar = StatusBar.new(self, -1) > ### cut a bunch more code ### > end > end > > If I comment out the statbar line the app exits fine, if I leave it in I > get the seg fault. Anyone have an idea why? Am I initializing it > incorrectly or something? > > thanks, > -alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users-- Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/
Alex Ciarlillo
2007-Jul-11 15:01 UTC
[Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong?
I have included Wx namespace, but I also tried with Wx not included and using the Wx:: prefix. No luck. Thanks -AC Mario Steele wrote:> Hello Mr. Ciarlillo, > > First thing I notice, is that StatusBar.new isn''t with the Wx namespace, > are you ensuring that the Wx namespace is being included in the top > source? If it is, then class MyFrame < Wx::Frame is not needed, it can be > changed to class MyFrame < Frame. Otherwise, I see no problems with the > Initialization of the StatusBar class. May be a memory bug, which will be > solved with the 1.9 Pre-Beta release. Speaking of which, Mr. Fenton, are > you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? > Just kinda curious there, cause I''m thinking of starting up a new project > for a complete IDE, including a wxDialog Editor, similar to what wxGlade > does, maybe even allow it to generate the wxRuby2 Code itself. Dunno, > maybe allow preference to the developer on how that is setup. > > L8ers, > > Mario Steele > > On Tue, 10 Jul 2007 11:08:48 -0500, Alex Ciarlillo <ac251404 at ohio.edu> > wrote: > > >> Some odd bug cropped up when I made a bunch of code changes to my app >> recently. I started getting the following everytime I closed the app: >> ---------------------------------- >> [BUG] Segmentation fault >> ruby 1.8.6 (2007-03-13) [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. >> ---------------------------------------------- >> >> So I just started commenting everything out that wasn''t completely >> necessary until it stopped. Here is the line which is responsible: >> >> class MyFrame < Wx::Frame >> def initialize(*args) >> super(*args) >> ### cut a bunch of commented out code that appears fine ### >> @statbar = StatusBar.new(self, -1) >> ### cut a bunch more code ### >> end >> end >> >> If I comment out the statbar line the app exits fine, if I leave it in I >> get the seg fault. Anyone have an idea why? Am I initializing it >> incorrectly or something? >> >> thanks, >> -alex >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > >
Alex Fenton
2007-Jul-12 17:27 UTC
[Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong?
Hi Alex On Tue, 2007-07-10 at 12:08 -0400, Alex Ciarlillo wrote:> Some odd bug cropped up when I made a bunch of code changes to my app > recently. I started getting the following everytime I closed the app: > ---------------------------------- > [BUG] Segmentation fault > ruby 1.8.6 (2007-03-13) [i386-mswin32]Looks like a GC-related bug - when the App closes, Ruby does a last sweep, which sometimes turns up bugs. Does it help if you call set_status_bar(@statbar) Unfortunately I had my laptop nicked the other day so it''ll take a little while before I can debug this. I''ve added it as a bug on the Rubyforge tracker. cheers alex
Alex Ciarlillo
2007-Jul-12 17:40 UTC
[Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong?
I tried you''re suggestion and it did not work, but I did it get working. I had to use the create_status_bar method of the frame, so I changed the line to: @statbar = self.create_status_bar and it works fine now. Hopefully that tells you something. Thanks! -AC Alex Fenton wrote:> Hi Alex > > On Tue, 2007-07-10 at 12:08 -0400, Alex Ciarlillo wrote: > >> Some odd bug cropped up when I made a bunch of code changes to my app >> recently. I started getting the following everytime I closed the app: >> ---------------------------------- >> [BUG] Segmentation fault >> ruby 1.8.6 (2007-03-13) [i386-mswin32] >> > > Looks like a GC-related bug - when the App closes, Ruby does a last > sweep, which sometimes turns up bugs. Does it help if you call > > set_status_bar(@statbar) > > Unfortunately I had my laptop nicked the other day so it''ll take a > little while before I can debug this. I''ve added it as a bug on the > Rubyforge tracker. > > cheers > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >
Hey Mario Mario Steele wrote:> Speaking of which, Mr. Fenton, are > you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? > Just kinda curious there, cause I''m thinking of starting up a new project > for a complete IDE, including a wxDialog Editor, similar to what wxGlade > does, maybe even allow it to generate the wxRuby2 Code itself.That sounds like a really cool project, and Wx::Scintilla is a great component - perhaps it might tempt the FreeRide people to switch over cos I think FxRuby really has little to offer versus wxRuby. But I don''t personally feel able to put the time into it right now - at the moment all the other devs are tied up and I want to work on some other stuff so I''m looking to do the minimal stability fixes at the mo. Sorry. I''d happily help others and/or accept patches. best alex