Subject: kern/24983: sigsegv inside sigsegv spins inside the kernel
To: None <>
From: None <>
List: netbsd-bugs
Date: 03/30/2004 20:18:26
>Number:         24983
>Category:       kern
>Synopsis:       sigsegv inside sigsegv spins inside the kernel
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 31 01:19:00 UTC 2004
>Originator:     Perry E. Metzger
>Release:        NetBSD 2.0A
Perry E. Metzger
"Ask not what your country can force other people to do for you..."
System: NetBSD hackworth 2.0A NetBSD 2.0A (HACKWORTH) #0: Mon Mar 29 09:12:40 EST 2004 perry@hackworth:/usr/src/sys/arch/i386/compile/HACKWORTH i386
Architecture: i386
Machine: i386
	Get a sigsegv inside a sigsegv and you spin inside the kernel,
	never returning to userland.

Run this:

#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include <sys/ucontext.h>

sigsegv(int signo, siginfo_t *info, void *ptr)
	*(long *)0 = 0;

	struct sigaction sa;
	sa.sa_flags = SA_SIGINFO;
	sa.sa_sigaction = sigsegv;
	sigaction(SIGSEGV, &sa, NULL);
	*(long *)0 = 0;
	return 0;

	No clue, though I would guess from POSIX that you should
	probably sleep under these circumstances, although it is
	somewhat ambiguous.