Bug 134546 - breaks dietlibc signal-handling
Summary: breaks dietlibc signal-handling
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dietlibc
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-04 15:26 UTC by Enrico Scholz
Modified: 2007-11-30 22:10 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-04-24 18:11:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.