std::process::abort now implemented throught __fastfail, which dont terminate program on Win7 and earlier.
On Win7 __fastfail throws an exception, and WndProc on Win32 will... suppress it! And panicked program will enter WndProc with brocken state and print error message to console infinite times.
So if you compile program in "panic=abort" mode, you will no abort.
Currently the only way to terminate program with std is use unwinding mode and catch_unwind the panic on the top of WndProc and write exit(3) in panic handler. But unwinding mode is a lot of overhead and boilerplate inside executable.
So on target i686-windows-* panic should be implemented through exit(3)
Do you mean exit(3) as in man 3 exit or as in "call the C library function exit with argument 3"? If the former, what exit code should be used and why? If the latter, why exit code 3 specifically (and not, for instance, 0xC0000409 as is documented for __fastfail?)
As best I can tell from skimming MSDN, the situation you describe can only occur
when __fastfail is used inside a window procedure
and the process is 32-bit but the OS is 64-bit
and the OS is Windows 7 or earlier
This seems like a rare situation, that should not stop std::process::abort from using __fastfail in the general case.
Is there perhaps, instead, something Rust's runtime could do to make old versions of Windows not suppress SEH exceptions thrown out of window procedures by 32-bit processes? Or maybe it doesn't even go in std, but instead, in the hypothetical crate that helps you write Win32 GUI programs without having to use as much unsafe as you did in the test program you showed in the bug you linked to.
But the exact value of exit code does not matter for me. Any value (except 0) is good, if program will terminate.
Yes, it is. This situation is not rare. I compile programs in x32 mode, because some users has old computers, and I want to make the target audience wider. Also if I publish x32 and x64 versions, some users will run x32 version on x64 system, and there is no way to prevent it.
I think, first variant (when intrinsic used inside abort's implementation) will be better, because this intrinsic should be very platform-specific. It would be better to allow user to use the minimal possible count of platform-specific intrinsics.