Project

General

Profile

Actions

Bug #7607

closed

TypeError: invalid inspect_tbl pair_list on Windows 8

Added by phasis68 (Heesob Park) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-12-23 trunk 38564) [x64-mswin64_110]
Backport:
[ruby-core:51083]

Description

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

  1. Error:
    test_self_referential(Psych::TestArray):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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 '

  2. Error:
    test_self_referential(Psych::TestHash):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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 '

  3. Error:
    test_self_referential(Psych::TestOmap):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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 `'

  4. Error:
    test_set_self_reference(Psych::TestSet):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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>'
  1. Error:
    test_self_referential_struct(Psych::TestStruct):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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 `'

  2. Failure:
    test_class_nonascii(TestMarshal) [C:/work/snapshot-ms64/test/ruby/test_marshal.rb:302]:
    [ruby-core:24882].
    Exception raised:
    <#<TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>>>.

  3. Error:
    test_comparison_when_recursive(TestRange):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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'

  4. Error:
    test_comparison_when_recursive(TestStruct):
    TypeError: invalid inspect_tbl pair_list for :== in #<Thread:0x000045a4649558 run>
    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'


Files

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

Updated by phasis68 (Heesob Park) over 11 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 {

Updated by h.shirosaki (Hiroshi Shirosaki) over 11 years ago

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

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Priority changed from Normal to 5

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.

Actions #4

Updated by usa (Usaku NAKAMURA) over 11 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 [ruby-core:51083] [Bug #7607], and patched
    by shirosaki at [ruby-core:51095]

Updated by usa (Usaku NAKAMURA) over 11 years ago

Hello,

In message "[ruby-core:51120] [ruby-trunk - Bug #7607] TypeError: invalid inspect_tbl pair_list on Windows 8"
on Dec.25,2012 10:11:37, 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0