Bug #6866

DRb tests hang on OS X

Added by Benoit Daloze over 2 years ago. Updated over 2 years ago.

[ruby-core:47182]
Status:Closed
Priority:Normal
Assignee:Masatoshi Seki
ruby -v:ruby 2.0.0dev (2012-08-14 trunk 36700) [x86_64-darwin10.8.0] Backport:

Description

This seems due to r36456.
The two loops added just keep running. Commenting them seems to solve the problem.
@there.inspect is #

I recently installed TunTap (http://tuntaposx.sourceforge.net/), I'm unsure if it might be related.

Associated revisions

Revision 36709
Added by Benoit Daloze over 2 years ago

Kernel#inspect: improve consistency and do not call #to_s.

  • object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class can now benefit from the nice default #inspect even if it defines #to_s. Also, there is no more unexpected change in #inspect result.
  • NEWS: Add note about the change.
  • bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*): Adapt internal structures (by aliasing #inspect to #to_s) so they don't rely on the removed behavior (#inspect calling overridden #to_s).
  • test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
  • lib/pp.rb (class PP): do not call #to_s anymore, as #inspect no more does (mame).
  • test/test_pp.rb (class PPInspectTest): remove related assertion (mame). [Feature #6130]
  • test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown): adapt DRb tests with the new change (shirosaki). [Bug #6866]

Revision 36709
Added by Benoit Daloze over 2 years ago

Kernel#inspect: improve consistency and do not call #to_s.

  • object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class can now benefit from the nice default #inspect even if it defines #to_s. Also, there is no more unexpected change in #inspect result.
  • NEWS: Add note about the change.
  • bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*): Adapt internal structures (by aliasing #inspect to #to_s) so they don't rely on the removed behavior (#inspect calling overridden #to_s).
  • test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
  • lib/pp.rb (class PP): do not call #to_s anymore, as #inspect no more does (mame).
  • test/test_pp.rb (class PPInspectTest): remove related assertion (mame). [Feature #6130]
  • test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown): adapt DRb tests with the new change (shirosaki). [Bug #6866]

History

#1 Updated by Hiroshi Shirosaki over 2 years ago

This seems related to r36699. It changed #inspect behavior.

DRbObject#to_s is redefined, but #inspect doesn't call #to_s after r36699.
Here is a patch.

diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index 1cb8b1f..d0156fd 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -73,7 +73,7 @@ module DRbCore
def teardown
@ext.stop_service if defined?(@ext) && @ext
DRbService.manager.unregist(@service_name)
- while (@there.inspect rescue nil)
+ while (@there.to_s rescue nil)
# nop
end
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :INT : :TERM
@@ -294,7 +294,7 @@ module DRbAry
def teardown
@ext.stop_service if defined?(@ext) && @ext
DRbService.manager.unregist(@service_name)
- while (@there.inspect rescue nil)
+ while (@there.to_s rescue nil)
# nop
end
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :INT : :TERM

#2 Updated by Benoit Daloze over 2 years ago

h.shirosaki (Hiroshi Shirosaki) wrote:

This seems related to r36699. It changed #inspect behavior.

DRbObject#to_s is redefined, but #inspect doesn't call #to_s after r36699.
Here is a patch.

Thank you. Indeed it solves the problem at me.
I saw Yui Naruse reverted r36699. I ran test-all but did not expect the reason for DRb tests failure to be due to my change, because it happened a few times before.
I'm sorry about this.

@naruse: May I commit r36699 (and r37700) again with the right ChangeLog and this fix?

#3 Updated by Benoit Daloze over 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36709.
Benoit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


Kernel#inspect: improve consistency and do not call #to_s.

  • object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class can now benefit from the nice default #inspect even if it defines #to_s. Also, there is no more unexpected change in #inspect result.
  • NEWS: Add note about the change.
  • bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*): Adapt internal structures (by aliasing #inspect to #to_s) so they don't rely on the removed behavior (#inspect calling overridden #to_s).
  • test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
  • lib/pp.rb (class PP): do not call #to_s anymore, as #inspect no more does (mame).
  • test/test_pp.rb (class PPInspectTest): remove related assertion (mame). [Feature #6130]
  • test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown): adapt DRb tests with the new change (shirosaki). [Bug #6866]

Also available in: Atom PDF