Bug #7607

TypeError: invalid inspect_tbl pair_list on Windows 8

Added by Heesob Park over 1 year ago. Updated over 1 year ago.

[ruby-core:51083]
Status:Closed
Priority:High
Assignee:Usaku NAKAMURA
Category:-
Target version:-
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:
testselfreferential(Psych::TestArray):
TypeError: invalid inspecttbl pairlist 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
testselfreferential'
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:
testselfreferential(Psych::TestHash):
TypeError: invalid inspecttbl pairlist 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
testselfreferential'
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:
testselfreferential(Psych::TestOmap):
TypeError: invalid inspecttbl pairlist for :== in #
C:/work/snapshot-ms64/test/psych/testomap.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
runsuites'
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:
testsetselfreference(Psych::TestSet):
TypeError: invalid inspect
tbl pairlist 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
setselfreference'

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:
testselfreferentialstruct(Psych::TestStruct):
TypeError: invalid inspect
tbl pairlist 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 runsuites'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in each'
C:/work/snapshot-ms64/lib/test/unit.rb:649:in
runsuites'
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:
testclassnonascii(TestMarshal) [C:/work/snapshot-ms64/test/ruby/testmarshal.rb:302]:
.
Exception raised:
<#<TypeError: invalid inspect
tbl pair_list for :== in #>>.

53) Error:
testcomparisonwhenrecursive(TestRange):
TypeError: invalid inspect
tbl pairlist 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 testcomparisonwhenrecursive'
C:/work/snapshot-ms64/lib/timeout.rb:65:in timeout'
C:/work/snapshot-ms64/test/ruby/test_range.rb:321:in
test
comparisonwhenrecursive'

57) Error:
testcomparisonwhenrecursive(TestStruct):
TypeError: invalid inspect
tbl pairlist 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 testcomparisonwhenrecursive'
C:/work/snapshot-ms64/lib/timeout.rb:65:in timeout'
C:/work/snapshot-ms64/test/ruby/test_struct.rb:242:in
test
comparisonwhenrecursive'

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

Associated revisions

Revision 38595
Added by Usaku NAKAMURA over 1 year ago

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

  • thread.c (recursivecheck): objectid 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 1 year 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 @@ recursivecheck(VALUE list, VALUE objid, VALUE pairedobjid)
return Qfalse;
if (pairedobjid) {
if (!RBTYPEP(pairlist, THASH)) {
+#if SIZEOFLONG == SIZEOFVOIDP
if (pairlist != pairedobjid)
+#elif SIZEOF
LONGLONG == SIZEOFVOIDP
+ if (!rbeql(pairlist, pairedobjid))
+#endif
return Qfalse;
}
else {

#2 Updated by Hiroshi Shirosaki over 1 year 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 testselfreferentialhashequalforbignumobjectid
GC.disable
loop do
" " * 1000000
a = { :a => 'b' }
b = a.dup
a['self'] = a
b['self'] = b
p a.objectid.class
assert
equal(a, b)
break if a.object_id.class == Bignum
end
end
end

#3 Updated by Usaku NAKAMURA over 1 year 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 1 year 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 (rbbigeql): exported.

  • thread.c (recursivecheck): objectid 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 1 year ago

Hello,

In message " [ruby-trunk - Bug #7607] TypeError: invalid inspecttbl pairlist 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