This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
trying to understand what's going on with timers and boot process
- From: Mark Seger <Mark dot Seger at hp dot com>
- To: libc-help at sourceware dot org
- Date: Tue, 01 Jul 2008 09:09:06 -0400
- Subject: trying to understand what's going on with timers and boot process
I use the perl module Time::HiRes to set alarms. It had been working
just fine for years and years. Then a few years ago it starting failing
on systems with glibc 2.4 installed and timers > 4.4 seconds because it
was passing the whole thing in microseconds instead of passing the
seconds portion as seconds. I reported this to the author and he fixed
it and it works just fine now. BUT I've found modern distros, such as
RHEL5, are still shipping the old HiRes module and they're also bundling
in glibc 2.5.
Now for my question - I've observed that 2.5 does appear to work
correctly even with the incorrect parameters being passed so clearly
something has changed since 2.4. BUT the other thing I've observed is
if I try to set a timer >1 second during boot, I get setitimer errors
and once the system boots I don't. In other words, if I start a perl
script via /etc/init.d which sets a .5 second timer and sleeps, then
increment it by a second and do it again, etc It generates a setitimer
error for every call from 1.5-10.5 seconds BUT then stops as the time
gets up to about 15 and the script exits. I don't know if there is
something magic about the numbers 1.5-10.5 OR if some system resource
has changed by the time the 11.5 second alarm is set.
My issue is I have an open source program that is dependent on HiRes and
is being distributed on Fedora 10 and I fear I'm going to start getting
a lot of support requests over this. I do intend to release a new
version that checks the version of glibc (I recently discovered I could
just run /lib/libc.6.so and it tells me its version) and warn people
when there is a problem, but I'm still stumped with the fact that I've
only seen errors on 2.5 systems during boot. Can someone shed any light
on what I'm seeing? Should I be worrying about ALL versions of glibc > 2.3?
-mark