You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found a deadlock. Here's what happens, as near as I can make out:
D is invoked to change e.g. an instance variable V on owner O. It locks on itself, and starts to make a Shadow of O. It calls getFields() on O's class. This has not yet happened, so the fields are not cached, and the Class delegates to DebugifyingClassLoader, attempting to lock it.
In the meantime, though, another thread is loading classes. DebugifyingClassLoader is locked to load the classes, and tries to call Debugify.debugifyClass(). This attempts to lock D, which results in deadlock.
Here's a trace of the deadlock, slightly anonymized:
I'm using EclipseLink and Jetty and a few other heavy-loading things.
Now, I think I've maybe fixed the problem - it locked consistently before, and no longer locks. However, it's pretty ugly, I'm not sure it's covering all cases, it could theoretically cause some other kind of problem, and I may have applied it in more places than is necessary. Basically, I've swapped out most of D's synchronization with first synchronizing on the DebugifyingClassLoader, and THEN on D. This ensures same-order locking (in the case I saw), preventing deadlock. Still, note the caveats.
I'm making a pull request with this and a few other fixes; please look it over and see if it's acceptable.
The text was updated successfully, but these errors were encountered:
Found a deadlock. Here's what happens, as near as I can make out:
D is invoked to change e.g. an instance variable V on owner O. It locks on itself, and starts to make a Shadow of O. It calls getFields() on O's class. This has not yet happened, so the fields are not cached, and the Class delegates to DebugifyingClassLoader, attempting to lock it.
In the meantime, though, another thread is loading classes. DebugifyingClassLoader is locked to load the classes, and tries to call Debugify.debugifyClass(). This attempts to lock D, which results in deadlock.
Here's a trace of the deadlock, slightly anonymized:
I'm using EclipseLink and Jetty and a few other heavy-loading things.
Now, I think I've maybe fixed the problem - it locked consistently before, and no longer locks. However, it's pretty ugly, I'm not sure it's covering all cases, it could theoretically cause some other kind of problem, and I may have applied it in more places than is necessary. Basically, I've swapped out most of D's synchronization with first synchronizing on the DebugifyingClassLoader, and THEN on D. This ensures same-order locking (in the case I saw), preventing deadlock. Still, note the caveats.
I'm making a pull request with this and a few other fixes; please look it over and see if it's acceptable.
The text was updated successfully, but these errors were encountered: