Instrumentation API Basics, Debugger, and Threading

Stefan Marr java at stefan-marr.de
Mon Jun 19 16:08:07 UTC 2017


Hi:

I am having issues tracking down, what I think is a race condition in the instrumentation code for the debugger.

From time to time, I see the following assertion failing [1] (the second one):

  assert source.getSteppingLocation() == SteppingLocation.AFTER_CALL;
  // there is only one binding that can lead to a after event
  if (stepping.get()) {
    assert source.getContext().lookupExecutionEventNode(callBinding) == source;  <--  This one fails

So, now I am wondering whether my assumption about how things work are correct.

Are any of the nodes involved here created on-demand?
Could it be that `source` is somehow already outdated at this line?

I have a program that runs two threads and sets breakpoints and does stepping on the same user code.
However, sometimes, the first thread doesn’t stop where it should, and continues instead.
And the above assertion is failing during debugging.
The two might be related, but I can’t tell for sure.

I guess, what I am asking for is a basic description of the general assumptions made in this code in the DebuggerSession.

Thanks
Stefan

[1] https://github.com/graalvm/graal/blob/master/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/DebuggerSession.java#L682


-- 
Stefan Marr
Johannes Kepler Universität Linz
http://stefan-marr.de/research/





More information about the graal-dev mailing list