On Sat, May 14, 2011 at 13:25, Tobias Burnus <bur...@net-b.de> wrote:
> Janne Blomqvist wrote: PR libfortran/48915
>>
>>        * lang.opt: Remove -fdump-core.
>
> Shouldn't one set this one to "Ignore" instead of removing it?

It suppose one could argue this makes sense, in order to not break
existing makefiles.

> In particular
> as in a way the default option is kind of "-fdump-core"?

Well, I don't know about that. I think -fdump-core was just broken. E.g.

- When enabled, generate a core dump [1] when the library detects any
error such as file not found or EOF and decides to exit with a
non-zero exit status.

- When not enabled, and -fbacktrace not enabled, still generates a
core dump if a fatal signal occurs because that's the default behavior
in POSIX and there's nothing to prevent it [1].

[1] Well, depending on the user configured core file size limit, obviously.

So what the current behavior is, beyond removing the -fdump-core
option, is that it makes gfortran behave more like a good POSIX
citizen, i.e. for most errors we just exit() normally with a non-zero
exit status (no core dump or backtrace attempted). Backtracing and
abort() is reserved for a few situations where we notice something
went very bad.

>>        * runtime/stop.c (stop_numeric): Call exit().
>>        (error_stop_string): Call sys_abort().
>>        (error_stop_numeric): Print backtrace, exit with provided code.
>
> I disagree with the ERROR STOP change.

My thinking is that the spirit of ERROR STOP is that the program
noticed something went seriously wrong (e.g. program state corrupted
in some way), and  hence a backtrace and/or core dump might help
figure out what went wrong. For less serious errors, there's the plain
STOP. Similar to how in C there's exit() and abort().

> Other than that: Nice clean up. One probably should now also implement
> backtracing support for Windows, which is not difficult (cf. attachment in
> the MinGW backtrace PR).

There's also a few problems with the async-signal-safety of the
current backtrace implementation, see PR 48931.



-- 
Janne Blomqvist

Reply via email to