Subject: Re: kern/37437: signal problems in linux threads
To: None <gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-bugs
Date: 11/26/2007 14:32:47
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