Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-03 Thread Adam Dinwoodie
On Sun, Jul 03, 2022 at 12:37:04AM +0200, Csaba Raduly wrote: > On Sat, 2 Jul 2022 at 23:34, Adam Dinwoodie wrote: > > > > That's definitely closer to the behaviour I'd expect! I don't think it > > should be dumping a core, though, at least based on the behaviour I see > > on Debian. > > It

Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Csaba Raduly
On Sat, 2 Jul 2022 at 23:34, Adam Dinwoodie wrote: > > That's definitely closer to the behaviour I'd expect! I don't think it > should be dumping a core, though, at least based on the behaviour I see > on Debian. It should be dumping core, because std:terminate() calls abort(), as Joost has

Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Adam Dinwoodie
On Sat, Jul 02, 2022 at 10:19:44PM +0200, Csaba Raduly wrote: > On Sat, 2 Jul 2022 at 15:22, Adam Dinwoodie wrote: > > > > I'm currently experimenting with compiling rdfind for Cygwin, and one of > > the testcases is failing because std::runtime_error is expected to > > result in the compiled

Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Csaba Raduly
On Sat, 2 Jul 2022 at 15:22, Adam Dinwoodie wrote: > > I'm currently experimenting with compiling rdfind for Cygwin, and one of > the testcases is failing because std::runtime_error is expected to > result in the compiled program exiting with a non-zero return code, > but on Cygwin, it just seems

RE: [EXTERNAL] Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin
Looks like your program does not throw an exception on Cygwin (unlike it does on Debian), so it terminates normally, and the exit code 0 is not unexpected. Debian's version calls abort() and that sends a signal and terminates with a code 128+signal#, and SIGABRT=6, so 134 is the expected

Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Adam Dinwoodie
On Sat, Jul 02, 2022 at 04:14:51PM +0200, Joost Kraaijeveld wrote: > Hi, > > The exception is not handled by the program. In that case "[[noreturn]] > void std::terminate()" is called by the C++-runtime. std::terminate > calls the currently installed std::terminate_handler. The default >

Re: Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Joost Kraaijeveld
Hi, The exception is not handled by the program. In that case "[[noreturn]] void std::terminate()" is called by the C++-runtime. std::terminate calls the currently installed std::terminate_handler. The default std::terminate_handler calls std::abort. After calling std::abort an implementation

Unexpected zero return code from `throw std::runtime_error`

2022-07-02 Thread Adam Dinwoodie
I'm currently experimenting with compiling rdfind for Cygwin, and one of the testcases is failing because std::runtime_error is expected to result in the compiled program exiting with a non-zero return code, but on Cygwin, it just seems to cause the program to terminate with a zero return code.