NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-macppc/43619: SA_RESETHAND is broken
>Number: 43619
>Category: port-macppc
>Synopsis: SA_RESETHAND is broken
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-macppc-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 14 21:25:00 +0000 2010
>Originator: Julio Merino
>Release: NetBSD 5.1_RC3
>Organization:
Julio Merino
>Environment:
System: NetBSD mini.julipedia.org 5.1_RC3 NetBSD 5.1_RC3 (MINI) #17: Sat Jul 10
16:01:11 IST 2010
jmmv%mini.julipedia.org@localhost:/home/jmmv/os/netbsd/obj.macppc/usr/src/sys/arch/macppc/compile/MINI
macppc
Architecture: powerpc
Machine: macppc
>Description:
Signals programmed with the SA_RESETHAND flag set cause the program
to either crash or get stuck in an infinite loop when the signal is
received.
This problem causes some programs to misbehave, which is pretty
annoying in a server setting. For example, the monotone server gets
stuck when started from rc.d as part of the system boot process (I
suspect because it receives some signal).
Haven't been able to confirm if this happens in current yet.
>How-To-Repeat:
Run this program and see it crash in macppc (but work fine on
amd64). Replace SA_RESETHAND with 0 and see it work:
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
static bool handler_called = false;
static void
handler(int signo)
{
handler_called = true;
}
int
main(void)
{
struct sigaction sa;
sa.sa_flags = SA_RESETHAND;
sa.sa_handler = &handler;
sigemptyset(&sa.sa_mask);
sigaction(SIGUSR1, &sa, NULL);
kill(0, SIGUSR1);
return handler_called ? EXIT_SUCCESS : EXIT_FAILURE;
}
The backtrace of the crashed program does not shed much light:
(gdb) bt
#0 0xefeedf24 in kill () from /usr/lib/libc.so.12
#1 0x018008a4 in main () at crash.c:24
(gdb)
>Fix:
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index