public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "robert at ocallahan dot org" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug nptl/17208] New: pthread_cond_wait may put mutex into incorrect state if mutex has elision disabled Date: Mon, 28 Jul 2014 06:41:00 -0000 [thread overview] Message-ID: <bug-17208-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=17208 Bug ID: 17208 Summary: pthread_cond_wait may put mutex into incorrect state if mutex has elision disabled Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: nptl Assignee: unassigned at sourceware dot org Reporter: robert at ocallahan dot org CC: drepper.fsp at gmail dot com pthread_cond_wait calls __pthread_mutex_cond_lock_adjust after acquiring the mutex's futex. __pthread_mutex_cond_lock_adjust has the following code: if (mutex->__data.__kind == PTHREAD_MUTEX_PI_RECURSIVE_NP) ++mutex->__data.__count; I think this code should check PTHREAD_MUTEX_TYPE(mutex->__data.__kind). Otherwise, if the mutex is recursive but __kind has the PTHREAD_MUTEX_ELISION_NP or PTHREAD_MUTEX_NO_ELISION_NP, __count will not be incremented and a later pthread_mutex_unlock of the mutex goes wrong, decrementing __count from 0 to 0xffffffff and failing to unlock the mutex. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2014-07-28 6:41 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-28 6:41 robert at ocallahan dot org [this message] 2014-07-28 7:18 ` [Bug nptl/17208] " robert at ocallahan dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-17208-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).