This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/618] New: RT signals bug on powerpc
- From: "djalel dot chefrour at acterna dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Dec 2004 07:41:25 -0000
- Subject: [Bug libc/618] New: RT signals bug on powerpc
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
Multithreaded apps, built using Kegel's gcc-3.2.3-glibc-2.3.2 cross
toolchain, hang on powerpc.
I'm using kernel 2.4.18 (from montavista, with some adds) on IBM 405EP
based bord.
I'v got same result with 2.4.21.
Although, linuxthreads uses value 35 for SIGRTMIN (in
"linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c" )
It seems that glibc uses value 32 for SIGRTMIN (in
"sysdeps/generic/allocrtsig.c" ) but linux kernel fixes it to 35.
Following is an strace of the thr_sig.c example.
(Source from :
http://mail-index.netbsd.org/netbsd-bugs/2003/01/22/0016.html).
Also 'testThreads' form libxml2 reproduces same Bug.
Someone else reported a similar bug on
http://www.ppckernel.org/forums/read.php?f=9&i=145&t=145
---------------------------------------------- thr_sig.c
#include <pthread.h>
#include <signal.h>
typedef void (*Signal_handler)(int);
struct signal_state {
int sig;
int signal_pending;
Signal_handler top_half;
struct sigaction bottom_half;
} signal_state[NSIG + 1];
int running;
void
term_sig(int sig)
{
running = 0;
printf("terminated by signal %d\n", sig);
}
void
signal_handler(int sig)
{
if ((sig >= 1) && (sig <= NSIG)) {
signal_state[sig].signal_pending = 1;
}
}
int
signal_set(int sig, Signal_handler handler, Signal_handler top_half)
{
int result;
struct signal_state *s;
if ((sig < 1) || (sig > NSIG)) {
printf("signal_set: sig %d out of range\n", sig);
exit(1);
}
s = &signal_state[sig];
s->sig = sig;
s->signal_pending = 0;
s->top_half = top_half;
s->bottom_half.sa_handler = handler;
sigemptyset(&s->bottom_half.sa_mask);
s->bottom_half.sa_flags = 0;
result = sigaction(sig, &s->bottom_half, 0);
if (result == -1) {
warn("setting signal handler %p", handler);
}
return result;
}
void
signal_process(void)
{
struct signal_state *s;
for (s = &signal_state[1]; s < &signal_state[NSIG + 1]; s += 1) {
if (s->sig && s->signal_pending && s->top_half) {
s->signal_pending = 0;
(*s->top_half)(s->sig);
}
}
}
void *
thread(void *arg)
{
sigset_t sigs;
running = 1;
signal_set(SIGHUP, signal_handler, term_sig);
signal_set(SIGINT, signal_handler, term_sig);
sigemptyset(&sigs);
while (running) {
sigsuspend(&sigs);
signal_process();
}
return 0;
}
int
main(int argc, char *argv[])
{
pthread_t thread_id;
pthread_create(&thread_id, 0, thread, 0);
pthread_join(thread_id, 0);
return 0;
}
---------------------------------------------- strace
execve("./thr_sig", ["./thr_sig"], [/* 26 vars */]) = 0
uname({sys="Linux", node="QT200_V2_0016", ...}) = 0
brk(0) = 0x100135b0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30016000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/local/lib/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/usr/local/lib", 0x7fffedf0) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("/lib/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0@\334"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=99057, ...}) = 0
mmap(0xff8f000, 393952, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xff8f000
mprotect(0xff9d000, 336608, PROT_NONE) = 0
mmap(0xff9f000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xff9f000
mmap(0xffaf000, 262880, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffaf000
close(3) = 0
open("/usr/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\317"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1638948, ...}) = 0
mmap(0xfe2f000, 1373520, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xfe2f000
mprotect(0xff66000, 99664, PROT_NONE) = 0
mmap(0xff6f000, 53248, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff6f000
mmap(0xff7c000, 9552, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xff7c000
close(3) = 0
getpid() = 1993
rt_sigaction(SIGRTMIN, {0xff96e6c, [], 0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xff96ea4, [], 0}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0xff96fa0, [], 0}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0x7ffff868, 36, (nil), 0}) = 0
brk(0) = 0x100135b0
brk(0x100145b0) = 0x100145b0
brk(0x10015000) = 0x10015000
ugetrlimit(0x3, 0x7ffff908) = 0
brk(0x10016000) = 0x10016000
pipe([3, 4]) = 0
clone(child_stack=0x100155f0,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND) = 1994
write(4, "\177\377\371\210\0\0\0\5\177\377\371\330\17\352\243\4\177"...,
148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
write(4, "\17\372\301@\0\0\0\0\0\0\0\0\20\0\10,\0\0\0\0\200\0\0\0"...,
148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
<... rt_sigsuspend resumed> ) = 32
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([]
--
Summary: RT signals bug on powerpc
Product: glibc
Version: 2.3.2
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: djalel dot chefrour at acterna dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686-gnu-linux
GCC host triplet: i686-gnu-linux
GCC target triplet: ibm405ep powerpc gnu-linux
http://sources.redhat.com/bugzilla/show_bug.cgi?id=618
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.