public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/14830] New: Race conditions with signals and thread priority scheduling
@ 2012-11-11 20:50 bugdal at aerifal dot cx
  2014-01-10 20:48 ` [Bug nptl/14830] " carlos at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugdal at aerifal dot cx @ 2012-11-11 20:50 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14830

             Bug #: 14830
           Summary: Race conditions with signals and thread priority
                    scheduling
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bugdal@aerifal.cx
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


NPTL implements thread priority scheduling for new threads by creating the new
thread but blocking its forward progress until pthread_create in the parent can
set the new thread's scheduling options. If this fails (e.g. due to EPERM),
pthread_create is required to fail. To achieve this result, NPTL has
pthread_create send a cancellation request to the new thread.

Unfortunately, NPTL fails to block signals during thread creation, so it's
possible that a signal handler is already running (at the wrong priority) in
the newly created thread by the time the failure to set the priority had been
detected. The cancellation request will then cause any cancellation-point
function called from the signal handler to act upon cancellation, possibly with
disastrous results if the application was not written to use cancellation.

I believe the simplest solution to this issue is to block all signals before
clone() is called. In the parent, signals can be unblocked immediately as soon
as clone returns. In the new thread, signals cannot be unblocked until it's
determined that the thread will be allowed to run.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug nptl/14830] Race conditions with signals and thread priority scheduling
  2012-11-11 20:50 [Bug nptl/14830] New: Race conditions with signals and thread priority scheduling bugdal at aerifal dot cx
@ 2014-01-10 20:48 ` carlos at redhat dot com
  2014-06-14 11:09 ` fweimer at redhat dot com
  2021-05-27  0:32 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: carlos at redhat dot com @ 2014-01-10 20:48 UTC (permalink / raw)
  To: glibc-bugs

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

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com
   Target Milestone|---                         |2.20

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


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

* [Bug nptl/14830] Race conditions with signals and thread priority scheduling
  2012-11-11 20:50 [Bug nptl/14830] New: Race conditions with signals and thread priority scheduling bugdal at aerifal dot cx
  2014-01-10 20:48 ` [Bug nptl/14830] " carlos at redhat dot com
@ 2014-06-14 11:09 ` fweimer at redhat dot com
  2021-05-27  0:32 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-14 11:09 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

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

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


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

* [Bug nptl/14830] Race conditions with signals and thread priority scheduling
  2012-11-11 20:50 [Bug nptl/14830] New: Race conditions with signals and thread priority scheduling bugdal at aerifal dot cx
  2014-01-10 20:48 ` [Bug nptl/14830] " carlos at redhat dot com
  2014-06-14 11:09 ` fweimer at redhat dot com
@ 2021-05-27  0:32 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2021-05-27  0:32 UTC (permalink / raw)
  To: glibc-bugs

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

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
It was fixed on 2.32 with the strategy of blocking and unblocking signal on
pthread_create.

*** This bug has been marked as a duplicate of bug 25098 ***

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

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

end of thread, other threads:[~2021-05-27  0:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-11 20:50 [Bug nptl/14830] New: Race conditions with signals and thread priority scheduling bugdal at aerifal dot cx
2014-01-10 20:48 ` [Bug nptl/14830] " carlos at redhat dot com
2014-06-14 11:09 ` fweimer at redhat dot com
2021-05-27  0:32 ` adhemerval.zanella at linaro dot 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).