Bug #7607

TypeError: invalid inspect_tbl pair_list on Windows 8

Added by Heesob Park over 2 years ago. Updated over 2 years ago.

[ruby-core:51083]
Status:Closed
Priority:High
Assignee:Usaku NAKAMURA
ruby -v:ruby 2.0.0dev (2012-12-23 trunk 38564) [x64-mswin64_110] Backport:

Description

The changeset r38548 caused following test failures on x64 Windows 8.

2) Error:
test_self_referential(Psych::TestArray):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/psych/helper.rb:36:in assert_cycle'
C:/work/snapshot-ms64/test/psych/test_array.rb:50:in
test_self_referential'
C:/work/snapshot-ms64/lib/test/unit.rb:651:in block in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in
each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:768:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:in run'
./test/runner.rb:17:in
'

3) Error:
test_self_referential(Psych::TestHash):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/psych/helper.rb:36:in assert_cycle'
C:/work/snapshot-ms64/test/psych/test_hash.rb:26:in
test_self_referential'
C:/work/snapshot-ms64/lib/test/unit.rb:651:in block in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in
each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:768:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:in run'
./test/runner.rb:17:in
'

4) Error:
test_self_referential(Psych::TestOmap):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/psych/test_omap.rb:16:in test_self_referential'
C:/work/snapshot-ms64/lib/test/unit.rb:651:in
block in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in
_run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:768:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:in
run'
./test/runner.rb:17:in `'

5) Error:
test_set_self_reference(Psych::TestSet):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/psych/helper.rb:36:in assert_cycle'
C:/work/snapshot-ms64/test/psych/test_set.rb:46:in
test_set_self_reference'

C:/work/snapshot-ms64/lib/test/unit.rb:651:in `block in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in `each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in `_run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:in `run'
C:/work/snapshot-ms64/lib/test/unit.rb:768:in `run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:in `run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:in `run'
./test/runner.rb:17:in `<main>'

6) Error:
test_self_referential_struct(Psych::TestStruct):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/psych/test_struct.rb:27:in test_self_referential_struct'
C:/work/snapshot-ms64/lib/test/unit.rb:651:in
block in _run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in
_run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:768:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:in run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:in
run'
./test/runner.rb:17:in `'

24) Failure:
test_class_nonascii(TestMarshal) [C:/work/snapshot-ms64/test/ruby/test_marshal.rb:302]:
.
Exception raised:
<#>>.

53) Error:
test_comparison_when_recursive(TestRange):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/ruby/test_range.rb:322:in =='
C:/work/snapshot-ms64/test/ruby/test_range.rb:322:in
block in test_comparison_when_recursive'
C:/work/snapshot-ms64/lib/timeout.rb:65:in timeout'
C:/work/snapshot-ms64/test/ruby/test_range.rb:321:in
test_comparison_when_recursive'

57) Error:
test_comparison_when_recursive(TestStruct):
TypeError: invalid inspect_tbl pair_list for :== in #
C:/work/snapshot-ms64/test/ruby/test_struct.rb:243:in =='
C:/work/snapshot-ms64/test/ruby/test_struct.rb:243:in
block in test_comparison_when_recursive'
C:/work/snapshot-ms64/lib/timeout.rb:65:in timeout'
C:/work/snapshot-ms64/test/ruby/test_struct.rb:242:in
test_comparison_when_recursive'

bignum_objid.patch Magnifier (1.94 KB) Hiroshi Shirosaki, 12/24/2012 01:20 AM

Associated revisions

Revision 38595
Added by Usaku NAKAMURA over 2 years ago

  • bignum.c, include/ruby/intern.h (rb_big_eql): exported.

  • thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
    LLP64. see also r38493 and r38548.
    reported by Heesob Park at [Bug #7607], and patched
    by shirosaki at

Revision 38595
Added by Usaku NAKAMURA over 2 years ago

  • bignum.c, include/ruby/intern.h (rb_big_eql): exported.

  • thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
    LLP64. see also r38493 and r38548.
    reported by Heesob Park at [Bug #7607], and patched
    by shirosaki at

History

#1 Updated by Heesob Park over 2 years ago

Here is patch for this bug:

diff --git a/thread.c b/thread.c.new
index b7ae84c..9ef3d82 100644
--- a/thread.c
+++ b/thread.c.new
@@ -4591,7 +4591,11 @@ recursive_check(VALUE list, VALUE obj_id, VALUE paired_obj_id)
return Qfalse;
if (paired_obj_id) {
if (!RB_TYPE_P(pair_list, T_HASH)) {
+#if SIZEOF_LONG == SIZEOF_VOIDP
if (pair_list != paired_obj_id)
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+ if (!rb_eql(pair_list, paired_obj_id))
+#endif
return Qfalse;
}
else {

#2 Updated by Hiroshi Shirosaki over 2 years ago

  • File bignum_objid.patchMagnifier added
  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA

This seems cause of r38493, not r38548.

I confirmed this issue by the following test on x64 Win7.
I've attached a patch which would be more inexpensive way since avoiding rb_funcall() usage.

require 'test/unit'

class ObjectIdTest < Test::Unit::TestCase

def test_self_referential_hash_equal_for_bignum_object_id
GC.disable
loop do
" " * 1000000
a = { :a => 'b' }
b = a.dup
a['self'] = a
b['self'] = b
p a.object_id.class
assert_equal(a, b)
break if a.object_id.class == Bignum
end
end
end

#3 Updated by Usaku NAKAMURA over 2 years ago

  • Priority changed from Normal to High

I think this is a serious bug, and shirosaki-san's patch seems OK.
I want to backport this to 1.9.3 before releacing, but now trunk is under code freeze, I know.

But... I don't have time to wait for mame-san's reaction.
So, on my responsibility, please commit this patch to trunk, shirosaki-san.
mame-san, if you feel this is wrong decision, please reproach me.

#4 Updated by Usaku NAKAMURA over 2 years ago

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

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


  • bignum.c, include/ruby/intern.h (rb_big_eql): exported.

  • thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
    LLP64. see also r38493 and r38548.
    reported by Heesob Park at [Bug #7607], and patched
    by shirosaki at

#5 Updated by Usaku NAKAMURA over 2 years ago

Hello,

In message " [ruby-trunk - Bug #7607] TypeError: invalid inspect_tbl pair_list on Windows 8"
on Dec.25,2012 10:11:37, usa@garbagecollect.jp wrote:

I want to backport this to 1.9.3 before releacing, but now trunk is under code freeze, I know.

... mame-san said "25 Dec. 2012: code freeze", but I've noticed
that we are still able to commit today!

So, on my responsibility, please commit this patch to trunk, shirosaki-san.

I'll commit in a substitute.

Regards,
--
U.Nakamura usa@garbagecollect.jp

Also available in: Atom PDF