public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/25942] New: Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread
@ 2020-05-07 15:22 schwab@linux-m68k.org
  2020-05-12 15:26 ` [Bug nptl/25942] " schwab@linux-m68k.org
  2020-07-31  9:07 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: schwab@linux-m68k.org @ 2020-05-07 15:22 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 25942
           Summary: Deadlock on stack_cache_lock between __nptl_setxid and
                    exiting detached thread
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: schwab@linux-m68k.org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

There is a race between __nptl_setxid and exiting detached thread, which causes
a deadlock on stack_cache_lock.  The deadlock happens in this state:

T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on cmdp->cntr
== 0)
T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on
stack_cache_lock)
more threads waiting on stack_cache_lock in pthread_create

For non-detached threads, start_thread waits for its own setxid handler to
finish before exiting, but for detached threads it goes on to deallocate the
stack right away.

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

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

* [Bug nptl/25942] Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread
  2020-05-07 15:22 [Bug nptl/25942] New: Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread schwab@linux-m68k.org
@ 2020-05-12 15:26 ` schwab@linux-m68k.org
  2020-07-31  9:07 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: schwab@linux-m68k.org @ 2020-05-12 15:26 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.32

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
Fixed in 2.32.

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

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

* [Bug nptl/25942] Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread
  2020-05-07 15:22 [Bug nptl/25942] New: Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread schwab@linux-m68k.org
  2020-05-12 15:26 ` [Bug nptl/25942] " schwab@linux-m68k.org
@ 2020-07-31  9:07 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2020-07-31  9:07 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
Commit:

commit 4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19
Author: Andreas Schwab <schwab@suse.de>
Date:   Thu May 7 15:50:09 2020 +0200

    nptl: wait for pending setxid request also in detached thread (bug 25942)

    There is a race between __nptl_setxid and exiting detached thread, which
    causes a deadlock on stack_cache_lock.  The deadlock happens in this
    state:

    T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on
cmdp->cntr == 0)
    T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on
stack_cache_lock)
    more threads waiting on stack_cache_lock in pthread_create

    For non-detached threads, start_thread waits for its own setxid handler to
    finish before exiting.  Do this for detached threads as well.

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

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

end of thread, other threads:[~2020-07-31  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:22 [Bug nptl/25942] New: Deadlock on stack_cache_lock between __nptl_setxid and exiting detached thread schwab@linux-m68k.org
2020-05-12 15:26 ` [Bug nptl/25942] " schwab@linux-m68k.org
2020-07-31  9:07 ` 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).