stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <>
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
     Project: C++ Standard Library
        Type: Bug
  Components: External  
 Environment: Linux/AMD64, EM64T
    Reporter: Martin Sebor


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/ && 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
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
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>

jmp_buf env;

volatile sig_atomic_t traps;

void handler (int signo)
    longjmp (env, 1);

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

int main ()
    signal (SIGFPE, handler);


    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:
For more information on JIRA, see:

View raw message