LP64: date.rb:321:in `convert': integer 86400000000000 too big to convert to `int' (RangeError)

LP64 e$B$J%^%7%s$Ge(B test-all e$B$,F0$+$J$/$J$C$F$$$^$9!#e(B

% ./ruby -v
ruby 1.9.0 (2008-03-21 revision 15824) [x86_64-linux]

% make test-all
./miniruby -I./lib ./runruby.rb --extout=.ext – “./test/runner.rb”
–basedir="./test" --runner=console
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/date.rb:321:in
convert': integer 86400000000000 too big to convert toint’
(RangeError)
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/date.rb:321:in
Rational' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/date.rb:321:inclass:Date
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/date.rb:230:in
<top (required)>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/yaml/rubytypes.rb:2:inrequire’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/yaml/rubytypes.rb:2:in
<top (required)>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/yaml.rb:396:inrequire’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/yaml.rb:396:in
<top (required)>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/rubygems/commands/specification_command.rb:1:inrequire’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/rubygems/commands/specification_command.rb:1:in
<top (required)>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/test/rubygems/test_gem_commands_specification_command.rb:3:inrequire’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/test/rubygems/test_gem_commands_specification_command.rb:3:in
<top (required)>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:91:inrequire’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:91:in
collect_file' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:74:inblock in recursive_collect’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:58:in
each' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:58:inrecursive_collect’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:63:in
block in recursive_collect' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:58:ineach’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:58:in
recursive_collect' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/collector/dir.rb:29:incollect’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/autorunner.rb:68:in
block (1 levels) in <class:AutoRunner>' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/autorunner.rb:213:in[]’
from
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/autorunner.rb:213:in
run' from /home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/ruby/lib/test/unit/autorunner.rb:12:inrun’
from ./test/runner.rb:9:in `’
make: *** [test-all] Error 1

e$B$^$?!"e(Btest_rational.rb e$B$Ge(B SEGV e$B$7$^$9!#e(B

% ./ruby test/ruby/test_rational.rb
Loaded suite test/ruby/test_rational
Started
…Etest/ruby/test_rational.rb:335: [BUG] Segmentation fault
ruby 1.9.0 (2008-03-21 revision 15824) [x86_64-linux]

– control frame ----------
c:0020 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC :confused:
c:0019 p:0082 s:0068 b:0066 l:000065 d:000065 METHOD
test/ruby/test_rational.rb:335
c:0018 p:0039 s:0061 b:0061 l:000060 d:000060 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testcase.rb:76
c:0017 p:0015 s:0056 b:0056 l:000050 d:000055 BLOCK
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:34
c:0016 p:---- s:0056 b:0056 l:000055 d:000055 FINISH :inherited
c:0015 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC :each
c:0014 p:0026 s:0051 b:0051 l:000050 d:000050 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33
c:0013 p:0015 s:0046 b:0046 l:000040 d:000045 BLOCK
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:34
c:0012 p:---- s:0046 b:0046 l:000045 d:000045 FINISH :(null)
c:0011 p:---- s:0044 b:0044 l:000043 d:000043 CFUNC :each
c:0010 p:0026 s:0041 b:0041 l:000040 d:000040 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33
c:0009 p:0128 s:0036 b:0036 l:0020c8 d:0020c8 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/testrunnermediator.rb:46
c:0008 p:0008 s:0027 b:0027 l:000026 d:000026 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/console/testrunner.rb:67
c:0007 p:0023 s:0024 b:0024 l:000023 d:000023 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/console/testrunner.rb:41
c:0006 p:0026 s:0021 b:0021 l:000020 d:000020 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/testrunnerutilities.rb:29
c:0005 p:0052 s:0016 b:0016 l:000015 d:000015 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/autorunner.rb:216
c:0004 p:0070 s:0012 b:0012 l:000011 d:000011 METHOD
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/autorunner.rb:12
c:0003 p:0042 s:0004 b:0003 l:000f08 d:000002 BLOCK
/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit.rb:278
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
:private_class_method
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP

DBG> : “test/ruby/test_rational.rb:335:in test_div'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testcase.rb:76:inrun’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:34:in
block in run'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33:ineach’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33:in
run'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:34:inblock in run’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33:in
each'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/testsuite.rb:33:inrun’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/testrunnermediator.rb:46:in
run_suite'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/console/testrunner.rb:67:instart_mediator’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/console/testrunner.rb:41:in
start'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/ui/testrunnerutilities.rb:29:inrun’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/autorunner.rb:216:in
run'" DBG> : "/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit/autorunner.rb:12:inrun’”
DBG> :
“/home/akr/chkbuild/tmp/build/ruby-trunk/20080322T004154/lib/ruby/1.9.0/test/unit.rb:278:in
`block in <top (required)>’”
– backtrace of native function call (Use addr2line) –
0x4b308f
0x4d8bae
0x4d8cf1
0x4824c3
0x2b7e23c78410
0x417d0b
0x4b19d9
0x4ad54d
0x4b0bc1
0x4b1128
0x4170f7
0x4bd220
0x4b19d9
0x4ad941
0x4b0bc1
0x4b1128
0x4170f7
0x4bd220
0x4b19d9
0x4ad941
0x4b0bc1
0x4b1128
0x4b1562
0x41a2bf
0x41a3d9
0x41ac16
0x41ae02
0x41459f
0x2b7e242614ca
0x4144aa

In article [email protected],
Tadayoshi F. [email protected] writes:

e$BJL$NM}M3$G!“e(Btest-all e$B$,<j85$G$G$-$J$$$G$9$,!”$3$s$J46$8$G$I$&$G$7$g$&!#e(B

e$B>I>u$,$*$5$^$j$^$9!#e(B

LP64 e$B$J%^%7%s$Ge(B test-all e$B$,F0$+$J$/$J$C$F$$$^$9!#e(B

e$BJL$NM}M3$G!“e(Btest-all
e$B$,<j85$G$G$-$J$$$G$9$,!”$3$s$J46$8$G$I$&$G$7$g$&!#e(B

Index: complex.c

— complex.c (revision 15817)
+++ complex.c (working copy)
@@ -70,12 +70,12 @@
{
VALUE _r;
if (FIXNUM_P(y)) {

  • if (FIX2INT(y) == 0)
    
  • if (FIX2LONG(y) == 0)
      _r = x;
    else
      _r = rb_funcall(x, '+', 1, y);
    
    } else if (FIXNUM_P(x)) {
  • if (FIX2INT(x) == 0)
    
  • if (FIX2LONG(x) == 0)
      _r = y;
    else
      _r = rb_funcall(x, '+', 1, y);
    

@@ -85,10 +85,10 @@
}

inline static VALUE
-f_div(x, y)
+f_div(VALUE x, VALUE y)
{
VALUE _r;

  • if (FIXNUM_P(y) && FIX2INT(y) == 1)
  • if (FIXNUM_P(y) && FIX2LONG(y) == 1)
    _r = x;
    else
    _r = rb_funcall(x, ‘/’, 1, y);
    @@ -100,7 +100,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x) && FIXNUM_P(y))
  • _r = f_boolcast(FIX2INT(x) > FIX2INT(y));
  • _r = f_boolcast(FIX2LONG(x) > FIX2LONG(y));
    else
    _r = rb_funcall(x, ‘>’, 1, y);
    return _r;
    @@ -111,7 +111,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x) && FIXNUM_P(y))
  • _r = f_boolcast(FIX2INT(x) < FIX2INT(y));
  • _r = f_boolcast(FIX2LONG(x) < FIX2LONG(y));
    else
    _r = rb_funcall(x, ‘<’, 1, y);
    return _r;
    @@ -124,7 +124,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(y)) {
  • int _iy = FIX2INT(y);
    
  • long _iy = FIX2LONG(y);
    if (_iy == 0) {
      if (TYPE(x) == T_FLOAT)
    
    _r = rb_float_new(0.0);
    @@ -135,7 +135,7 @@
    else
    _r = rb_funcall(x, ‘*’, 1, y);
    } else if (FIXNUM_P(x)) {
  • int _ix = FIX2INT(x);
    
  • long _ix = FIX2LONG(x);
    if (_ix == 0) {
      if (TYPE(y) == T_FLOAT)
    
    _r = rb_float_new(0.0);
    @@ -155,7 +155,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(y)) {
  • if (FIX2INT(y) == 0)
    
  • if (FIX2LONG(y) == 0)
      _r = x;
    else
      _r = rb_funcall(x, '-', 1, y);
    

@@ -189,7 +189,7 @@
{
VALUE _r;
if (FIXNUM_P(x) && FIXNUM_P(y)) {

  • int c = FIX2INT(x) - FIX2INT(y);
    
  • long c = FIX2LONG(x) - FIX2LONG(y);
    if (c > 0)
      c = 1;
    else if (c < 0)
    

@@ -208,7 +208,7 @@
{
VALUE _r;
if (FIXNUM_P(x) && FIXNUM_P(y))

  • _r = f_boolcast(FIX2INT(x) == FIX2INT(y));
    
  • _r = f_boolcast(FIX2LONG(x) == FIX2LONG(y));
    
    else
    _r = rb_funcall(x, id_equal_p, 1, y);
    return _r;
    @@ -223,7 +223,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) < 0);
  • _r = f_boolcast(FIX2LONG(x) < 0);
    else
    _r = rb_funcall(x, ‘<’, 1, ZERO);
    return _r;
    @@ -234,7 +234,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) == 0);
    
  • _r = f_boolcast(FIX2LONG(x) == 0);
    
    else
    _r = rb_funcall(x, id_equal_p, 1, ZERO);
    return _r;
    @@ -245,7 +245,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) == 1);
    
  • _r = f_boolcast(FIX2LONG(x) == 1);
    
    else
    _r = rb_funcall(x, id_equal_p, 1, ONE);
    return _r;
    Index: rational.c
    ===================================================================
    — rational.c (revision 15818)
    +++ rational.c (working copy)
    @@ -53,12 +53,12 @@
    {
    VALUE _r;
    if (FIXNUM_P(y)) {
  • if (FIX2INT(y) == 0)
    
  • if (FIX2LONG(y) == 0)
      _r = x;
    else
      _r = rb_funcall(x, '+', 1, y);
    
    } else if (FIXNUM_P(x)) {
  • if (FIX2INT(x) == 0)
    
  • if (FIX2LONG(x) == 0)
      _r = y;
    else
      _r = rb_funcall(x, '+', 1, y);
    

@@ -68,10 +68,10 @@
}

inline static VALUE
-f_div(x, y)
+f_div(VALUE x, VALUE y)
{
VALUE _r;

  • if (FIXNUM_P(y) && FIX2INT(y) == 1)
  • if (FIXNUM_P(y) && FIX2LONG(y) == 1)
    _r = x;
    else
    _r = rb_funcall(x, ‘/’, 1, y);
    @@ -83,7 +83,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x) && FIXNUM_P(y))
  • _r = f_boolcast(FIX2INT(x) > FIX2INT(y));
  • _r = f_boolcast(FIX2LONG(x) > FIX2LONG(y));
    else
    _r = rb_funcall(x, ‘>’, 1, y);
    return _r;
    @@ -94,7 +94,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x) && FIXNUM_P(y))
  • _r = f_boolcast(FIX2INT(x) < FIX2INT(y));
  • _r = f_boolcast(FIX2LONG(x) < FIX2LONG(y));
    else
    _r = rb_funcall(x, ‘<’, 1, y);
    return _r;
    @@ -107,7 +107,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(y)) {
  • int _iy = FIX2INT(y);
    
  • long _iy = FIX2LONG(y);
    if (_iy == 0) {
      if (TYPE(x) == T_FLOAT)
    
    _r = rb_float_new(0.0);
    @@ -118,7 +118,7 @@
    else
    _r = rb_funcall(x, ‘*’, 1, y);
    } else if (FIXNUM_P(x)) {
  • int _ix = FIX2INT(x);
    
  • long _ix = FIX2LONG(x);
    if (_ix == 0) {
      if (TYPE(y) == T_FLOAT)
    
    _r = rb_float_new(0.0);
    @@ -138,7 +138,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(y)) {
  • if (FIX2INT(y) == 0)
    
  • if (FIX2LONG(y) == 0)
      _r = x;
    else
      _r = rb_funcall(x, '-', 1, y);
    

@@ -162,7 +162,7 @@
{
VALUE _r;
if (FIXNUM_P(x) && FIXNUM_P(y)) {

  • int c = FIX2INT(x) - FIX2INT(y);
    
  • long c = FIX2LONG(x) - FIX2LONG(y);
    if (c > 0)
      c = 1;
    else if (c < 0)
    

@@ -180,7 +180,7 @@
{
VALUE _r;
if (FIXNUM_P(x) && FIXNUM_P(y))

  • _r = f_boolcast(FIX2INT(x) == FIX2INT(y));
    
  • _r = f_boolcast(FIX2LONG(x) == FIX2LONG(y));
    
    else
    _r = rb_funcall(x, id_equal_p, 1, y);
    return _r;
    @@ -194,7 +194,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) < 0);
  • _r = f_boolcast(FIX2LONG(x) < 0);
    else
    _r = rb_funcall(x, ‘<’, 1, ZERO);
    return _r;
    @@ -205,7 +205,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) == 0);
    
  • _r = f_boolcast(FIX2LONG(x) == 0);
    
    else
    _r = rb_funcall(x, id_equal_p, 1, ZERO);
    return _r;
    @@ -216,7 +216,7 @@
    {
    VALUE _r;
    if (FIXNUM_P(x))
  • _r = f_boolcast(FIX2INT(x) == 1);
    
  • _r = f_boolcast(FIX2LONG(x) == 1);
    

    else
    _r = rb_funcall(x, id_equal_p, 1, ONE);
    return _r;
    @@ -319,7 +319,7 @@

    for (;:wink: {
    if (FIXNUM_P(x)) {

  •  if (FIX2INT(x) == 0)
    
  •  if (FIX2LONG(x) == 0)
    
    return y;
    if (FIXNUM_P(y))
    return LONG2NUM(i_gcd(FIX2LONG(x), FIX2LONG(y)));
    @@ -897,7 +897,7 @@
    {
    get_dat1(self);
  •  if (FIXNUM_P(dat->den) && FIX2INT(dat->den) == 1)
    
  •  if (FIXNUM_P(dat->den) && FIX2LONG(dat->den) == 1)
    

    return f_cmp(dat->num, other);
    else
    return f_cmp(self, f_rational_new_bang1(CLASS_OF(self), other));
    @@ -912,8 +912,8 @@

     if (FIXNUM_P(adat->num) && FIXNUM_P(adat->den) &&
    

    FIXNUM_P(bdat->num) && FIXNUM_P(bdat->den)) {

  • num1 = f_imul(FIX2INT(adat->num), FIX2INT(bdat->den));
  • num2 = f_imul(FIX2INT(bdat->num), FIX2INT(adat->den));
  • num1 = f_imul(FIX2LONG(adat->num), FIX2LONG(bdat->den));

  • num2 = f_imul(FIX2LONG(bdat->num), FIX2LONG(adat->den));
    } else {
    num1 = f_mul(adat->num, bdat->den);
    num2 = f_mul(bdat->num, adat->den);
    @@ -939,7 +939,7 @@

    if (!FIXNUM_P(dat->den))
    

    return Qfalse;

  •  if (FIX2INT(dat->den) != 1)
    
  •  if (FIX2LONG(dat->den) != 1)
    
    return Qfalse;
    if (f_equal_p(dat->num, other))
    return Qtrue;

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs