NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misc/56820: Many FPE related tests fail on softfloat machines



The following reply was made to PR misc/56820; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: misc/56820: Many FPE related tests fail on softfloat machines
Date: Thu, 12 Oct 2023 07:19:58 +0200

 On Wed, Oct 11, 2023 at 08:30:03PM +0000, Valery Ushakov wrote:
 >  Oh, I replied to the last comment, didn't look at the context.  The
 >  SA_RESETHAND patch doesn't look correct to me.  It says "if the signal
 >  is handled by the program, let the handler run, but then reset its
 >  disposition", which is not what the program requested if it didn't
 >  specify SA_RESETHAND, like e.g. the t_fpsetmask test.
 
 Yes, it is wrong but I see no good way to reset the sigaction handler only
 while inside the handler.
 
 I added the SA_RESETHAND because another test requires this:
 
 	/usr/tests/kernel/h_segv fpe handle recurse
 
 installs a signal handler for SIGFPE, triggers one, and inside the signal
 handler triggers another SIGFPE. This second SIGFPE needs to cause a core
 dump.
 
 On machines with FPU you will get:
 
  > /usr/tests/kernel/h_segv fpe handle recurse
 got 8
 Floating exception (core dumped)
 
 but with softfloat and no SA_RESETHAND the second SIGFPE will just recursively
 invoke the handler again (and the helper will print another "got 8").
 
 If we want to solve this purely in userland we would have to add hooks
 to (sig)longjmp and maybe (sig)setjmp, and interpose the signal handler,
 but I'm not sure this would work.
 
 Open for any alternative ideas...
 
 Martin
 


Home | Main Index | Thread Index | Old Index