Bug 134546

Summary: breaks dietlibc signal-handling
Product: [Fedora] Fedora Reporter: Enrico Scholz <rh-bugzilla>
Component: dietlibcAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: davej, mingo, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-24 18:11:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2004-10-04 15:26:40 UTC
Description of problem:

The fedora kernel seems to break signal-handling with dietlibc. E.g. the
following trivial program causes a segfault:

------
#include <sys/signal.h>
void handler(int s) {}
int main()
{
  signal(SIGUSR1, handler);
  kill(getpid(), SIGUSR1);
}
------

| $ diet gcc test.c
| $ strace ./a.out
| execve("./a.out", ["./a.out"], [/* 26 vars */]) = 0
| rt_sigaction(SIGUSR1, {0x80480d4, [USR1], SA_NOMASK}, {SIG_DFL}, 8) = 0
| getpid()                                = 31173
| kill(31173, SIGUSR1)                    = 0
| --- SIGUSR1 (User defined signal 1) @ 0 (0) ---
| --- SIGSEGV (Segmentation fault) @ 0 (0) ---
| +++ killed by SIGSEGV +++



This issue is caused by the fedora kernel; with a vanilla 2.6.8.1
kernel or 2.4.27 things are fine:

| $ strace ./a.out 
| execve("./a.out", ["./a.out"], [/* 37 vars */]) = 0
| rt_sigaction(SIGUSR1, {0x80480d4, [USR1], SA_NOMASK}, {SIG_DFL}, 8) = 0
| getpid()                                = 1366
| kill(1366, SIGUSR1)                     = 0
| --- SIGUSR1 (User defined signal 1) @ 0 (0) ---
| sigreturn()                             = ? (mask now [])
| _exit(0)                                = ?



Version-Release number of selected component (if applicable):

kernel-2.6.8-1.521
dietlibc-0.24-4


How reproducible:

100%

Comment 1 Arjan van de Ven 2004-10-04 15:32:21 UTC
dietlibc is miscompiled I suspect; it needs to indicate in the elf
flags that it requires executable stack.

Comment 2 Enrico Scholz 2004-10-04 15:40:43 UTC
it happens also when the program is compiled with

| diet gcc x.c  -Wl,-z -Wl,execstack

or with LD_ASSUME_KERNEL=2.2.5.

Comment 4 Jeremy Katz 2004-10-18 21:16:44 UTC
Fixed in dietlibc-0.27-3.  Added i386 sigaction code very similar to
the x86_64 sigaction code (basically, ensuring that the restorer is
set to sigreturn)

Comment 5 Jeremy Katz 2006-04-24 18:11:31 UTC
Mass-closing lots of old bugs which are in MODIFIED (and thus presumed to be
fixed).  If any of these are still a problem, please reopen or file a new bug
against the release which they're occurring in so they can be properly tracked.