BNBeginUndoActions
can cause a deadlock
#6289
Labels
Component: DSC
Issue needs changes to the DyldSharedCacheView
File Format: SharedCache
Issue with the dyld_shared_cache plugin
Impact: Critical
Issue blocks CRITICAL functionality
State: Awaiting Triage
Issue is waiting for more in-depth triage from a developer
Type: Crash
Issue is a crash or deadlock
Version and Platform (required):
Bug Description:
BNBeginUndoActions
can cause a deadlock by what appears to be, from the stack trace below, due to waiting on a condition variable:There are other threads stuck in
BNForgetUndoActions
:Another thread (with the name
"Worker T module:core.module.loadDebugInfo module:core.module..."
) is stuck waiting here:2 threads called
"Thread (pooled)"
are stuck here:The deadlocking is permanent, Binary Ninja becomes not responding and its CPU usage drops to basically 0.
There is a chance this is user error but the deadlocking is occurring inside Binary Ninja core so I'm not sure how I could be the cause of it.
Steps To Reproduce:
I'm not sure how to reproduce with a vanilla copy of the specified version of Binary Ninja. I'm using a customised version of the DSC plugin that does allow more parallelization so it could be user error, but ultimately the hanging is due to something going on in Binary Ninja core.
The way I cause this deadlock is by the following steps:
File -> New Window
.The important parts here seem to be that analysis is going on for both at the same time and that both files that are opened are for DYLD Shared Cache.
I know thats not particularly helpful, I'm hoping from the stack traces it might be clear where multiple threads are either contending for the same lock or where a condition variable is not being notified.
Expected Behavior:
To be honest I don't really know.
BeginUndoActions
is a bit of an odd one because my understanding is it doesn't really work in multi-threaded cases due to the way undo actions have been architected. Obviously it shouldn't deadlock but does the use ofBeginUndoActions
in a multi-threaded situation make any sense? Given Binary Ninja is designed to be multi-threaded as much as possible doesBeginUndoActions
make sense in most situations because it won't necessarily batch the expected undo actions? The DSC plugin uses it in a number of places to either forget or batch undo actions, but given its multi-threaded nature would this even work as expected?The text was updated successfully, but these errors were encountered: