public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/16897] New: pthread_cond_timedwait wakes up early
@ 2014-05-02 18:37 te.anton at gmail dot com
  2014-05-02 18:53 ` [Bug libc/16897] " sourceware at linglink dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: te.anton at gmail dot com @ 2014-05-02 18:37 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
@ 2014-05-02 18:53 ` sourceware at linglink dot com
  2014-05-02 19:08 ` sourceware at linglink dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sourceware at linglink dot com @ 2014-05-02 18:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

Maurice Ling <sourceware at linglink dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sourceware at linglink dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
  2014-05-02 18:53 ` [Bug libc/16897] " sourceware at linglink dot com
@ 2014-05-02 19:08 ` sourceware at linglink dot com
  2014-06-04 14:17 ` [Bug nptl/16897] " schwab@linux-m68k.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sourceware at linglink dot com @ 2014-05-02 19:08 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

--- Comment #1 from Maurice Ling <sourceware at linglink dot com> ---
Cross compiled for ARM does not have the timed wait problem:

$ ldd --version
ldd (crosstool-NG 1.18.0) 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.
$ uname -a
Linux nc1 2.6.37+ #2 Thu May 1 12:59:11 PDT 2014 armv7l GNU/Linux

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
  2014-05-02 18:53 ` [Bug libc/16897] " sourceware at linglink dot com
  2014-05-02 19:08 ` sourceware at linglink dot com
@ 2014-06-04 14:17 ` schwab@linux-m68k.org
  2014-06-04 14:44 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2014-06-04 14:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |nptl

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
                   ` (2 preceding siblings ...)
  2014-06-04 14:17 ` [Bug nptl/16897] " schwab@linux-m68k.org
@ 2014-06-04 14:44 ` schwab@linux-m68k.org
  2014-06-04 14:52 ` te.anton at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2014-06-04 14:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
The time function returns a value that is not precise enough to measure the
exact wakup time.  Use gettimeofday instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
                   ` (3 preceding siblings ...)
  2014-06-04 14:44 ` schwab@linux-m68k.org
@ 2014-06-04 14:52 ` te.anton at gmail dot com
  2014-06-04 15:01 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: te.anton at gmail dot com @ 2014-06-04 14:52 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

--- Comment #3 from Anton Te <te.anton at gmail dot com> ---
The issue is reproducible with gettimeofday. See the source code in the
attachment. There is the function mytime, you can change the implementation
from time() to gettimeofday().

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
                   ` (4 preceding siblings ...)
  2014-06-04 14:52 ` te.anton at gmail dot com
@ 2014-06-04 15:01 ` schwab@linux-m68k.org
  2014-06-04 15:53 ` te.anton at gmail dot com
  2014-06-12 19:29 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2014-06-04 15:01 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
Must be a bug in your kernel then.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
                   ` (5 preceding siblings ...)
  2014-06-04 15:01 ` schwab@linux-m68k.org
@ 2014-06-04 15:53 ` te.anton at gmail dot com
  2014-06-12 19:29 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: te.anton at gmail dot com @ 2014-06-04 15:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

--- Comment #5 from Anton Te <te.anton at gmail dot com> ---
As you can see I tested it with different versions: Fedora 20, Ubuntu 12.04,
Ubuntu 13.04.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug nptl/16897] pthread_cond_timedwait wakes up early
  2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
                   ` (6 preceding siblings ...)
  2014-06-04 15:53 ` te.anton at gmail dot com
@ 2014-06-12 19:29 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2014-06-12 19:29 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16897

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-12 19:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 18:37 [Bug libc/16897] New: pthread_cond_timedwait wakes up early te.anton at gmail dot com
2014-05-02 18:53 ` [Bug libc/16897] " sourceware at linglink dot com
2014-05-02 19:08 ` sourceware at linglink dot com
2014-06-04 14:17 ` [Bug nptl/16897] " schwab@linux-m68k.org
2014-06-04 14:44 ` schwab@linux-m68k.org
2014-06-04 14:52 ` te.anton at gmail dot com
2014-06-04 15:01 ` schwab@linux-m68k.org
2014-06-04 15:53 ` te.anton at gmail dot com
2014-06-12 19:29 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).