[Bug 2100] New: SIGFPE

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Mar 26 12:55:57 UTC 2013


https://www.rtems.org/bugzilla/show_bug.cgi?id=2100

             Bug #: 2100
           Summary: SIGFPE
    Classification: Unclassified
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: sebastian.huber at embedded-brains.de


A GCC test uses the following mechanic:

#include <assert.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>

void sigfpe(int signum)
{
    exit(0);
}

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

#ifdef __rtems__
    sigset_t set;
    sigemptyset(&set);
    sigaddset(&set, SIGFPE);
    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
#endif

    raise(SIGFPE);

    assert(0);
}

The parts in the defined(__rtems__) section are necessary in RTEMS to get a
behaviour similar to Linux.

This is because RTEMS has a special treatment for some signals (in killinfo()):

  /*
   *  P1003.1c/Draft 10, p. 33 says that certain signals should always
   *  be directed to the executing thread such as those caused by hardware
   *  faults.
   */
  if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
      return pthread_kill( pthread_self(), sig );

We should evaluate if this works as intended.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list