Project

General

Profile

Backport #8380

backport r40208 (refactor overflow check of integer multiplication)

Added by nagachika (Tomoyuki Chikanaga) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:47328]

Description

rubyci.org にて OS X Mountain Lion(m64-o0) の時に TestThread#test_stack_size がタイムアウトするという現象が起きており、
r40600 で待ち時間を 10sec -> 50sec に伸ばしたのですが、それでもタイムアウトしていました。

http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-2.0.0-m64-o0/log/20130507T133423Z.log.html.gz

手元の類似の環境(x86_64-darwin12.3.0)で同じ configure オプションで追試したものの再現には至りませんでした。

rubyci のログを調べてみたところ trunk でも同じようなエラーは起きていて、
http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m64-o0/log/20130409T131941Z.diff.html.gz
で直ったようです(znz さんに調査して頂きました。ありがとうございます)。

この間 r40204 から r40208 で、関係しそうなのは r40208 くらいで、これもどう関係するのかはっきりしませんが、バックポートして様子をみてみたいと思います。

Associated revisions

Revision 555035a3
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 40208: [Backport #8380]

    * internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.
      (MUL_OVERFLOW_FIXNUM_P): Ditto.
      (MUL_OVERFLOW_LONG_P): Ditto.

    * array.c (rb_ary_product): Don't overflow on signed integer
      multiplication.

    * numeric.c (fix_mul): Ditto.
      (int_pow): Ditto.

    * rational.c (f_imul): Ditto.

    * insns.def (opt_mult): Ditto.

    * thread.c (sleep_timeval): Don't overflow on signed integer addition.

    * bignum.c (rb_int2big): Don't overflow on signed integer negation.
      (rb_big2ulong): Ditto.
      (rb_big2long): Ditto.
      (rb_big2ull): Ditto.
      (rb_big2ll): Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40602
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 40208: [Backport #8380]

* internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.
  (MUL_OVERFLOW_FIXNUM_P): Ditto.
  (MUL_OVERFLOW_LONG_P): Ditto.

* array.c (rb_ary_product): Don't overflow on signed integer
  multiplication.

* numeric.c (fix_mul): Ditto.
  (int_pow): Ditto.

* rational.c (f_imul): Ditto.

* insns.def (opt_mult): Ditto.

* thread.c (sleep_timeval): Don't overflow on signed integer addition.

* bignum.c (rb_int2big): Don't overflow on signed integer negation.
  (rb_big2ulong): Ditto.
  (rb_big2long): Ditto.
  (rb_big2ull): Ditto.
  (rb_big2ll): Ditto.

History

#1

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

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

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


merge revision(s) 40208: [Backport #8380]

* internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.
  (MUL_OVERFLOW_FIXNUM_P): Ditto.
  (MUL_OVERFLOW_LONG_P): Ditto.

* array.c (rb_ary_product): Don't overflow on signed integer
  multiplication.

* numeric.c (fix_mul): Ditto.
  (int_pow): Ditto.

* rational.c (f_imul): Ditto.

* insns.def (opt_mult): Ditto.

* thread.c (sleep_timeval): Don't overflow on signed integer addition.

* bignum.c (rb_int2big): Don't overflow on signed integer negation.
  (rb_big2ulong): Ditto.
  (rb_big2long): Ditto.
  (rb_big2ull): Ditto.
  (rb_big2ll): Ditto.

Updated by znz (Kazuhiro NISHIYAMA) over 6 years ago

http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-2.0.0-m64-o0/log/20130507T213629Z.diff.html.gz
で TestThread#test_stack_size は直って、別のところで SEGV が起きていて、次の
http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-2.0.0-m64-o0/log/20130508T053526Z.diff.html.gz
も同じ revision で実行されていて、 SEGV もなく success になっているようです。

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

フォローありがとうございます。

理由はよくわかりませんが、タイムアウトはおきなくなったのでこのまま入れておこうと思います。

Also available in: Atom PDF