In the past months every time my editor crashed, it has hanged and I had to kill it from the Task Manager. I finally had time to investigate, and there is a deadlock caused by FRiderOutputDevice.
The events leading to the deadlock (i.e. if debug crash command is run):
RemoveOutputDevice sleeps forever due to OutputDevicesLockCounter == 1 that's locked by GLog->TearDown()
I've solved it by moving GLog->RemoveOutputDevice(this) to the constructor, as that's how FOutputLogHistory : public FOutputDevice handles this case too.
In the past months every time my editor crashed, it has hanged and I had to kill it from the Task Manager. I finally had time to investigate, and there is a deadlock caused by
FRiderOutputDevice
.The events leading to the deadlock (i.e. if
debug crash
command is run):FWindowsPlatformMisc::RequestExitWithStatus
callsGLog->TearDown()
TearDown
locks output devices withLockOutputDevices
, then proceeds toOutputDevice->TearDown()
for all devicesFRiderOutputDevice::TearDown
callsGLog->RemoveOutputDevice(this)
RemoveOutputDevice
sleeps forever due toOutputDevicesLockCounter == 1
that's locked byGLog->TearDown()
I've solved it by moving
GLog->RemoveOutputDevice(this)
to the constructor, as that's howFOutputLogHistory : public FOutputDevice
handles this case too.