On 5/26/20 12:17 PM, Ken Moffat wrote:
I'm trying to discover why two tests in the testsuite for 'check'
always fail for me.  I've now got a response that the tests raise
SIGFPE but do not receive it.  The example is

ken@plexi ~/check-debug $cat test.c
#include <stdio.h>

#include <signal.h>


int main() {

   printf("Before\n");

   raise(SIGFPE);

   printf("After\n");

   return 0;

}

followed by gcc test.c ; ./a.out

That should terminate on the signal, but for me it doesn't:

ken@plexi ~/check-debug $./a.out
Before
After


However, if I try a division by zero I do get the exception:

ken@plexi ~/check-debug $cat divbyzero.c
#include <stdio.h>

#include <signal.h>


int main() {

  int a = 1000;
  int z = 0;
  int result;

   printf("Before\n");

   //raise(SIGFPE);
   result = a / z;

   printf("After\n");

   return result;

}

gcc -o divbyzero divbyzero.c

ken@plexi ~/check-debug $./divbyzero
Before
Floating point exception


Any clues to how I can find what is causing this breakage, please ?
It seems to happen on all my machines.

I think SIGFPE can be turned on and off by writing a control word to the CPU. Are you using an intel or amd cpu?

  -- Bruce

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to