Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Testscript reports "stack buffer overrun" when an exception is thrown. #51
How To Reproduce
Not a stack buffer overrun report. (the "terminated abnormally" part is correct in this repro case).
The program in your example aborts due to unhanded exception. The testscript implementation obtains the program exit code with GetExitCodeProcess() call that ends up with 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN).
Agree this is weird but not sure what we can do about it.
Interesting... and weird. I'll try to find some other cases where I had to do some child process handling (on Windows) but I don't remember this specific return value for cases of exception escaping main(). I wonder if that behavior is from more recent VS versions.
I just did some research and found this: https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655
While this explains the issue, it is not clear to me if there is a way to distinguish fast failures from real stack buffer overruns once you get that return value. Or does this mean that it is always an exception caught? (that would explain the other stack buffer overrun issues I saw that were fixed in build2, that were indeed due to unhandled exceptions boris told me)
The information is confirmed in the doc for the
I'll investigate more see if there is a way to differentiate the errors.
I checked with boost::process see if they managed to get a clearer error but nope, same return value.
I'm not sure what to do about this, maybe some kind of documentation pointing here or on the links I found would help ...
Or maybe adding a note in the error report that it might not be a buffer overrun (on this specific platform)?
Anyway ok now the whole thing makes sense.