Zhimin Zhan
2009-Mar-31 05:02 UTC
Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
Hi, I occasionally had the following error when application in idle state. Error: undefined method ''calc_min'' for #<Wx::IdleEvent:0xb115e44> OS: WXMSW Ruby Version: 1.8.6 wxRuby 2.0.0 Backtrace: (eval):154:in `calc_min'' (eval):154:in `layout'' (eval):154:in `process_event'' (eval):154:in `on_run'' (eval):154:in `main_loop'' Zhimin -- Posted via http://www.ruby-forum.com/.
Eric Will
2009-Mar-31 12:13 UTC
[wxruby-users] Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
On Tue, Mar 31, 2009 at 1:02 AM, Zhimin Zhan <lists at ruby-forum.com> wrote:> Hi, > > I occasionally had the following error when application in idle state. > > Error: undefined method ''calc_min'' for #<Wx::IdleEvent:0xb115e44>I''ve been having a related problem, and I''ve sent Alex some code to reproduce. Mine happens when show()''ing a certain Frame, and I can''t track it down. Only happens on 1.9 for me, though. -- Eric Will
Eric Will
2009-Mar-31 18:57 UTC
[wxruby-users] Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
Are you using DataMapper? I''ve tracked this as my issue. I don''t know what''s wrong exactly, but after using DM to pull out a large amount of data I get this. I think it''s destroying the heap or something, somehow. It only happens in 1.9 for me. It''s so odd. I''m going to have to fall back to just using the mysql module to pull the data itself, then use DM to objectify them when I need them. It''s definitely DM, but I couldn''t find a rhyme or reason to any of the problems. It changes every time, and sometimes works fine. It has something to do with GC as well, because when I fiddle with the GC settings it works a lot better, but ultimately crashes anyway.
Eric Will
2009-Mar-31 20:07 UTC
[wxruby-users] Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
On Mar 31, 2009, at 2:57 PM, Eric Will <rakaur at malkier.net> wrote:> Are you using DataMapper?Seems mysql causes the same problem. I''m at a total loss.
Alex Fenton
2009-Mar-31 20:14 UTC
[wxruby-users] Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
Hi Eric Eric Will wrote:> Are you using DataMapper? > > I''ve tracked this as my issue. I don''t know what''s wrong exactly, but > after using DM to pull out a large amount of data I get this. I think > it''s destroying the heap or something, somehow. It only happens in 1.9 > for me. It''s so odd. I''m going to have to fall back to just using the > mysql module to pull the data itself, then use DM to objectify them > when I need them. > > It''s definitely DM, but I couldn''t find a rhyme or reason to any of > the problems. It changes every time, and sometimes works fine. It has > something to do with GC as well, because when I fiddle with the GC > settings it works a lot better, but ultimately crashes anyway.Thanks for the follow-up. It could indeed be a bug in another extension or in the ruby interpreter itself. Or it could be a bad interaction between wxRuby and something else. The reason I say the latter is that wxRuby shouldn''t be calling a Sizer method (calc_min) on an object without being sure that that object is indeed a Wx::Sizer. alex
Zhimin Zhan
2009-Mar-31 22:02 UTC
[wxruby-users] Error: undefined method ''calc_min'' for #<Wx::IdleEvent>
> Are you using DataMapper?My app uses Sqlite3. The error happened several times, usually when trying to go back the app after leaving app idle for while. Ruby 1.8.6 p114 wxRuby 2.0.0 on Windows XP Zhimin -- Posted via http://www.ruby-forum.com/.
Eric Rubin
2009-Apr-01 14:37 UTC
[wxruby-users] Error: undefined method ''calc_min'' for#<Wx::IdleEvent>
DataMapper just (Mar 30) released 0.9.11, which fixes some problems with Ruby 1.9, especially in data validation. I haven''t tried it yet, but I''m about to... http://rubyforge.org/projects/datamapper Eric Rubin -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Eric Will Sent: Tuesday, March 31, 2009 2:58 PM To: wxruby-users at rubyforge.org Subject: Re: [wxruby-users] Error: undefined method ''calc_min'' for#<Wx::IdleEvent> Are you using DataMapper? I''ve tracked this as my issue. I don''t know what''s wrong exactly, but after using DM to pull out a large amount of data I get this. I think it''s destroying the heap or something, somehow. It only happens in 1.9 for me. It''s so odd. I''m going to have to fall back to just using the mysql module to pull the data itself, then use DM to objectify them when I need them. It''s definitely DM, but I couldn''t find a rhyme or reason to any of the problems. It changes every time, and sometimes works fine. It has something to do with GC as well, because when I fiddle with the GC settings it works a lot better, but ultimately crashes anyway. _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Eric Will
2009-Apr-02 13:18 UTC
[wxruby-users] Error: undefined method ''calc_min'' for#<Wx::IdleEvent>
On Wed, Apr 1, 2009 at 10:37 AM, Eric Rubin <erubin at valcom.com> wrote:> DataMapper just (Mar 30) released 0.9.11, which fixes some problems with > Ruby 1.9, especially in data validation. ?I haven''t tried it yet, but I''m > about to... > > http://rubyforge.org/projects/datamapper > > Eric RubinI''ll try the new version. I also have plans to mess with the controls in the window, then try it without having DM required at all, and I guess if I have to, rewrite the entire window. -- Eric Will
Eric Will
2009-Apr-02 13:21 UTC
[wxruby-users] Error: undefined method ''calc_min'' for#<Wx::IdleEvent>
On Thu, Apr 2, 2009 at 9:18 AM, Eric Will <rakaur at malkier.net> wrote:> I''ll try the new version. I also have plans to mess with the controls > in the window, then try it without having DM required at all, and I > guess if I have to, rewrite the entire window.Yeah, that didn''t work. Same thing happens on 1.9, and now 1.8 cores the interpreter. Superb. -- Eric Will
Eric Will
2009-Apr-02 14:52 UTC
[wxruby-users] Error: undefined method ''calc_min'' for#<Wx::IdleEvent>
On Thu, Apr 2, 2009 at 9:21 AM, Eric Will <rakaur at malkier.net> wrote:> Yeah, that didn''t work. Same thing happens on 1.9, and now 1.8 cores > the interpreter. Superb.It''s now spontaneously started giving me a calc_min error on an older program that I haven''t changed in ages. Was there a semi-recent wxRuby update? I can''t think of any reason other than something wonky with Wx now. This older program doesn''t use DM at all.> -- Eric Will
Eric Rubin
2009-Apr-02 17:05 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
Going to DataMapper 0.9.11 solved my problem with validation under Ruby 1.9 Eric Rubin -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Eric Will Sent: Thursday, April 02, 2009 9:19 AM To: General discussion of wxRuby Subject: Re: [wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent> On Wed, Apr 1, 2009 at 10:37 AM, Eric Rubin <erubin at valcom.com> wrote:> DataMapper just (Mar 30) released 0.9.11, which fixes some problems with > Ruby 1.9, especially in data validation. ?I haven''t tried it yet, but I''m > about to... > > http://rubyforge.org/projects/datamapper > > Eric RubinI''ll try the new version. I also have plans to mess with the controls in the window, then try it without having DM required at all, and I guess if I have to, rewrite the entire window. -- Eric Will _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Eric Will
2009-Apr-02 17:46 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
On Thu, Apr 2, 2009 at 1:05 PM, Eric Rubin <erubin at valcom.com> wrote:> Going to DataMapper 0.9.11 solved my problem with validation under Ruby 1.9This didn''t do anything for me.> Eric Rubin-- Eric Will
Eric Will
2009-Apr-02 19:03 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
I tried downgrading to wxRuby 1.9.5, and now I get this: /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:195: [BUG] object allocation during garbage collection phase ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] Aborted Using 2.0.0 on 1.8: /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:31:in `calc_min'': undefined method `calc_min'' for "FacilityNumber":String (NoMethodError) [...] So, I don''t know what exactly is going on, but I think it somehow relates to garbage collection. When I try turning it off and/or toying with it in other ways it crashes in different ways. I''m still not ultimately sure what''s going on, but there''s obviously some way wxRuby is involved. I don''t even have to populate the ListCtrl with the data, simply pulling it from the DB manages to do the calc_min() crash. I don''t get how wxRuby is even getting at this stuff. Does it do some sort of introspection/reflection? I''m simply asking the DB for the data, and iterating over it. Simply the act of iterating over it, even if I do nothing more than an empty loop, kills me. I''m going nuts, here. -- Eric
Mario Steele
2009-Apr-05 08:27 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
Firstly, wxRuby 1.9.5 was built specifically for Ruby 1.8.6 p100ish, around that area, so with 1.8.7 p72, there are some major changes to the way memory is handled, and there by, it may be difficult to use older version of wxRuby with newer versionf of the Ruby interpreter. Secondly, It is a Memory allocation issue. More specifically, somehow wxRuby and Ruby are getting their objects mixed up. Every object that you create with wxRuby, is stored internally in the wxRuby library itself, in an Array if you would. This way, we can keep track of the instances of objects, when there is re-direction. By Re-directions, I mean when we need to get the control specifically, for an event that occured, we need to store this information somewhere, where we can look it up. Now cause of this, somehow, wxRuby, or specifically wxWidgets is sending an instance of a control, that it knows to be valid, however, the event handler for calc_size(), which is part of Layout, that wxRuby attempts to parse, can''t find the reference properly, and is returning some other Ruby object that it thinks it matched correctly. Therefore, we need to investigate specifically on the C++ Layer, and on the SWIG Layer, why we are getting invalid objects when it comes to Layout#calc_min. Trust me, it''s extreemly hard to debug something like this. And to track down the source. It could actually be something that has nothing to do with the Memory tracking that we are doing, and in some other off-hand code that we are using to create objects. Simply put, we don''t know, but we are researching the problem. Please be patient with us. thanks, Mario On Thu, Apr 2, 2009 at 2:03 PM, Eric Will <rakaur at malkier.net> wrote:> I tried downgrading to wxRuby 1.9.5, and now I get this: > > > /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:195: > [BUG] object allocation during garbage collection phase > ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] > > Aborted > > Using 2.0.0 on 1.8: > > > /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:31:in > `calc_min'': undefined method `calc_min'' for "FacilityNumber":String > (NoMethodError) > > [...] > > So, I don''t know what exactly is going on, but I think it somehow > relates to garbage collection. When I try turning it off and/or toying > with it in other ways it crashes in different ways. I''m still not > ultimately sure what''s going on, but there''s obviously some way wxRuby > is involved. > > I don''t even have to populate the ListCtrl with the data, simply > pulling it from the DB manages to do the calc_min() crash. I don''t get > how wxRuby is even getting at this stuff. Does it do some sort of > introspection/reflection? I''m simply asking the DB for the data, and > iterating over it. Simply the act of iterating over it, even if I do > nothing more than an empty loop, kills me. > > I''m going nuts, here. > > -- Eric > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20090405/02aa9824/attachment-0001.html>
Eric Will
2009-Apr-05 19:18 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
On Sun, Apr 5, 2009 at 4:27 AM, Mario Steele <mario at ruby-im.net> wrote:> Trust me, it''s extreemly hard to debug something like this.? And to track > down the source.? It could actually be something that has nothing to do with > the Memory tracking that we are doing, and in some other off-hand code that > we are using to create objects.? Simply put, we don''t know, but we are > researching the problem. > > Please be patient with us.Trust me, I know. I used to code in straight C, and I would get difficult problems like this from time to time. I appreciate that you are looking into it. If it helps, it seems to happen less often on 1.8. Sometimes it works fine, sometimes it gives me the calc_min() error. It ALWAYS gives me the calc_min() on 1.9.> > thanks, > > Mario-- Eric Will
Eric Will
2009-Apr-06 16:42 UTC
[wxruby-users] Error: undefined method ''calc_min''for#<Wx::IdleEvent>
This is happening in my EquipmentFinderWindow which is a Wx::Frame. I realize that this doesn''t fix anything, but it "hides" the problem and the window works normally afterward: begin show rescue NoMethodError => e raise unless e =~ /calc_min/ EquipmentFinderWindow.new end I realize it''s not a real fix, and it''s only probably messing stuff up more, but it works, for now... -- Eric Will