public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/15988] New: tst-mutexpi8 test case failure on non-x86 systems
@ 2013-10-01  9:24 siddhesh at redhat dot com
  2013-10-01 19:33 ` [Bug nptl/15988] " cmetcalf at tilera dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2013-10-01  9:24 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 15988
           Summary: tst-mutexpi8 test case failure on non-x86 systems
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: siddhesh at redhat dot com
          Reporter: siddhesh at redhat dot com
                CC: drepper.fsp at gmail dot com

tst-mutexpi8 test case fails on non-x86 boxes (tested s390 and got a similar
report for ppc) for recursive mutexes.  Here's a reproducer that produces the
same failure.

#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

pthread_mutex_t mutex;
pthread_mutexattr_t attr;
pthread_cond_t cond;
pthread_t tid;

void *callback(void *arg){
        for (;;){
                sleep(2);
                pthread_mutex_lock(&mutex);
                printf("Wake up!\n");
                pthread_cond_broadcast(&cond);
                pthread_mutex_unlock(&mutex);
        }
}

int main(){
        pthread_mutexattr_init(&attr);
        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
        pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
        pthread_mutex_init(&mutex, &attr);
        pthread_cond_init(&cond, NULL);

        pthread_mutex_lock(&mutex);
        pthread_create(&tid, NULL, callback, &cond);

        printf("Going to sleep\n");
        for(;;){
                pthread_cond_wait(&cond, &mutex);
                printf("OK\n");
                exit(0);
        }
}

Actual results:

Going to sleep
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
Wake up!
...

Expected Result:

Going to sleep
Wake up!
OK

Patch coming soon.

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


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

end of thread, other threads:[~2013-11-21 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-01  9:24 [Bug nptl/15988] New: tst-mutexpi8 test case failure on non-x86 systems siddhesh at redhat dot com
2013-10-01 19:33 ` [Bug nptl/15988] " cmetcalf at tilera dot com
2013-10-03  2:42 ` siddhesh at redhat dot com
2013-10-03  2:45 ` siddhesh at redhat dot com
2013-11-01 19:01 ` cvs-commit at gcc dot gnu.org
2013-11-21 17:14 ` cvs-commit at gcc dot gnu.org

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).