RT Timers problem
Hi - i've encountered a couple of different, but maybe related problems in Debian linux on an RX2600 (ia64). Maybe someone can comment if they've seen this before?
1. RT signals RTMIN, RTMIN+1, RTMIN+2 are not being delivered. I created a simple test case that sets an interval timer set to fire once per second, but the signal never arrives! When i use RTMIN+3 or greater, then the code works fine. I can provide the test code to anyone who is interested in trying it out on their system.
2. In some cases, a call to timer_create() will block. This one is harder to reproduce, but i've done it multiple times and have something like this in my code:
fprintf(stderr,
"HMM: Creating timer with signo=%d\n", signal_no);
status = timer_create(CLOCK_REALTIME,
&h_event_struct, &h_timer_id);
fprintf(stderr,
"HMM: Timer created, status = %d\n", status);
And in the output, only the first line is printed. The timer_create() never returns! I also did a strace and the tail of that is:
write(2, "HMM: Creating timer with signo="..., 35HMM:
Creating timer with signo5
) = 35getpid() = 591getrlimit(RLIMIT_STACK, {rlim_cur�92*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0) 0x600000000009c000 brk(0x60000000000a4000) 0x60000000000a4000 pipe([2973872, 536870912]) = 4
SYS_1213(0x20000000000393a8, 0x60000000000988c0, 0x7fe0, 0xf00, 0x20000000002fc640, 0x20000000000393a8, 0x20000000002fc640, 0xf00) = 600write(5, "\1\0\0\0\0\0\0\0\5\0\0\0\0\0\0\0pj-\0\0\0\0 \30\0\3\0\0"..., 168) = 168 rt_sigprocmask(SIG_SETMASK, NULL, [RT0], 8) = 0 write(5, "\200\300/\0\0\0\0 \0\0\0\0\0\0\0\0\10{\7\0\0\0\0 \10\257"..., 168) = 168 rt_sigprocmask(SIG_SETMASK, NULL, [RT0], 8) = 0 rt_sigsuspend([]
and there it sits.
Has anyone seen either of these problems come up on debian linux/ia64? For what its worth, i was using redhat AS back in January and the problems never popped up back then, so i do think may be specific to the librt provided in debian:
libc6.1-dev: /usr/lib/librt.so
Thanks,
/steve
==----------------------------------------------------------
Steve Woodruff, N9OH @ 42.18N 88.34W, [email protected]
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
Quoted 7 lines · Steve Woodruff
1. RT signals RTMIN, RTMIN+1, RTMIN+2 are not being delivered. I created a simple test case that sets an interval timer set to fire once per second, but the signal never arrives! When i use RTMIN+3 or greater, then the code works fine. I can provide the test code to anyone who is interested in trying it out on their system.
Aren't these used by libc for thread management purposes? RH uses NPTL so it ses different methods.
Signature · 3 lines
"It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk
Quoted 3 lines · --- Matthew Wilcox
Aren't these used by libc for thread management
purposes? RH uses NPTL
so it ses different methods.
Might be - i checked the libc6.1 docs and it mentions that USR1 and USR2 were used for that purpose, but then goes on to say that after kernel 2.1.60 that was no longer the case. It didn't mention, but perhaps its switched to those first three RT sigs?
/steve
==----------------------------------------------------------
Steve Woodruff, N9OH @ 42.18N 88.34W, [email protected]
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
Quoted 5 lines
2. In some cases, a call to
timer_create()will block.
This one is harder to reproduce, but i've done it multiple times and have something like this in my code:
Ok - i found the solution my self after some further research. It appears that -lrt requires -lpthread --even for non-threaded programs. After adding -pthread and explicitly listing -lpthread before -lc in my link flags, all seems to be working as expected now.
tnx
/steve
==----------------------------------------------------------
Steve Woodruff, N9OH @ 42.18N 88.34W, [email protected]
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com