public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/27304] New: pthread_cond_destroy does not pass private flag to futex system calls
@ 2021-02-01  8:22 fweimer at redhat dot com
  2021-02-01  8:22 ` [Bug nptl/27304] " fweimer at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-02-01  8:22 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 27304
           Summary: pthread_cond_destroy does not pass private flag to
                    futex system calls
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Commit dc6cfdc934db9997c33728082d63552b9eee4563 ("nptl: Move
pthread_cond_destroy implementation into libc") dropped use of the
process-shared flag because of this optimization in
sysdeps/nptl/lowlevellock-futex.h:

# if IS_IN (libc) || IS_IN (rtld)
/* In libc.so or ld.so all futexes are private.  */
#  define __lll_private_flag(fl, private)                       \
  ({                                                            \
    /* Prevent warnings in callers of this macro.  */           \
    int __lll_private_flag_priv __attribute__ ((unused));       \
    __lll_private_flag_priv = (private);                        \
    ((fl) | FUTEX_PRIVATE_FLAG);                                \
  })
# else
#  define __lll_private_flag(fl, private) \
  (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
# endif

I think the fix is to remove the optimization because it is unused. The
internal locks are always private, so the optimization does not matter to them.

On x86-64, pthread_cond_destroy is the only place where the alternative macro
definition results in changed machine code, but we do not actually want this
change there (because it probably breaks process-shared condition variables).

-- 
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:[~2021-03-16  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  8:22 [Bug nptl/27304] New: pthread_cond_destroy does not pass private flag to futex system calls fweimer at redhat dot com
2021-02-01  8:22 ` [Bug nptl/27304] " fweimer at redhat dot com
2021-02-01  8:47 ` fweimer at redhat dot com
2021-02-01  8:48 ` fweimer at redhat dot com
2021-02-04 14:33 ` cvs-commit at gcc dot gnu.org
2021-02-04 14:35 ` fweimer at redhat dot com
2021-02-07 15:24 ` fweimer at redhat dot com
2021-03-16  9:22 ` fweimer at redhat dot com
2021-03-16  9:55 ` 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).