On Tue, Aug 08, 2006, Julien Danjou wrote:
> > (3) If it's reproducible, can you trace through the code and see where
> > it fails? In particular, what value is being returned from
> > pthread_cond_timedwait?
>
> I can, but I'd need a little help, I'm not a C++ guru.
It is reproducible on Julien's Xen machine, with this debug output:
| ......................
| rval == -1080447064
|
| now2.tv_sec == 1155053066
| now.tv_sec + 2 == 1155053066
| now2.tv_usec == 882203
| now.tv_usec == 887661
| F.............
|
|
| !!!FAILURES!!!
| Test Results:
| Run: 35 Failures: 1 Errors: 0
|
|
| 1) test: TestThreads::testTimedTake (F) line: 126 test_threads.cc
| assertion failed
| - Expression: now2.tv_sec > now.tv_sec + 2 || now2.tv_usec >= now.tv_usec
I got it using a simple debug in aptitude-0.4.2/src/generic/util/threads.h:486
while( printf( "\nrval == %d\n", rval ) && ((rval =
pthread_cond_timedwait(&cond, &l.parent.m, &until)) == EINTR ) )
and in aptitude-0.4.2/tests/test_threads.cc:117
printf( "\n"
"now2.tv_sec == %d\n"
"now.tv_sec + 2 == %d\n"
"now2.tv_usec == %d\n"
"now.tv_usec == %d\n",
now2.tv_sec,
now.tv_sec + 2,
now2.tv_usec,
now.tv_usec );
FYI, it never occured on my non-virtual machine.
--
adn
Mohammed Adnène Trojette