Joel VanderWerf
2006-Sep-01 06:48 UTC
[fxruby-users] ruby-1.8.5 loads fox16.so more than once
Hi, all, After upgrading ruby from 1.8.4 to 1.8.5, loading fox16 causes a warning for each constant, and $" shows that the .so has been loaded more than once (see below). I remember reporting this long ago for ruby 1.9 [1]. Maybe something from 1.9 has now appeared in 1.8.5 that is causing this problem? Could it be that I just need to rebuild fox16 against the newer ruby? [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/117682 $ ruby -vr fox16 -e ''p $".grep(/fox/)'' ruby 1.8.4 (2005-12-24) [i686-linux] /usr/local/lib/ruby/site_ruby/1.8/fox16/core.rb:177: warning: method redefined; discarding old readBoolEntry /usr/local/lib/ruby/site_ruby/1.8/fox16/core.rb:185: warning: method redefined; discarding old writeBoolEntry /usr/local/lib/ruby/site_ruby/1.8/fox16/aliases.rb:3573: warning: method redefined; discarding old position ["fox16.so", "fox16/core.rb", "fox16/dict.rb", "fox16/settings.rb", "fox16/iterators.rb", "fox16/keys.rb", "fox16/aliases.rb", "fox16/responder2.rb", "fox16/responder.rb", "fox16/timeout.rb", "fox16/chore.rb", "fox16/signal.rb", "fox16/input.rb", "fox16/glgroup.rb", "fox16/execute_nonmodal.rb", "fox16/version.rb"] $ ruby -vr fox16 -e ''p $".grep(/fox/)'' ruby 1.8.5 (2006-08-25) [i686-linux] /usr/local/lib/ruby/site_ruby/1.8/fox16/core.rb:177: warning: method redefined; discarding old readBoolEntry /usr/local/lib/ruby/site_ruby/1.8/fox16/core.rb:185: warning: method redefined; discarding old writeBoolEntry /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant TRUE /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant FALSE /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant MAYBE /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant NULL /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant SEL_NONE /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant SEL_KEYPRESS . . . initialized constant ID_REFRESH /usr/local/lib/ruby/site_ruby/1.8/i686-linux/fox16.so: warning: already initialized constant ID_LAST /usr/local/lib/ruby/site_ruby/1.8/fox16/aliases.rb:3573: warning: method redefined; discarding old position ["fox16/core.rb", "fox16/dict.rb", "fox16/settings.rb", "fox16/execute_nonmodal.rb", "fox16.so", "fox16/version.rb", "fox16.so", "fox16/glgroup.rb", "fox16.so", "fox16/responder.rb", "fox16/timeout.rb", "fox16/chore.rb", "fox16/signal.rb", "fox16/input.rb", "fox16/responder2.rb", "fox16.so", "fox16/aliases.rb", "fox16.so", "fox16/keys.rb", "fox16.so", "fox16/iterators.rb", "fox16.so"] -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Lyle Johnson
2006-Sep-01 11:35 UTC
[fxruby-users] ruby-1.8.5 loads fox16.so more than once
On Sep 1, 2006, at 1:48 AM, Joel VanderWerf wrote:> Hi, all, > > After upgrading ruby from 1.8.4 to 1.8.5, loading fox16 causes a > warning > for each constant, and $" shows that the .so has been loaded more than > once (see below). > > I remember reporting this long ago for ruby 1.9 [1]. Maybe something > from 1.9 has now appeared in 1.8.5 that is causing this problem? > > Could it be that I just need to rebuild fox16 against the newer ruby? > > [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/117682Well, this is no good. I''m seeing the same problem on Mac OS X with fox16 built against Ruby 1.8.5 -- so I don''t have any reason to believe that rebuilding will make the problem go away. And I see that you didn''t get any responses to your post to ruby-core (did you?) I guess I need to run this under the debugger and see what''s going on (i.e. why it''s loading the shared object more than once). Surely the semantics of require haven''t changed?
Joel VanderWerf
2006-Sep-01 18:04 UTC
[fxruby-users] ruby-1.8.5 loads fox16.so more than once
Lyle Johnson wrote:> On Sep 1, 2006, at 1:48 AM, Joel VanderWerf wrote: > >> Hi, all, >> >> After upgrading ruby from 1.8.4 to 1.8.5, loading fox16 causes a >> warning >> for each constant, and $" shows that the .so has been loaded more than >> once (see below). >> >> I remember reporting this long ago for ruby 1.9 [1]. Maybe something >> from 1.9 has now appeared in 1.8.5 that is causing this problem? >> >> Could it be that I just need to rebuild fox16 against the newer ruby? >> >> [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/117682 > > Well, this is no good. I''m seeing the same problem on Mac OS X with > fox16 built against Ruby 1.8.5 -- so I don''t have any reason to > believe that rebuilding will make the problem go away. And I see that > you didn''t get any responses to your post to ruby-core (did you?)I can''t seem to find any responses (and I have no clear memory of any). There doesn''t seem to be anything in Mauricio''s 1.8.5 writeup[1] that would explain the problem. [1] http://eigenclass.org/hiki.rb?ruby+1.8.5+changelog> I guess I need to run this under the debugger and see what''s going on > (i.e. why it''s loading the shared object more than once). Surely the > semantics of require haven''t changed? > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users-- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
re: ''noise'' about Constants from multiple loads of fox16.so I have no deep understanding of what is wrong, but I note that the problem also occurs with the Windows version of ruby. My ruby installations are all created with various releases of the OneClickInstaller [oci]. The problem seems to be triggered by require''ing fox. Using oci185-21 with ruby 1.8.5 (2006-08-25) [i386-mswin32] this behaviour is seen with both fox 16 AND fox12. I didn''t see it with whatever recent binary of ruby1.8.4 was shipped with oci184-19, with either fox12 or fox16. To try to ''step through'' the problem without a debugger - which I wouldn''t understand - I renamed the ..ruby\lib\ruby\gems\1.8\gems\fxruby-1.6.1-mswin32\lib\fox16 subdirectory and created an empty one. Then by successively requireing fox16 and importing the library files reported as missing I was able to see when the redefined Constant problem was triggered. By observation, any file in ..\lib\fox16 which itself contains the line "require ''fox16''" was the trigger for the redefined Constant warnings. By commenting out these ''require'' lines I have created a minimal copy of ..\lib\fox16 [containing 15 .rb files] which allows a simple FXruby application (like hello.rb) to start up silently. I make no recommendation that this is a correct or safe thing to do with the fxruby libraries, but I thought I should share what I had found, in the hope that it may lead to a supported and released solution. fwiw, this is what ri has to say about Kernel#require - " The name of the loaded feature is added to the array in $". A feature will not be loaded if it''s name already appears in $". However, the file name is not converted to an absolute path, so that ``require ''a'';require ''./a'''''' will load a.rb twice. " DeeJay, Leicester, UK -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060913/99d8fb75/attachment.html
Lyle Johnson
2006-Sep-13 12:32 UTC
[fxruby-users] ruby-1.8.5 loads fox16.so more than once
On Sep 13, 2006, at 2:46 AM, DeeJay wrote:> fwiw, this is what ri has to say about Kernel#require - > > " The name of the loaded feature is added to the array in $". A > feature will not be loaded if it''s name already appears in $". > However, the file name is not converted to an absolute path, so > that ``require ''a'';require ''./a'''''' will load a.rb twice. "Right, and this is the behavior that got broken in Ruby 1.8.5. I''ve already posted the bug to the ruby-core list and Nobu says that he''s fixed it in CVS (i.e. it should be working by Ruby 1.8.6). For any follow-up on this, please refer to: http://rubyforge.org/tracker/index.php? func=detail&aid=5633&group_id=300&atid=1223 Thanks, Lyle