This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/16897] New: pthread_cond_timedwait wakes up early
- From: "te.anton at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 02 May 2014 18:37:11 +0000
- Subject: [Bug libc/16897] New: pthread_cond_timedwait wakes up early
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=16897
Bug ID: 16897
Summary: pthread_cond_timedwait wakes up early
Product: glibc
Version: 2.18
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: te.anton at gmail dot com
CC: drepper.fsp at gmail dot com
Created attachment 7583
--> https://sourceware.org/bugzilla/attachment.cgi?id=7583&action=edit
test application in C to reproduce the bug
pthread_cond_timedwait wakes up early (1 second early it seems).
The bug is reproducible on:
* Fedora 20
$ cat /etc/issue
Fedora release 20 (Heisenbug)
Kernel \r on an \m (\l)
$ ldd --version
ldd (GNU libc) 2.18
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
* Ubuntu 12.04.4 LTS
$ cat /etc/issue
Ubuntu 12.04.4 LTS \n \l
$ ldd --version
ldd (Ubuntu EGLIBC 2.15-0ubuntu10.5) 2.15
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
* Ubuntu 13.04
$ cat /etc/issue
Ubuntu 13.04 \n \l
$ ldd --version
ldd (Ubuntu EGLIBC 2.17-0ubuntu5) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Looks like libc/pthread 2.13 (fedora 14) and 2.10 does not have this bug. Also
the issued is not happening on my Mac Book Air.
Steps to reproduce:
* compile the test application
$ gcc -Wall -pipe -g -O0 bug_pthread_cond_timedwait.c -lpthread -o
bug_pthread_cond_timedwait
* run the application
./bug_pthread_cond_timedwait
* Result:
wait:1399055635 wakeup:1399055634
bug: main.c:54: main: Assertion `!"early wakeup"' failed.
Aborted (core dumped)
* Expected result:
OK
OK
switch, sleep 89383 ms
OK
OK
OK
switch, sleep 30886 ms
OK
...
--
You are receiving this mail because:
You are on the CC list for the bug.