Bug #7607
closedTypeError: invalid inspect_tbl pair_list on Windows 8
Description
The changeset r38548 caused following test failures on x64 Windows 8.
-
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:inassert_cycle' C:/work/snapshot-ms64/test/psych/test_array.rb:50:in
test_self_referential'
C:/work/snapshot-ms64/lib/test/unit.rb:651:inblock 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:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:828:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:inrun' ./test/runner.rb:17:in
' -
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:inassert_cycle' C:/work/snapshot-ms64/test/psych/test_hash.rb:26:in
test_self_referential'
C:/work/snapshot-ms64/lib/test/unit.rb:651:inblock 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:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:828:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:832:inrun' ./test/runner.rb:17:in
' -
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:intest_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:ineach' C:/work/snapshot-ms64/lib/test/unit.rb:649:in
_run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:768:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:832:in
run'
./test/runner.rb:17:in `' -
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:inassert_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>'
-
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:intest_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:ineach' C:/work/snapshot-ms64/lib/test/unit.rb:649:in
_run_suites'
C:/work/snapshot-ms64/lib/test/unit.rb:21:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:768:in
run'
C:/work/snapshot-ms64/lib/test/unit.rb:828:inrun' C:/work/snapshot-ms64/lib/test/unit.rb:832:in
run'
./test/runner.rb:17:in `' -
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>>>. -
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:intimeout' C:/work/snapshot-ms64/test/ruby/test_range.rb:321:in
test_comparison_when_recursive' -
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:intimeout' C:/work/snapshot-ms64/test/ruby/test_struct.rb:242:in
test_comparison_when_recursive'
Files
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
- File bignum_objid.patch bignum_objid.patch added
- Status changed from Open to Assigned
- Assignee set to usa (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
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.
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, 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