public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48915] New: Incorrect process return code with -fdump-core
@ 2011-05-06 11:54 jb at gcc dot gnu.org
  2011-05-06 11:34 ` [Bug libfortran/48915] " jb at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jb at gcc dot gnu.org @ 2011-05-06 11:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48915

           Summary: Incorrect process return code with -fdump-core
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jb@gcc.gnu.org


Consider the program

program errcode
  stop 10
end program errcode

$ gfortran errcode.f90
$ ./a.out 
STOP 10
$ echo $?
10
$ gfortran -fdump-core errcode.f90 
$ ./a.out 
STOP 10
Quit (core dumped)
$ echo $?
131

Looking at runtime/error.c (sys_exit) the reason is quite obvious; with 

kill(getpid(), SIGQUIT);

the process kills itself (return code is 128 + signal number = 131 in this
case) and never gets a chance to execute exit() with the provided exit code!


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-15 10:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 11:54 [Bug libfortran/48915] New: Incorrect process return code with -fdump-core jb at gcc dot gnu.org
2011-05-06 11:34 ` [Bug libfortran/48915] " jb at gcc dot gnu.org
2011-05-06 11:51 ` jb at gcc dot gnu.org
2011-05-14  9:30 ` jb at gcc dot gnu.org
2011-05-14  9:52 ` jb at gcc dot gnu.org
2011-05-14 10:36 ` jb at gcc dot gnu.org
2011-05-14 10:43 ` jb at gcc dot gnu.org
2011-05-15 11:14 ` jb at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).