Fortunately, it was sufficient to reset the FPU settings after initializing the library. But it sure took a long time to figure out what happened!
- The crash was in a FPU that Chrome barely uses
- The instruction that crashed Chrome was thousands of instructions away from the one that triggered the exception
- The instruction that triggered the exception was not at fault
- The crash only happened because of third-party code running inside of Chrome
- The crash was ultimately found to be caused by a code-gen bug in Visual Studio 2015
I've run into this kind of thing once myself (sharing a process with other companies is fun!). It was real confusing to get a stack trace showing our code suddenly crashing on a line of code that was doing the exact same thing with the exact same values as it had always done before.[1]: https://randomascii.wordpress.com/2016/09/16/everything-old-...
Blog post: https://moyix.blogspot.com/2022/09/someones-been-messing-wit... HN discussion: https://news.ycombinator.com/item?id=41212072
The use case they had is saving minidumps when the app crashes. Windows error reporting OS component is flexible enough to support the feature without hacks, they just need to write couple values to registry in the installer of their software. See details on per-application settings in that article: https://learn.microsoft.com/en-us/windows/win32/wer/collecti...
If they want better UX and/or compress & uploads the dump as soon as the app crashes (as opposed to the next launch of the app) – I would solve by making a simple supervisor app which launches the main binary with CreateProcess, waits for it to exit, then looks for the MainApp.exe.{ProcessID}.dmp file created by that WER OS component.
That said, we did have a bunch of hand-rolled state capturing (including Python thread stacks) so maybe WER wouldn't have been as useful anyway.
Writing your own minidump uploader in the unhandled exception filter is/was a very common practice in games, while obviously not ideal.
I think Unreal Engine might still do that. So I think that the claim that Direct3D captures exceptions is suspect.
It may trap them and return EXCEPTION_CONTINUE_SEARCH to pass it on to the next handler, but I have a hard time coming up with a reason why it would trap them in the first place. I have personally never seen Direct3D trap an exception in my long career.
Maybe you were expecting C++ exceptions to be caught, but these APIs are only for SEH.
Now Flash, I have no experience with.
Yes, I know it's a 16year old post. But I must stop myths.
https://code.google.com/archive/p/crashrpt/issues/104
It was introduced in a Windows 7 update and documented in a knowledge base article that has since been removed instead of the regular Win32 docs, so information on it is harder to find these days.
> So I think that the claim that Direct3D captures exceptions is suspect.
I would think that too - but I based my claims on a stack trace captured at the time in the overridden SetUnhandledExceptionFilter. Now, computers were the Wild West then, and who knows where those DLLs actually originated, and any further details are lost to time.
> Maybe you were expecting C++ exceptions to be caught, but these APIs are only for SEH.
The distinction was clear then. And very well-documented by Microsoft. We caught all C++ exceptions before SEH.
> Yes, I know it's a 16year old post. But I must stop myths.
Your goal is laudable but I don’t love comments that discount a concrete history that I lived (and documented!). I call this out mostly because it’s happened before in discussions of old Windows APIs. I wish it were easier to get a snapshot of MSDN circa Windows XP, etc.
This problem is so rampant that even Office hooks SetUnhandledExceptionFilter.
Office is a poor example of 'what to do'. The title bar is a hack. It only supports ~214 character path length even though Win32 API has been lifted to 32k, etc.
I wouldn't characterize Steam's world-writable folder strategy as smart, compared to a more secure model using an elevated downloader and installer.
I fail to see what Office's title bar rendering has to do with its exception handling strategy. As for path length handling, Office also hosts a large in-process plugin ecosystem, so it has to be conservative with such application-level policy changes.
unilynx•8mo ago
TonyTrapp•8mo ago
dwattttt•8mo ago
https://learn.microsoft.com/en-us/windows/win32/api/processt...
p_ing•8mo ago
But that's a rare edge case.
timewizard•8mo ago