NetBSD Problem Report #37437

From arto.huusko@pp2.inet.fi  Mon Nov 26 18:58:08 2007
Return-Path: <arto.huusko@pp2.inet.fi>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id AA82863B888
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 26 Nov 2007 18:58:08 +0000 (UTC)
Message-Id: <20071126185803.955398E1D5@mutteri.local>
Date: Mon, 26 Nov 2007 20:58:02 +0200 (EET)
From: arto.huusko@pp2.inet.fi
Reply-To: arto.huusko@pp2.inet.fi
To: gnats-bugs@NetBSD.org
Subject: signal problems in linux threads
X-Send-Pr-Version: 3.95

>Number:         37437
>Notify-List:    mark@mcs.vuw.ac.nz, erh@netbsd.org
>Category:       kern
>Synopsis:       linux sigaction does not affect all threads
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    chs
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 26 19:00:00 +0000 2007
>Closed-Date:    Wed Oct 20 16:07:53 +0000 2010
>Last-Modified:  Wed Oct 20 16:07:53 +0000 2010
>Originator:     arto.huusko@pp2.inet.fi
>Release:        NetBSD 4.99.34
>Organization:
>Environment:
Architecture: x86_64
Machine: amd64
>Description:
While the process p_sigacts structure is shared between threads (cloned
processes) in emulated Linux process, the p_sigctx structure is not shared.
The sigsets ps_sigcatch and ps_sigignore are still used to determine how
a signal is delivered, and sigaction system call changes those sigsets
in addition p_sigacts.
>How-To-Repeat:
Java 6 crashes very easily even with simple programs. Java 1.5 seems to be
more stable, but I'm sure it too will crash at some point.

The following simple program illustrates the problem. When run on Linux
and NetBSD (as native NetBSD binary), the program prints "SEGV caught",
and exits.

However, when the Linux binary is run on NetBSD, the program core dumps.
Ktrace output shows that the signal is handled with default action instead
of the installed action.

-----BEGIN-----
#include <err.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>

static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

static void *
otherfunc(void *arg)
{
    int *bar = 0;
	int foo;

    pthread_mutex_lock(&mutex); /* Wait for parent to sigaction */
    pthread_mutex_unlock(&mutex);

    foo = *bar;
    printf("%d\n", foo);

    return NULL;
}

static void
sigfunc(int signo, siginfo_t *siginfo, void *context)
{
    printf("SEGV caught, addr %p\n", siginfo->si_addr);
	exit(EXIT_SUCCESS);
}

int
main(int argc, char **argv)
{
    pthread_t other;
    struct sigaction act;

    pthread_mutex_lock(&mutex); /* Block child until sigact done */

    errno = pthread_create(&other, NULL, otherfunc, NULL);
    if (errno)
        err(EXIT_FAILURE, "pthread_create failed");

    memset(&act, 0, sizeof(act));
    act.sa_sigaction = sigfunc;
    act.sa_flags = SA_SIGINFO;
    if (sigaction(SIGSEGV, &act, NULL))
        err(EXIT_FAILURE, "sigaction failed");

    pthread_mutex_unlock(&mutex);

    errno = pthread_join(other, NULL);
    if (errno)
        err(EXIT_FAILURE, "pthread_join failed");

    return EXIT_SUCCESS;
}
-----END-----
>Fix:
The following hack of a patch fixes the problem (only for linux32, similar
patch for linux emulation should be simple enough). I doubt this is suitable
to commit to NetBSD, but it does allow me to use Java 6.

Index: sys/compat/linux32/common/linux32_signal.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux32/common/linux32_signal.c,v
retrieving revision 1.4
diff -u -r1.4 linux32_signal.c
--- sys/compat/linux32/common/linux32_signal.c	18 Mar 2007 21:38:32 -0000	1.4
+++ sys/compat/linux32/common/linux32_signal.c	26 Nov 2007 18:42:18 -0000
@@ -39,6 +39,7 @@

 #include <compat/netbsd32/netbsd32.h>

+#include <compat/linux/common/linux_emuldata.h>
 #include <compat/linux32/common/linux32_types.h>
 #include <compat/linux32/common/linux32_signal.h>
 #include <compat/linux32/linux32_syscallargs.h>
@@ -239,12 +240,40 @@
 		sigemptyset(&os.sa_mask);
 		os.sa_flags = 0;
 	} else {
-		if ((error = sigaction1(l, 
-		    linux32_to_native_signo[sig],	
-		    SCARG_P32(uap, nsa) ? &ns : NULL,
-		    SCARG_P32(uap, osa) ? &os : NULL,
-		    tramp, vers)) != 0)
-			return error;
+		/*
+		 * A very crude hack to set sigctx for all threads.
+		 *
+		 * In addition to being a hack, be also lazy, and just call sigaction
+		 * for all the threads.
+		 *
+		 * XXX: how is linux_emuldata_shared supposed to be protected?
+	 	 * As far as I see, linux32_e_proc_init does not protect the thread
+		 * list at all, which breaks down if two or more threads fork off a
+		 * new thread at the same time. This breaks also if threads come or
+	 	 * go while running this.
+		 */
+		if (SCARG_P32(uap, nsa) != NULL) {
+			struct proc *p = l->l_proc;
+			struct linux_emuldata *e = p->p_emuldata;
+			struct linux_emuldata *eo;
+
+			LIST_FOREACH(eo, &e->s->threads, threads) {
+				struct lwp *l1 = LIST_FIRST(&eo->proc->p_lwps);
+				if ((error = sigaction1(l1,
+				    linux32_to_native_signo[sig],	
+				    SCARG_P32(uap, nsa) ? &ns : NULL,
+				    SCARG_P32(uap, osa) ? &os : NULL,
+				    tramp, vers)) != 0)
+					return error;
+			}
+		} else {
+			if ((error = sigaction1(l, 
+			    linux32_to_native_signo[sig],	
+			    SCARG_P32(uap, nsa) ? &ns : NULL,
+			    SCARG_P32(uap, osa) ? &os : NULL,
+			    tramp, vers)) != 0)
+				return error;
+		}
 	}

 	if (SCARG_P32(uap, osa) != NULL) {

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/37437: signal problems in linux threads
Date: Mon, 26 Nov 2007 14:32:47 -0500

 On Nov 26,  7:00pm, arto.huusko@pp2.inet.fi (arto.huusko@pp2.inet.fi) wrote:
 -- Subject: kern/37437: signal problems in linux threads

 | >Number:         37437
 | >Category:       kern
 | >Synopsis:       linux sigaction does not affect all threads
 | >Confidential:   no
 | >Severity:       serious
 | >Priority:       high
 | >Responsible:    kern-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Mon Nov 26 19:00:00 +0000 2007
 | >Originator:     arto.huusko@pp2.inet.fi
 | >Release:        NetBSD 4.99.34
 | >Organization:
 | >Environment:
 | Architecture: x86_64
 | Machine: amd64
 | >Description:
 | While the process p_sigacts structure is shared between threads (cloned
 | processes) in emulated Linux process, the p_sigctx structure is not shared.
 | The sigsets ps_sigcatch and ps_sigignore are still used to determine how
 | a signal is delivered, and sigaction system call changes those sigsets
 | in addition p_sigacts.
 | >How-To-Repeat:
 | Java 6 crashes very easily even with simple programs. Java 1.5 seems to be
 | more stable, but I'm sure it too will crash at some point.
 | 
 | The following simple program illustrates the problem. When run on Linux
 | and NetBSD (as native NetBSD binary), the program prints "SEGV caught",
 | and exits.
 | 
 | However, when the Linux binary is run on NetBSD, the program core dumps.
 | Ktrace output shows that the signal is handled with default action instead
 | of the installed action.

 I think that we should put ps_sigcatch and ps_sigignore in sigacts which
 are shared.

 christos

From: Andrew Doran <ad@netbsd.org>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/37437: signal problems in linux threads
Date: Mon, 26 Nov 2007 20:41:56 +0000

 On Mon, Nov 26, 2007 at 02:32:47PM -0500, Christos Zoulas wrote:

 > I think that we should put ps_sigcatch and ps_sigignore in sigacts which
 > are shared.

 I agree. While we are at it, it would be worthwhile checking our current
 behaviour in the presence of LWPs against POSIX. I did look before when
 doing the per-LWP signal stuff but it has been nearly a year and I've
 forgotten.

 If nothing more is added to the PR I'll have a look on the opengroup site
 later this evening.

 Andrew

From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/37437: signal problems in linux threads
Date: Tue, 27 Nov 2007 02:15:11 +0000

 On Mon, Nov 26, 2007 at 08:45:02PM +0000, Andrew Doran wrote:

 >  I agree. While we are at it, it would be worthwhile checking our current
 >  behaviour in the presence of LWPs against POSIX. I did look before when
 >  doing the per-LWP signal stuff but it has been nearly a year and I've
 >  forgotten.

 I checked the behaviour against the standards wrt threads and it's fine,
 this stuff is all process global. I also tidied up the sigacts locking a bit
 (has been committed), although it doesn't affect the problem being described
 here.

 I did find one problem with sharing sigignore/sigcatch between processes.
 Each process has a a lock that covers its signal state along with a bunch of
 other things: p_smutex. Within a single process all LWPs share that lock, so
 there is a consistent view of the signal state across routines where the
 lock is held like kpsignal2().

 If sigignore/sigcatch are shared between processes then we have a problem
 because the per-process lock is no longer enough and the view of signal
 state is no longer consistent. There is an out, though: in nearly all the
 places those fields are inspected, we hold proclist_mutex which is a global,
 so we can say sigignore/sigcatch and the signal actions are locked by that.

 The two exceptions I see are sendsig_reset() and sigaction1(), the lock is
 held by neither of those routines. In sigaction1(), proclist_mutex can be
 acquired without problem just before p_smutex is acquired. sendsig_reset()
 is a bit more tricky because the lock hierarchy is proclist_mutex ->
 p_smutex, and it is called with p_smutex already held.

 spanners$ grep sendsig_reset `find src/sys/arch -name "*.c"` | wc -l
       40
 spanners$ grep sendsig_reset `find src/sys/compat -name "*.c"` | wc -l
       13

 There are 53 call sites so the major issue is trying to find a way to weasel
 the lock acquisition in without changing all of them :-). At this point my
 e-mail is about to get even more long winded and rambling. Here's another
 tremendous blast of hot air to add to the above:

 Each LWP has its own private signal state that is never accessed by other
 LWPs, like the signal mask and whether or not it's on the alt signal stack.
 The locking scheme was designed with SA (scheduler activations) in mind,
 shortly before it was removed from -current. In the SA universe, the signal
 mask is process global. So calls to the signal delivery routines (usually
 called sendsig_foo or foo_sendsig) are made with p_smutex held so we have
 atomic access to the global signal mask, etc. Obviously that is not needed
 any more since we don't have SA any more. We could:

 o Remove the back-calls to sendsig_reset() from the delivery routines.
 o Don't cover the delivery routines with p_smutex.
 o Have kpsendsig() do sendsig_reset()'s job before we call down to the
   delivery routine, and unlock before we call down.
 o Additionally, have kpsendsig() extract sa_handler while under lock
   (i.e. atomically wrt the other signal state) and have it pass this
   in as an argument to the delivery routine.

 Andrew

From: Arto Huusko <arto.huusko@pp2.inet.fi>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/37437: signal problems in linux threads
Date: Tue, 27 Nov 2007 07:22:53 +0200

 Andrew Doran wrote:

 >  o Remove the back-calls to sendsig_reset() from the delivery routines.
 >  o Don't cover the delivery routines with p_smutex.
 >  o Have kpsendsig() do sendsig_reset()'s job before we call down to the
 >    delivery routine, and unlock before we call down.

 kpsendsig() seems to receive the returnmask as a pointer to the LWP's
 sigmask sigset. If kpsendsig is to call sendsig_reset(), it must make
 a copy of that sigset before calling sendsig_reset(), and pass that
 copy to the delivery routine, in order to avoid (for all emulations,
 then) problem fixed in compat/linux32/arch/amd64/linux32_machdep.c
 revision 1.13.

Responsible-Changed-From-To: kern-bug-people->ad
Responsible-Changed-By: ad@narn.netbsd.org
Responsible-Changed-When: Fri, 08 Feb 2008 12:30:23 +0000
Responsible-Changed-Why:
take


From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/37437: signal problems in linux threads
Date: Fri, 8 Feb 2008 12:28:40 +0000

 I thought of a better way to handle the signal locking for cloned processes.
 In the near future we are hoping to merge the two locks around process local
 state (p_smutex, p_mutex) into a single lock. When that is done we could
 make p_mutex a pointer to an seperately allocated and reference counted
 lock, which could be shared among cloned processes acting as threads. So if
 you acquire the lock on one process, you have acquired the lock on all of
 its siblings. This would fix the concurrency issue.

 Andrew

Responsible-Changed-From-To: ad->kern-bug-people
Responsible-Changed-By: ad@NetBSD.org
Responsible-Changed-When: Wed, 05 Mar 2008 18:06:51 +0000
Responsible-Changed-Why:
I don't have time to fix this, but I will fix the locking to work
as described in the PR.


From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/37437 CVS commit: src/sys
Date: Thu, 24 Apr 2008 18:39:25 +0000 (UTC)

 Module Name:	src
 Committed By:	ad
 Date:		Thu Apr 24 18:39:25 UTC 2008

 Modified Files:
 	src/sys/arch/alpha/alpha: compat_13_machdep.c compat_16_machdep.c
 	    machdep.c
 	src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c
 	src/sys/arch/amiga/amiga: trap.c
 	src/sys/arch/arm/arm: compat_13_machdep.c compat_16_machdep.c
 	    sig_machdep.c
 	src/sys/arch/atari/atari: trap.c
 	src/sys/arch/cesfic/cesfic: trap.c
 	src/sys/arch/hp300/hp300: trap.c
 	src/sys/arch/hppa/hppa: hppa_machdep.c sig_machdep.c
 	src/sys/arch/i386/i386: compat_13_machdep.c compat_16_machdep.c
 	    freebsd_machdep.c ibcs2_machdep.c machdep.c svr4_machdep.c vm86.c
 	src/sys/arch/luna68k/luna68k: trap.c
 	src/sys/arch/m68k/m68k: compat_13_machdep.c compat_16_machdep.c
 	    sig_machdep.c sunos_machdep.c svr4_machdep.c
 	src/sys/arch/mac68k/mac68k: trap.c
 	src/sys/arch/mips/mips: compat_13_machdep.c compat_16_machdep.c
 	    mips_machdep.c sig_machdep.c
 	src/sys/arch/mvme68k/mvme68k: trap.c
 	src/sys/arch/news68k/news68k: trap.c
 	src/sys/arch/next68k/next68k: trap.c
 	src/sys/arch/powerpc/powerpc: compat_13_machdep.c compat_16_machdep.c
 	    sig_machdep.c
 	src/sys/arch/sh3/sh3: sh3_machdep.c
 	src/sys/arch/sparc/sparc: compat_13_machdep.c machdep.c sunos_machdep.c
 	    svr4_machdep.c trap.c
 	src/sys/arch/sparc64/sparc64: compat_13_machdep.c compat_16_machdep.c
 	    machdep.c netbsd32_machdep.c sunos32_machdep.c sunos_machdep.c
 	    svr4_32_machdep.c svr4_machdep.c
 	src/sys/arch/sun2/sun2: trap.c
 	src/sys/arch/sun3/sun3: trap.c
 	src/sys/arch/vax/vax: sig_machdep.c
 	src/sys/arch/x68k/x68k: trap.c
 	src/sys/coda: coda_psdev.c
 	src/sys/compat/common: kern_info_43.c kern_sig_13.c kern_sig_43.c
 	src/sys/compat/darwin: darwin_ptrace.c
 	src/sys/compat/ibcs2: ibcs2_misc.c
 	src/sys/compat/irix: irix_signal.c
 	src/sys/compat/linux/arch/alpha: linux_machdep.c
 	src/sys/compat/linux/arch/amd64: linux_machdep.c
 	src/sys/compat/linux/arch/arm: linux_machdep.c
 	src/sys/compat/linux/arch/i386: linux_machdep.c
 	src/sys/compat/linux/arch/m68k: linux_machdep.c
 	src/sys/compat/linux/arch/mips: linux_machdep.c
 	src/sys/compat/linux/arch/powerpc: linux_machdep.c
 	src/sys/compat/linux/common: linux_misc.c linux_sig_notalpha.c
 	    linux_signal.c
 	src/sys/compat/linux32/arch/amd64: linux32_machdep.c
 	src/sys/compat/linux32/common: linux32_signal.c linux32_time.c
 	    linux32_wait.c
 	src/sys/compat/mach: mach_task.c mach_thread.c
 	src/sys/compat/netbsd32: netbsd32_signal.c netbsd32_wait.c
 	src/sys/compat/osf1: osf1_resource.c osf1_signal.c
 	src/sys/compat/svr4: svr4_misc.c svr4_signal.c
 	src/sys/compat/svr4_32: svr4_32_misc.c svr4_32_signal.c
 	src/sys/kern: init_main.c init_sysctl.c kern_acct.c kern_auth.c
 	    kern_core.c kern_descrip.c kern_event.c kern_exec.c kern_exit.c
 	    kern_fork.c kern_kthread.c kern_ktrace.c kern_lwp.c kern_proc.c
 	    kern_resource.c kern_sig.c kern_sleepq.c kern_synch.c sched_4bsd.c
 	    sys_aio.c sys_descrip.c sys_lwp.c sys_process.c sys_pset.c
 	    sys_sched.c sys_select.c sys_sig.c tty.c vfs_lockf.c
 	src/sys/miscfs/procfs: procfs_ctl.c procfs_linux.c procfs_status.c
 	    procfs_subr.c procfs_vnops.c
 	src/sys/netsmb: smb_subr.c
 	src/sys/sys: lwp.h proc.h
 	src/sys/ufs/mfs: mfs_vfsops.c

 Log Message:
 Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
 we no longer need to guard against access from hardware interrupt handlers.

 Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
 child process share the parent's lock so that signal state may be kept in
 sync. Partially addresses PR kern/37437.


 To generate a diff of this commit:
 cvs rdiff -r1.16 -r1.17 src/sys/arch/alpha/alpha/compat_13_machdep.c
 cvs rdiff -r1.12 -r1.13 src/sys/arch/alpha/alpha/compat_16_machdep.c
 cvs rdiff -r1.303 -r1.304 src/sys/arch/alpha/alpha/machdep.c
 cvs rdiff -r1.87 -r1.88 src/sys/arch/amd64/amd64/machdep.c
 cvs rdiff -r1.49 -r1.50 src/sys/arch/amd64/amd64/netbsd32_machdep.c
 cvs rdiff -r1.118 -r1.119 src/sys/arch/amiga/amiga/trap.c
 cvs rdiff -r1.14 -r1.15 src/sys/arch/arm/arm/compat_13_machdep.c
 cvs rdiff -r1.9 -r1.10 src/sys/arch/arm/arm/compat_16_machdep.c
 cvs rdiff -r1.34 -r1.35 src/sys/arch/arm/arm/sig_machdep.c
 cvs rdiff -r1.95 -r1.96 src/sys/arch/atari/atari/trap.c
 cvs rdiff -r1.40 -r1.41 src/sys/arch/cesfic/cesfic/trap.c
 cvs rdiff -r1.137 -r1.138 src/sys/arch/hp300/hp300/trap.c
 cvs rdiff -r1.11 -r1.12 src/sys/arch/hppa/hppa/hppa_machdep.c
 cvs rdiff -r1.19 -r1.20 src/sys/arch/hppa/hppa/sig_machdep.c
 cvs rdiff -r1.20 -r1.21 src/sys/arch/i386/i386/compat_13_machdep.c
 cvs rdiff -r1.14 -r1.15 src/sys/arch/i386/i386/compat_16_machdep.c
 cvs rdiff -r1.49 -r1.50 src/sys/arch/i386/i386/freebsd_machdep.c
 cvs rdiff -r1.34 -r1.35 src/sys/arch/i386/i386/ibcs2_machdep.c
 cvs rdiff -r1.628 -r1.629 src/sys/arch/i386/i386/machdep.c
 cvs rdiff -r1.89 -r1.90 src/sys/arch/i386/i386/svr4_machdep.c
 cvs rdiff -r1.46 -r1.47 src/sys/arch/i386/i386/vm86.c
 cvs rdiff -r1.51 -r1.52 src/sys/arch/luna68k/luna68k/trap.c
 cvs rdiff -r1.12 -r1.13 src/sys/arch/m68k/m68k/compat_13_machdep.c
 cvs rdiff -r1.11 -r1.12 src/sys/arch/m68k/m68k/compat_16_machdep.c
 cvs rdiff -r1.36 -r1.37 src/sys/arch/m68k/m68k/sig_machdep.c
 cvs rdiff -r1.35 -r1.36 src/sys/arch/m68k/m68k/sunos_machdep.c
 cvs rdiff -r1.27 -r1.28 src/sys/arch/m68k/m68k/svr4_machdep.c
 cvs rdiff -r1.132 -r1.133 src/sys/arch/mac68k/mac68k/trap.c
 cvs rdiff -r1.15 -r1.16 src/sys/arch/mips/mips/compat_13_machdep.c
 cvs rdiff -r1.10 -r1.11 src/sys/arch/mips/mips/compat_16_machdep.c
 cvs rdiff -r1.199 -r1.200 src/sys/arch/mips/mips/mips_machdep.c
 cvs rdiff -r1.14 -r1.15 src/sys/arch/mips/mips/sig_machdep.c
 cvs rdiff -r1.95 -r1.96 src/sys/arch/mvme68k/mvme68k/trap.c
 cvs rdiff -r1.57 -r1.58 src/sys/arch/news68k/news68k/trap.c
 cvs rdiff -r1.72 -r1.73 src/sys/arch/next68k/next68k/trap.c
 cvs rdiff -r1.13 -r1.14 src/sys/arch/powerpc/powerpc/compat_13_machdep.c
 cvs rdiff -r1.10 -r1.11 src/sys/arch/powerpc/powerpc/compat_16_machdep.c
 cvs rdiff -r1.31 -r1.32 src/sys/arch/powerpc/powerpc/sig_machdep.c
 cvs rdiff -r1.70 -r1.71 src/sys/arch/sh3/sh3/sh3_machdep.c
 cvs rdiff -r1.8 -r1.9 src/sys/arch/sparc/sparc/compat_13_machdep.c
 cvs rdiff -r1.276 -r1.277 src/sys/arch/sparc/sparc/machdep.c
 cvs rdiff -r1.20 -r1.21 src/sys/arch/sparc/sparc/sunos_machdep.c
 cvs rdiff -r1.64 -r1.65 src/sys/arch/sparc/sparc/svr4_machdep.c
 cvs rdiff -r1.174 -r1.175 src/sys/arch/sparc/sparc/trap.c
 cvs rdiff -r1.19 -r1.20 src/sys/arch/sparc64/sparc64/compat_13_machdep.c
 cvs rdiff -r1.11 -r1.12 src/sys/arch/sparc64/sparc64/compat_16_machdep.c
 cvs rdiff -r1.219 -r1.220 src/sys/arch/sparc64/sparc64/machdep.c
 cvs rdiff -r1.78 -r1.79 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
 cvs rdiff -r1.25 -r1.26 src/sys/arch/sparc64/sparc64/sunos32_machdep.c
 cvs rdiff -r1.28 -r1.29 src/sys/arch/sparc64/sparc64/sunos_machdep.c
 cvs rdiff -r1.32 -r1.33 src/sys/arch/sparc64/sparc64/svr4_32_machdep.c
 cvs rdiff -r1.48 -r1.49 src/sys/arch/sparc64/sparc64/svr4_machdep.c
 cvs rdiff -r1.34 -r1.35 src/sys/arch/sun2/sun2/trap.c
 cvs rdiff -r1.133 -r1.134 src/sys/arch/sun3/sun3/trap.c
 cvs rdiff -r1.14 -r1.15 src/sys/arch/vax/vax/sig_machdep.c
 cvs rdiff -r1.94 -r1.95 src/sys/arch/x68k/x68k/trap.c
 cvs rdiff -r1.42 -r1.43 src/sys/coda/coda_psdev.c
 cvs rdiff -r1.32 -r1.33 src/sys/compat/common/kern_info_43.c
 cvs rdiff -r1.17 -r1.18 src/sys/compat/common/kern_sig_13.c
 cvs rdiff -r1.30 -r1.31 src/sys/compat/common/kern_sig_43.c
 cvs rdiff -r1.15 -r1.16 src/sys/compat/darwin/darwin_ptrace.c
 cvs rdiff -r1.102 -r1.103 src/sys/compat/ibcs2/ibcs2_misc.c
 cvs rdiff -r1.46 -r1.47 src/sys/compat/irix/irix_signal.c
 cvs rdiff -r1.41 -r1.42 src/sys/compat/linux/arch/alpha/linux_machdep.c
 cvs rdiff -r1.28 -r1.29 src/sys/compat/linux/arch/amd64/linux_machdep.c
 cvs rdiff -r1.25 -r1.26 src/sys/compat/linux/arch/arm/linux_machdep.c
 cvs rdiff -r1.134 -r1.135 src/sys/compat/linux/arch/i386/linux_machdep.c
 cvs rdiff -r1.36 -r1.37 src/sys/compat/linux/arch/m68k/linux_machdep.c
 cvs rdiff -r1.36 -r1.37 src/sys/compat/linux/arch/mips/linux_machdep.c
 cvs rdiff -r1.37 -r1.38 src/sys/compat/linux/arch/powerpc/linux_machdep.c
 cvs rdiff -r1.196 -r1.197 src/sys/compat/linux/common/linux_misc.c
 cvs rdiff -r1.36 -r1.37 src/sys/compat/linux/common/linux_sig_notalpha.c
 cvs rdiff -r1.60 -r1.61 src/sys/compat/linux/common/linux_signal.c
 cvs rdiff -r1.16 -r1.17 src/sys/compat/linux32/arch/amd64/linux32_machdep.c
 cvs rdiff -r1.7 -r1.8 src/sys/compat/linux32/common/linux32_signal.c \
     src/sys/compat/linux32/common/linux32_wait.c
 cvs rdiff -r1.18 -r1.19 src/sys/compat/linux32/common/linux32_time.c
 cvs rdiff -r1.69 -r1.70 src/sys/compat/mach/mach_task.c
 cvs rdiff -r1.45 -r1.46 src/sys/compat/mach/mach_thread.c
 cvs rdiff -r1.28 -r1.29 src/sys/compat/netbsd32/netbsd32_signal.c
 cvs rdiff -r1.17 -r1.18 src/sys/compat/netbsd32/netbsd32_wait.c
 cvs rdiff -r1.12 -r1.13 src/sys/compat/osf1/osf1_resource.c
 cvs rdiff -r1.34 -r1.35 src/sys/compat/osf1/osf1_signal.c
 cvs rdiff -r1.141 -r1.142 src/sys/compat/svr4/svr4_misc.c
 cvs rdiff -r1.62 -r1.63 src/sys/compat/svr4/svr4_signal.c
 cvs rdiff -r1.60 -r1.61 src/sys/compat/svr4_32/svr4_32_misc.c
 cvs rdiff -r1.24 -r1.25 src/sys/compat/svr4_32/svr4_32_signal.c
 cvs rdiff -r1.352 -r1.353 src/sys/kern/init_main.c
 cvs rdiff -r1.132 -r1.133 src/sys/kern/init_sysctl.c
 cvs rdiff -r1.85 -r1.86 src/sys/kern/kern_acct.c
 cvs rdiff -r1.58 -r1.59 src/sys/kern/kern_auth.c
 cvs rdiff -r1.11 -r1.12 src/sys/kern/kern_core.c
 cvs rdiff -r1.176 -r1.177 src/sys/kern/kern_descrip.c
 cvs rdiff -r1.56 -r1.57 src/sys/kern/kern_event.c
 cvs rdiff -r1.271 -r1.272 src/sys/kern/kern_exec.c
 cvs rdiff -r1.203 -r1.204 src/sys/kern/kern_exit.c
 cvs rdiff -r1.161 -r1.162 src/sys/kern/kern_fork.c
 cvs rdiff -r1.22 -r1.23 src/sys/kern/kern_kthread.c
 cvs rdiff -r1.141 -r1.142 src/sys/kern/kern_ktrace.c
 cvs rdiff -r1.102 -r1.103 src/sys/kern/kern_lwp.c
 cvs rdiff -r1.136 -r1.137 src/sys/kern/kern_proc.c
 cvs rdiff -r1.138 -r1.139 src/sys/kern/kern_resource.c
 cvs rdiff -r1.276 -r1.277 src/sys/kern/kern_sig.c
 cvs rdiff -r1.26 -r1.27 src/sys/kern/kern_sleepq.c
 cvs rdiff -r1.228 -r1.229 src/sys/kern/kern_synch.c
 cvs rdiff -r1.19 -r1.20 src/sys/kern/sched_4bsd.c
 cvs rdiff -r1.17 -r1.18 src/sys/kern/sys_aio.c
 cvs rdiff -r1.1 -r1.2 src/sys/kern/sys_descrip.c
 cvs rdiff -r1.38 -r1.39 src/sys/kern/sys_lwp.c
 cvs rdiff -r1.137 -r1.138 src/sys/kern/sys_process.c
 cvs rdiff -r1.5 -r1.6 src/sys/kern/sys_pset.c
 cvs rdiff -r1.20 -r1.21 src/sys/kern/sys_sched.c
 cvs rdiff -r1.4 -r1.5 src/sys/kern/sys_select.c
 cvs rdiff -r1.13 -r1.14 src/sys/kern/sys_sig.c
 cvs rdiff -r1.220 -r1.221 src/sys/kern/tty.c
 cvs rdiff -r1.63 -r1.64 src/sys/kern/vfs_lockf.c
 cvs rdiff -r1.44 -r1.45 src/sys/miscfs/procfs/procfs_ctl.c
 cvs rdiff -r1.49 -r1.50 src/sys/miscfs/procfs/procfs_linux.c
 cvs rdiff -r1.33 -r1.34 src/sys/miscfs/procfs/procfs_status.c
 cvs rdiff -r1.87 -r1.88 src/sys/miscfs/procfs/procfs_subr.c
 cvs rdiff -r1.167 -r1.168 src/sys/miscfs/procfs/procfs_vnops.c
 cvs rdiff -r1.30 -r1.31 src/sys/netsmb/smb_subr.c
 cvs rdiff -r1.87 -r1.88 src/sys/sys/lwp.h
 cvs rdiff -r1.272 -r1.273 src/sys/sys/proc.h
 cvs rdiff -r1.91 -r1.92 src/sys/ufs/mfs/mfs_vfsops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Eric Haszlakiewicz <erh@nimenees.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37437
Date: Sun, 21 Sep 2008 20:14:51 -0500

 erh@NetBSD.org wrote:
 > Synopsis: linux thread issue seen with java6?
 >
 > State-Changed-From-To: open->closed
 > State-Changed-By: erh@NetBSD.org
 > State-Changed-When: Sat, 20 Sep 2008 05:21:20 +0000
 > State-Changed-Why:
 > Bug kern/37437 describes the same problem and, although a fix has not yet
 > been applied to the tree, that bug has a workaround patch that appears to
 > get java6 working
 One extra bit of info that might help people get java6 working: it seems 
 to need more file descriptors than java 1.5, so I was getting all sorts 
 of odd errors and slow behaviour until I bumped up the ulimit for that 
 to 1024.  (openfiles-cur in login.conf).

Responsible-Changed-From-To: kern-bug-people->chs
Responsible-Changed-By: chs@NetBSD.org
Responsible-Changed-When: Thu, 14 Oct 2010 22:04:53 +0000
Responsible-Changed-Why:
mine


State-Changed-From-To: open->feedback
State-Changed-By: chs@NetBSD.org
State-Changed-When: Thu, 14 Oct 2010 22:04:53 +0000
State-Changed-Why:
your test program works for me in recent -current kernels,
could you try it again?


From: Arto Huusko <arto.huusko@pp2.inet.fi>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37437 (linux sigaction does not affect all threads)
Date: Wed, 20 Oct 2010 18:50:57 +0300

 It works now correctly, this can be closed.

State-Changed-From-To: feedback->closed
State-Changed-By: chs@NetBSD.org
State-Changed-When: Wed, 20 Oct 2010 16:07:53 +0000
State-Changed-Why:
confirmed fixed.


>Unformatted:
 See also kern/36272 (now closed), which describes the same problem.
 It has a small bit of java code that reproduces the problem.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.