[build2] Test using c assert reports stack buffer overrun when failing (MSVC?)

Klaim - Joël Lamotte mjklaim at gmail.com
Tue Aug 14 16:09:52 UTC 2018


On Tue, 14 Aug 2018 at 17:38, Boris Kolpackov <boris at codesynthesis.com> wrote:
>
> Yes, there is something strange going on and there is even a note in
> the code that deals with this:
>
> https://github.com/build2/libbutl/blob/master/libbutl/process.cxx#L1779
>
> We haven't had chance to research this further. So if you have any
> suggestions how to handle this better, I would be happy to apply the
> fix.

Weird indeed.

When I try with this code in an empty project created with VS2017:

#include <cstdlib>
int main() { std::abort(); }

When running it in Debug mode I get a dialog box asking what to do
(because I run with the debugger)
and if I ignore the SIGABORT I correctly get a status 3 for the program.
This is the normal behaviour, with the normal error code.
I didn't manage to easily get the return in case of Release mode, I'll
try to launch
it from another program.

Anyway ok I'll note to take a closer look soon.

Joël



More information about the users mailing list