MachOPlatform::BootstrapInfo::Mutex was meant to be used to synchronize access to the MachOPlatform::BootstrapInfo::ActiveGraphs member, but the latter was also modified under the MachOPlatform::PlatformMutex (in MachOPlatform::MachOPlatformPlugin::modifyPassConfig), leading to a data race. There have been external reports (rdar://151041549) of deadlocks on the MachOPlatform::BootstrapInfo::CV condition variable that are consistent with corruption of the ActiveGraphs member (though alternative explanations for the reported behavior exist, and it has been too rare in practice to verify). This patch removes the misused MachOPlatform::BootstrapInfo::Mutex member and synchronizes all accesses to ActiveGraphs using MachOPlatform::PlatformMutex instead. Since ActiveGraphs is only used during bootstrap the performance impact of this should be negligible. rdar://151041549 - possible fix.
71 KiB
71 KiB