Project

General

Profile

Bug #12517

def_delegators broken on ruby-head?

Added by ioquatix (Samuel Williams) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:76141]

Description

I found the following issue:

https://travis-ci.org/ioquatix/build-files/jobs/140181966

/home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:200:in `compile': negative array size (or size too big) (ArgumentError)
    from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:200:in `_delegator_method'
    from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:178:in `def_instance_delegator'
    from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:154:in `block in def_instance_delegators'
    from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:153:in `each'
    from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:153:in `def_instance_delegators'
    from /home/travis/build/ioquatix/build-files/lib/build/files/state.rb:71:in `<class:State>'

This is caused by the following line:

        class State < Files::List
            extend Forwardable
            def_delegators :@files, :each, :roots, :count

It was fine in 2.3.0 and before.

Associated revisions

Revision f5404751
Added by nobu (Nobuyoshi Nakada) over 2 years ago

Coverage on non-positive lines

  • compile.c (ADD_TRACE): ignore trace instruction on non-positive line.
  • parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517]

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

Revision 55509
Added by nobu (Nobuyoshi Nakada) over 2 years ago

Coverage on non-positive lines

  • compile.c (ADD_TRACE): ignore trace instruction on non-positive line.
  • parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517]

Revision 55509
Added by nobu (Nobuyoshi Nakada) over 2 years ago

Coverage on non-positive lines

  • compile.c (ADD_TRACE): ignore trace instruction on non-positive line.
  • parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517]

Revision 55509
Added by nobu (Nobuyoshi Nakada) over 2 years ago

Coverage on non-positive lines

  • compile.c (ADD_TRACE): ignore trace instruction on non-positive line.
  • parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517]

Revision bb6e171a
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 53424,55509: [Backport #12517]

* test/coverage/test_coverage.rb: ignored test when enabled to coverage.
  It lead to crash with `make test-all`.

* compile.c (ADD_TRACE): ignore trace instruction on non-positive
  line.

* parse.y (coverage): get rid of ArgumentError when the starting
  line number is not positive.  [ruby-core:76141] [Bug #12517]

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

Revision 55917
Added by nagachika (Tomoyuki Chikanaga) over 2 years ago

merge revision(s) 53424,55509: [Backport #12517]

* test/coverage/test_coverage.rb: ignored test when enabled to coverage.
  It lead to crash with `make test-all`.

* compile.c (ADD_TRACE): ignore trace instruction on non-positive
  line.

* parse.y (coverage): get rid of ArgumentError when the starting
  line number is not positive.  [ruby-core:76141] [Bug #12517]

Revision 81d5b699
Added by usa (Usaku NAKAMURA) over 2 years ago

merge revision(s) 53424,55509: [Backport #12517]

* test/coverage/test_coverage.rb: ignored test when enabled to coverage.
  It lead to crash with `make test-all`.

* compile.c (ADD_TRACE): ignore trace instruction on non-positive
  line.

* parse.y (coverage): get rid of ArgumentError when the starting
  line number is not positive.  [ruby-core:76141] [Bug #12517]

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

Revision 55943
Added by usa (Usaku NAKAMURA) over 2 years ago

merge revision(s) 53424,55509: [Backport #12517]

* test/coverage/test_coverage.rb: ignored test when enabled to coverage.
  It lead to crash with `make test-all`.

* compile.c (ADD_TRACE): ignore trace instruction on non-positive
  line.

* parse.y (coverage): get rid of ArgumentError when the starting
  line number is not positive.  [ruby-core:76141] [Bug #12517]

History

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED
  • Status changed from Open to Feedback
  • Description updated (diff)

Could you show a small code to reproduce?

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

I couldn't reproduce it with r55504 on OS X 11.11.5 and Ubuntu 16.04.

Updated by akhramov (Artem Khramov) over 2 years ago

Here's the repro (OS X 10.11.5 / FreeBSD 10.2):

require 'coverage'
require 'forwardable'

Coverage.start

class Fail
 extend Forwardable

 def_delegator :foo, :bar
end

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED

Thanks!

#5

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Feedback to Closed

Applied in changeset r55509.


Coverage on non-positive lines

  • compile.c (ADD_TRACE): ignore trace instruction on non-positive line.
  • parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517]

Updated by ioquatix (Samuel Williams) over 2 years ago

Thanks everyone that was so fast I blinked and missed it :D

Updated by nagachika (Tomoyuki Chikanaga) over 2 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE

ruby_2_3 r55917 merged revision(s) 53424,55509.

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE to 2.1: REQUIRED, 2.2: DONE, 2.3: DONE

ruby_2_2 r55943 merged revision(s) 53424,55509.

Also available in: Atom PDF