New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Array#concat calls for single-element array throws ConcurrencyError #5141

Closed
MrIssueReporter opened this Issue Apr 15, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@MrIssueReporter

MrIssueReporter commented Apr 15, 2018

Environment

$ jruby -v
jruby 9.1.16.0 (2.3.3) 2018-02-21 8f3f95a Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [linux-x86_64]
$ uname -a
Linux localhost.localdomain 2.6.32-642.6.1.el6.x86_64 #1 SMP Wed Oct 5 00:36:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

  • Initialise an array with a single element, x
  • concat that array to itself twice
  • The array should now contain four elements with value x
irb(main):001:0> a = [1]
=> [1]
irb(main):002:0> a.concat(a)
=> [1, 1]
irb(main):003:0> a.concat(a)
=> [1, 1, 1, 1]
irb(main):004:0> 

Actual Behavior

irb(main):001:0> a = [1]
=> [1]
irb(main):002:0> a.concat(a)
=> [1, 1]
irb(main):003:0> a.concat(a)
ConcurrencyError: Detected invalid array contents due to unsynchronized modifications with concurrent users
	from org/jruby/RubyArray.java:1580:in `concat'
	from (irb):3:in `<eval>'
	from org/jruby/RubyKernel.java:995:in `eval'
	from org/jruby/RubyKernel.java:1316:in `loop'
	from org/jruby/RubyKernel.java:1138:in `catch'
	from org/jruby/RubyKernel.java:1138:in `catch'
	from /home/user/.rbenv/versions/jruby-9.1.16.0/bin/irb:13:in `<main>'
irb(main):004:0> 

@kares kares added this to the JRuby 9.1.17.0 milestone Apr 16, 2018

@kares kares self-assigned this Apr 16, 2018

kares added a commit to kares/jruby that referenced this issue Apr 16, 2018

@kares kares closed this in e7bf9d1 Apr 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment