dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

dfhack may attempt to write to console after it has been closed, during shutdown

Open ab9rf opened this issue 1 year ago • 0 comments

While running DF+DFHack under AppVerifier to look for heap management issues, I got an "invalid handle was specified" exception while the app was shutting down, suggesting that the DFHack console attempted to write to the console handle after the console handle had been closed (possibly by a different thread):

Unhandled exception at 0x00007FFF76D90F3A (ntdll.dll) in Dwarf Fortress.exe: 0xC0000008: An invalid handle was specified.

This may be a race condition; AppVerifier imposes massive loads on the application being tested and so this might be an exception that only arises when AppVerifier is being used, but it's still worth mitigating.

ab9rf avatar Apr 03 '24 23:04 ab9rf