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

Insufficient synchronization in InstrumentationHandler #154

Closed
entlicher opened this issue Mar 29, 2016 · 1 comment
Closed

Insufficient synchronization in InstrumentationHandler #154

entlicher opened this issue Mar 29, 2016 · 1 comment

Comments

@entlicher
Copy link
Contributor

Introduction of Debugger.pause() (see the pull request #153), revealed insufficient synchronization of code operating on roots map and bindings list.
roots is a synchronized map, but there are several unsynchronized iterations over it's key set. This leads to ConcurrentModificationException.

Bindings can be added asynchronously at any time while a language is executed. This is the case for e.g. debugger breakpoints and debugger pause. That means that bindings list can be changed at any time. This makes the code in AbstractBindingsVisitor problematic, shouldVisit() might not use the same list of elements as visit(Node) and there is a risk of IndexOutOfBoundsException when e.g. breakpoint is removed - one binding is removed.

The similar lack of synchronization may apply to instrumenterMap map.

@mlvdv mlvdv assigned chumer and unassigned mlvdv May 19, 2016
@chumer
Copy link
Member

chumer commented Jul 18, 2016

This is now fixed. The instrumentation API is fully thread-safe including the instrumenterMap.

@chumer chumer closed this as completed Jul 18, 2016
dougxc added a commit that referenced this issue Jul 27, 2016
…s to master

* commit 'a00015392117ccf90b9c1a9d8e9df1210989851d':
  define TRUFFLE_API as a Java module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants