Skip to content
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

ConcurrentModificationException from ThreadGroup.list #2446

Closed
kares opened this issue Jan 9, 2015 · 0 comments · Fixed by #2451
Closed

ConcurrentModificationException from ThreadGroup.list #2446

kares opened this issue Jan 9, 2015 · 0 comments · Fixed by #2451

Comments

@kares
Copy link
Member

kares commented Jan 9, 2015

while the rubyThreadList field is a fully synchronized collection, iterator might still throw a CME

https://github.com/jruby/jruby/blob/jruby-1_7/core/src/main/java/org/jruby/RubyThreadGroup.java#L149

there's probably a typo the line above as it synchronizes on a local variable :

 RubyArray ary = RubyArray.newArray(getRuntime());
  synchronized (ary) {
WeakHashMap.java:882:in `nextEntry': java.util.ConcurrentModificationException
    from WeakHashMap.java:915:in `next'
    from RubyThreadGroup.java:149:in `list'
    from RubyThreadGroup$INVOKER$i$0$0$list.gen:-1:in `call'
    from JavaMethod.java:280:in `call'
    from CachingCallSite.java:306:in `cacheAndCall'
    from CachingCallSite.java:136:in `call'
    from CallNoArgNode.java:60:in `interpret'
    from CallNoArgBlockPassNode.java:53:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:112:in `INTERPRET_BLOCK'
    from Interpreted19Block.java:206:in `evalBlockBody'
    from Interpreted19Block.java:157:in `yield'
    from Block.java:142:in `yield'
    from Mutex.java:149:in `synchronize'
    from Mutex$INVOKER$i$0$0$synchronize.gen:-1:in `call'

only seen this under high actor/fiber usage (Celluloid) ... reproduced on 1.7.16

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

Successfully merging a pull request may close this issue.

2 participants