Bug 134546 - breaks dietlibc signal-handling
breaks dietlibc signal-handling
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dietlibc (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-04 11:26 EDT by Enrico Scholz
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-24 14:11:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2004-10-04 11:26:40 EDT
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 11:32:21 EDT
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 11:40:43 EDT
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 17:16:44 EDT
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 14:11:31 EDT
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.