This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Help repro PR 1749.


Problem report 1749 claims that glibc-linuxthreads-2.1.3 condition variable
waits can spuriously wake up when signals such as SIGINT are sent to the
program, and provides a program which demonstrates it.

However, the program's signal handler calls the async-unsafe printf().  If I
remove it, or replace it by a write(), I cannot reproduce the anomalous
behavior.  If I leave the printf there, the behavior happens, but is one of the
obvious consequences of an easily understood interaction between libio and
linuxthreads.

I can't dismiss the PR because a disturbing comment in the program states that
the problem even with the printf removed, the behavior can be reproduced,
albeit with greater difficulty.  The PR originator is working with SMP and uP
Alphas which I don't have access to at the moment.

I'm asking for help. If you have time, please download
http://users.footprints.net/~kaz/pr1749.c and see whether you can coax the
condition variable waits into spuriously waking when a signal is delivered.
This is a slightly modified version of the program, with the aforementioned
change from printf() to sprintf()/write() in the signal handler and a few
minor enhancements to make it easier to see spurious wakeups and to quit the
program.

One way to test this is to comment out the output generation in the signal
handler and just spam all the threads with SIGINT's, perhaps from a shell
loop like:  while true ; do killall -INT pr1749 ; done  .  There should
be no output; if you see something like "0x402: result of cond_wait: 0"
that's a positive repro of a spurious wakeup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]