incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-148) [Linux/AMD64, EM64T] second SIGFPE not caught by signal hadler
Date Fri, 17 Feb 2006 20:48:41 GMT
[Linux/AMD64, EM64T] second SIGFPE not caught by signal hadler
--------------------------------------------------------------

         Key: STDCXX-148
         URL: http://issues.apache.org/jira/browse/STDCXX-148
     Project: C++ Standard Library
        Type: Bug
  Components: External  
 Environment: Linux/AMD64, EM64T
    Reporter: Martin Sebor


>From http://sources.redhat.com/bugzilla/show_bug.cgi?id=2351

I expect the program below to run succesfully to completion (and exit with a 0
status). On both AMD 64 and Intel EM64T (but not on x86, IA64) the program
abends during the second division, despite the signal handler.

$ /lib64/tls/libc.so.6 && cat ~/tmp/t.c && gcc ~/tmp/t.c && ./a.out

GNU C Library stable release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.4 20050721 (Red Hat 3.4.4-2).
Compiled on a Linux 2.4.20 system on 2005-08-19.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        The C stubs add-on version 2.1.2.
        GNU Libidn by Simon Josefsson
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>

jmp_buf env;

volatile sig_atomic_t traps;

void handler (int signo)
{
    ++traps;
    longjmp (env, 1);
}

volatile int zero;
volatile int one;
volatile int result;

int main ()
{
    signal (SIGFPE, handler);

    ++one;

    if  (0 == setjmp (env)) {
        printf ("first division\n");
        result = one / zero;
    }
    else {
        signal (SIGFPE, handler);
        printf ("second division\n");
        if  (0 == setjmp (env)) {
            result = one / zero;
        }
    }

    printf ("%d traps\n", traps);
}
first division
second division
Floating point exception

-- Summary:
second SIGFPE not caught by signal hadler Product:
glibc Version: 2.3.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: sebor at roguewave dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: x86_64-redhat-linux
GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message