Project

General

Profile

Actions

Backport #7454

closed

PPTestModule test failuere on Windows 8

Added by phasis68 (Heesob Park) about 12 years ago. Updated about 12 years ago.

Status:
Closed
[ruby-core:50255]

Description

I found following test failures with VC 2012 64bit compiler on Windows 8.

[ 436/9569] PPTestModule::PPCycleTest#test_anonymous = 0.00 s

  1. Failure:
    test_anonymous(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:151]:
    <"#<#Class:0x00001682e1a2b0:0x00001682e1a260>\n"> expected but was
    <"#<#Class:0x00001682e1a2b0:0x00000082e1a260>\n">.

[ 439/9569] PPTestModule::PPCycleTest#test_object = 0.00 s
2) Failure:
test_object(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:146]:
<"#<Object:0x00001682e0b8f0 @A (A A)=#<Object:0x00001682e0b8f0 ...>>\n"> expected but was
<"#<Object:0x00000082e0b8f0 @A (A A)=#<Object:0x00000082e0b8f0 ...>>\n">.

[ 449/9569] PPTestModule::PPInspectTest#test_to_s_with_iv = 0.00 s
3) Failure:
test_to_s_with_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:109]:
<"#<Object:0x00001682db99b0 @a=nil>\n"> expected but was
<"#<Object:0x00000082db99b0 @a=nil>\n">.

[ 450/9569] PPTestModule::PPInspectTest#test_to_s_without_iv = 0.00 s
4) Failure:
test_to_s_without_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:116]:
<"#Object:0x00001682db8f60\n"> expected but was
<"#Object:0x00000082db8f60\n">.

The above error is related with the address range of Object allocation on Windows 8.
The address is exceeded fixnum(32bit) range.
But object_id is fixnum and pp module is based on object_id.
Thus, pp module cannot restore the original address of the Object.

C:\WINDOWS\system32>irb
irb(main):001:0> a = Object.new
=> #Object:0x00001457366bc0
irb(main):002:0> a.object_id
=> 731592160
irb(main):003:0> require 'pp'
=> true
irb(main):004:0> PP.pp(a,'')
=> "#Object:0x00000057366bc0\n"

Updated by usa (Usaku NAKAMURA) about 12 years ago

  • Category set to test
  • Status changed from Open to Assigned
  • Assignee set to akr (Akira Tanaka)
  • Target version set to 2.0.0

Updated by akr (Akira Tanaka) about 12 years ago

2012/11/28 phasis68 (Heesob Park) :

I found following test failures with VC 2012 64bit compiler on Windows 8.

[ 436/9569] PPTestModule::PPCycleTest#test_anonymous = 0.00 s

  1. Failure:
    test_anonymous(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:151]:
    <"#<#Class:0x00001682e1a2b0:0x00001682e1a260>\n"> expected but was
    <"#<#Class:0x00001682e1a2b0:0x00000082e1a260>\n">.

Although the test failures are fixable in pp.rb,
I think it means more generic problem.

If two objects have addresses where lower 32bits is same but
higher 32bits are different,
object_ids of them will be same in Windows 8 64bit Ruby.

How do you think, usa?

Tanaka Akira

Updated by usa (Usaku NAKAMURA) about 12 years ago

  • Assignee changed from akr (Akira Tanaka) to usa (Usaku NAKAMURA)

Ah, I see, it may be a bug of Object#object_id.
I saw like problem recently...

Actions #4

Updated by usa (Usaku NAKAMURA) about 12 years ago

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

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


  • gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on
    LLP64 platform, such as 64bit Windows.
    reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the
    fix is suggested by akr.
Actions #5

Updated by usa (Usaku NAKAMURA) about 12 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (test)
  • Status changed from Closed to Assigned
  • Target version deleted (2.0.0)

Maybe I've fixed.
Park-san, could you check it?
If it's OK, I'll backport it to 1.9.3.

Updated by phasis68 (Heesob Park) about 12 years ago

This issue is not solved with changeset r38493.

r38493 caused build failure.

C:\work\snapshot-ms64>nmake

Microsoft(R) Program Maintenance Utility 버전 11.00.50727.1
Copyright (c) Microsoft Corporation. All rights reserved.

    CC = cl -nologo
    LD = cl -nologo
    LDSHARED = cl -nologo -LD
    CFLAGS = -MD -Zi -W2 -wd4996 -we4028 -we4142 -O2sy-  -Zm600
    XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/x64-mswin64_110 -I./include -

I. -I./missing
CPPFLAGS =
DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
SOLIBS =
Creating config.h
.ext\include\x64-mswin64_110\ruby\config.h updated.
Creating verconf.h
verconf.h updated.
Creating config.status
compiling main.c
main.c
compiling dmydln.c
dmydln.c
compiling miniruby.rc
compiling dmyencoding.c
dmyencoding.c
compiling version.c
version.c
compiling dmyversion.c
dmyversion.c
compiling miniprelude.c
miniprelude.c
copying dummy probes.h
compiling array.c
array.c
compiling bignum.c
bignum.c
compiling class.c
class.c
compiling compar.c
compar.c
compiling complex.c
complex.c
compiling dir.c
dir.c
compiling dln_find.c
dln_find.c
compiling enum.c
enum.c
compiling enumerator.c
enumerator.c
compiling error.c
error.c
compiling eval.c
eval.c
compiling load.c
load.c
compiling proc.c
proc.c
compiling file.c
file.c
compiling gc.c
gc.c
compiling hash.c
hash.c
compiling inits.c
inits.c
compiling io.c
io.c
compiling marshal.c
marshal.c
compiling math.c
math.c
compiling node.c
node.c
compiling numeric.c
numeric.c
compiling object.c
object.c
compiling pack.c
pack.c
compiling parse.c
parse.c
compiling process.c
process.c
compiling random.c
random.c
compiling range.c
range.c
compiling rational.c
rational.c
compiling re.c
re.c
compiling regcomp.c
regcomp.c
compiling regenc.c
regenc.c
compiling regerror.c
regerror.c
compiling regexec.c
regexec.c
compiling regparse.c
regparse.c
compiling regsyntax.c
regsyntax.c
compiling ruby.c
ruby.c
compiling safe.c
safe.c
compiling signal.c
signal.c
compiling sprintf.c
sprintf.c
compiling st.c
st.c
compiling strftime.c
strftime.c
compiling string.c
string.c
compiling struct.c
struct.c
compiling time.c
time.c
compiling transcode.c
transcode.c
compiling util.c
util.c
compiling variable.c
variable.c
compiling compile.c
compile.c
compiling debug.c
debug.c
compiling iseq.c
iseq.c
compiling vm.c
vm.c
compiling vm_dump.c
vm_dump.c
compiling vm_backtrace.c
vm_backtrace.c
compiling vm_trace.c
vm_trace.c
compiling thread.c
thread.c
compiling cont.c
cont.c
compiling ./enc/ascii.c
ascii.c
compiling ./enc/us_ascii.c
us_ascii.c
compiling ./enc/unicode.c
unicode.c
compiling ./enc/utf_8.c
utf_8.c
compiling newline.c
newline.c
compiling ./missing/acosh.c
acosh.c
compiling ./missing/cbrt.c
cbrt.c
compiling ./missing/crypt.c
crypt.c
compiling ./missing/erf.c
erf.c
compiling ./missing/ffs.c
ffs.c
compiling ./missing/langinfo.c
langinfo.c
compiling ./missing/lgamma_r.c
lgamma_r.c
compiling ./missing/strlcat.c
strlcat.c
compiling ./missing/strlcpy.c
strlcpy.c
compiling ./missing/tgamma.c
tgamma.c
compiling win32/win32.c
win32.c
compiling win32/file.c
file.c
compiling ./missing/setproctitle.c
setproctitle.c
compiling dmyext.c
dmyext.c
oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib imagehlp.lib shlwapi.lib
linking miniruby.exe
ruby 2.0.0dev (2012-12-21 trunk 38512) [x64-mswin64_110]
rbconfig.rb updated
generating enc.mk
compiling dln.c
dln.c
compiling encoding.c
encoding.c
generating prelude.c
compiling prelude.c
prelude.c
linking static-library x64-msvcr110-ruby200-static.lib
generating x64-msvcr110-ruby200.def
linking import-library x64-msvcr110-ruby200.lib
x64-msvcr110-ruby200.lib 라이브러리 및 x64-msvcr110-ruby200.exp 개체를 생성하고 있습니다.
generating encdb.h
C:/work/snapshot-ms64/lib/optparse.rb:584:in hash': bignum too big to convert into long' (RangeError)
from C:/work/snapshot-ms64/lib/optparse.rb:584:in []=' from C:/work/snapshot-ms64/lib/optparse.rb:584:in accept'
from C:/work/snapshot-ms64/lib/optparse.rb:921:in accept' from C:/work/snapshot-ms64/lib/optparse.rb:1619:in class:OptionParser'
from C:/work/snapshot-ms64/lib/optparse.rb:212:in <top (required)>' from ./tool/generic_erb.rb:3:in require'
from ./tool/generic_erb.rb:3:in `'
NMAKE : fatal error U1077: '.\miniruby.exe' : '0x1' 반환 코드입니다.
Stop.

And here is patch for this error.

diff --git a/object.c b/object.c.new
index f0cd1f8..611e959 100644
--- a/object.c
+++ b/object.c.new
@@ -125,7 +125,7 @@ VALUE
rb_obj_hash(VALUE obj)
{
VALUE oid = rb_obj_id(obj);

  • st_index_t h = rb_hash_end(rb_hash_start(NUM2LONG(oid)));
  • st_index_t h = rb_hash_end(rb_hash_start(NUM2LL(oid)));
    return LONG2FIX(h);
    }
Actions #7

Updated by usa (Usaku NAKAMURA) about 12 years ago

  • Status changed from Assigned to Closed

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


merge revision(s) 38493,38539: [Backport #7454]

* gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on
  LLP64 platform, such as 64bit Windows.
  reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the
  fix is suggested by akr.

* object.c (rb_obj_hash): shouldn't assume object_id can be long.
  based on a patch by Heesob Park at [ruby-core:51060].
  cf. [Backport #7454]

Updated by usa (Usaku NAKAMURA) about 12 years ago

Hello,

Thank you very much for helping always!

In message "[ruby-core:51060] [Backport93 - Backport #7454] PPTestModule test failuere on Windows 8"
on Dec.22,2012 00:12:32, wrote:

Issue #7454 has been updated by phasis68 (Heesob Park).

This issue is not solved with changeset r38493.

r38493 caused build failure.

C:\work\snapshot-ms64>nmake

Microsoft(R) Program Maintenance Utility ?? 11.00.50727.1
Copyright (c) Microsoft Corporation. All rights reserved.

    CC = cl -nologo
    LD = cl -nologo
    LDSHARED = cl -nologo -LD
    CFLAGS = -MD -Zi -W2 -wd4996 -we4028 -we4142 -O2sy-  -Zm600
    XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/x64-mswin64_110 -I./include -

I. -I./missing
CPPFLAGS =
DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
SOLIBS =
Creating config.h
.ext\include\x64-mswin64_110\ruby\config.h updated.
Creating verconf.h
verconf.h updated.
Creating config.status
compiling main.c
main.c
compiling dmydln.c
dmydln.c
compiling miniruby.rc
compiling dmyencoding.c
dmyencoding.c
compiling version.c
version.c
compiling dmyversion.c
dmyversion.c
compiling miniprelude.c
miniprelude.c
copying dummy probes.h
compiling array.c
array.c
compiling bignum.c
bignum.c
compiling class.c
class.c
compiling compar.c
compar.c
compiling complex.c
complex.c
compiling dir.c
dir.c
compiling dln_find.c
dln_find.c
compiling enum.c
enum.c
compiling enumerator.c
enumerator.c
compiling error.c
error.c
compiling eval.c
eval.c
compiling load.c
load.c
compiling proc.c
proc.c
compiling file.c
file.c
compiling gc.c
gc.c
compiling hash.c
hash.c
compiling inits.c
inits.c
compiling io.c
io.c
compiling marshal.c
marshal.c
compiling math.c
math.c
compiling node.c
node.c
compiling numeric.c
numeric.c
compiling object.c
object.c
compiling pack.c
pack.c
compiling parse.c
parse.c
compiling process.c
process.c
compiling random.c
random.c
compiling range.c
range.c
compiling rational.c
rational.c
compiling re.c
re.c
compiling regcomp.c
regcomp.c
compiling regenc.c
regenc.c
compiling regerror.c
regerror.c
compiling regexec.c
regexec.c
compiling regparse.c
regparse.c
compiling regsyntax.c
regsyntax.c
compiling ruby.c
ruby.c
compiling safe.c
safe.c
compiling signal.c
signal.c
compiling sprintf.c
sprintf.c
compiling st.c
st.c
compiling strftime.c
strftime.c
compiling string.c
string.c
compiling struct.c
struct.c
compiling time.c
time.c
compiling transcode.c
transcode.c
compiling util.c
util.c
compiling variable.c
variable.c
compiling compile.c
compile.c
compiling debug.c
debug.c
compiling iseq.c
iseq.c
compiling vm.c
vm.c
compiling vm_dump.c
vm_dump.c
compiling vm_backtrace.c
vm_backtrace.c
compiling vm_trace.c
vm_trace.c
compiling thread.c
thread.c
compiling cont.c
cont.c
compiling ./enc/ascii.c
ascii.c
compiling ./enc/us_ascii.c
us_ascii.c
compiling ./enc/unicode.c
unicode.c
compiling ./enc/utf_8.c
utf_8.c
compiling newline.c
newline.c
compiling ./missing/acosh.c
acosh.c
compiling ./missing/cbrt.c
cbrt.c
compiling ./missing/crypt.c
crypt.c
compiling ./missing/erf.c
erf.c
compiling ./missing/ffs.c
ffs.c
compiling ./missing/langinfo.c
langinfo.c
compiling ./missing/lgamma_r.c
lgamma_r.c
compiling ./missing/strlcat.c
strlcat.c
compiling ./missing/strlcpy.c
strlcpy.c
compiling ./missing/tgamma.c
tgamma.c
compiling win32/win32.c
win32.c
compiling win32/file.c
file.c
compiling ./missing/setproctitle.c
setproctitle.c
compiling dmyext.c
dmyext.c
oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib imagehlp.lib shlwapi.lib
linking miniruby.exe
ruby 2.0.0dev (2012-12-21 trunk 38512) [x64-mswin64_110]
rbconfig.rb updated
generating enc.mk
compiling dln.c
dln.c
compiling encoding.c
encoding.c
generating prelude.c
compiling prelude.c
prelude.c
linking static-library x64-msvcr110-ruby200-static.lib
generating x64-msvcr110-ruby200.def
linking import-library x64-msvcr110-ruby200.lib
x64-msvcr110-ruby200.lib ????? ? x64-msvcr110-ruby200.exp ??? ???? ????.
generating encdb.h
C:/work/snapshot-ms64/lib/optparse.rb:584:in hash': bignum too big to convert into long' (RangeError)
from C:/work/snapshot-ms64/lib/optparse.rb:584:in []=' from C:/work/snapshot-ms64/lib/optparse.rb:584:in accept'
from C:/work/snapshot-ms64/lib/optparse.rb:921:in accept' from C:/work/snapshot-ms64/lib/optparse.rb:1619:in class:OptionParser'
from C:/work/snapshot-ms64/lib/optparse.rb:212:in <top (required)>' from ./tool/generic_erb.rb:3:in require'
from ./tool/generic_erb.rb:3:in `'
NMAKE : fatal error U1077: '.\miniruby.exe' : '0x1' ?? ?????.
Stop.

And here is patch for this error.

diff --git a/object.c b/object.c.new
index f0cd1f8..611e959 100644
--- a/object.c
+++ b/object.c.new
@@ -125,7 +125,7 @@ VALUE
rb_obj_hash(VALUE obj)
{
VALUE oid = rb_obj_id(obj);

  • st_index_t h = rb_hash_end(rb_hash_start(NUM2LONG(oid)));
  • st_index_t h = rb_hash_end(rb_hash_start(NUM2LL(oid)));
    return LONG2FIX(h);
    }

Backport #7454: PPTestModule test failuere on Windows 8
https://bugs.ruby-lang.org/issues/7454#change-34986

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: usa (Usaku NAKAMURA)
Category:
Target version:

I found following test failures with VC 2012 64bit compiler on Windows 8.

[ 436/9569] PPTestModule::PPCycleTest#test_anonymous = 0.00 s

  1. Failure:
    test_anonymous(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:151]:
    <"#<#Class:0x00001682e1a2b0:0x00001682e1a260>\n"> expected but was
    <"#<#Class:0x00001682e1a2b0:0x00000082e1a260>\n">.

[ 439/9569] PPTestModule::PPCycleTest#test_object = 0.00 s
2) Failure:
test_object(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:146]:
<"#<Object:0x00001682e0b8f0 @A (A A)=#<Object:0x00001682e0b8f0 ...>>\n"> expected but was
<"#<Object:0x00000082e0b8f0 @A (A A)=#<Object:0x00000082e0b8f0 ...>>\n">.

[ 449/9569] PPTestModule::PPInspectTest#test_to_s_with_iv = 0.00 s
3) Failure:
test_to_s_with_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:109]:
<"#<Object:0x00001682db99b0 @a=nil>\n"> expected but was
<"#<Object:0x00000082db99b0 @a=nil>\n">.

[ 450/9569] PPTestModule::PPInspectTest#test_to_s_without_iv = 0.00 s
4) Failure:
test_to_s_without_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:116]:
<"#Object:0x00001682db8f60\n"> expected but was
<"#Object:0x00000082db8f60\n">.

The above error is related with the address range of Object allocation on Windows 8.
The address is exceeded fixnum(32bit) range.
But object_id is fixnum and pp module is based on object_id.
Thus, pp module cannot restore the original address of the Object.

C:\WINDOWS\system32>irb
irb(main):001:0> a = Object.new
=> #Object:0x00001457366bc0
irb(main):002:0> a.object_id
=> 731592160
irb(main):003:0> require 'pp'
=> true
irb(main):004:0> PP.pp(a,'')
=> "#Object:0x00000057366bc0\n"

--
http://bugs.ruby-lang.org/

Regards,

U.Nakamura

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0