public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
@ 2009-10-22 13:41 jdluhos at suse dot cz
  2009-10-22 13:52 ` [Bug nptl/10828] " drepper at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: jdluhos at suse dot cz @ 2009-10-22 13:41 UTC (permalink / raw)
  To: glibc-bugs

(This problem was found by analyzing a failure of LSB distribution compliance
test, lsb-runtime, v. 4.0.2.)

A relatively new change in $GITROOT/glibc/nptl/pthread_attr_setschedparam.c
(2009-04-23 according to git) adds a check to pthread_attr_setschedparam() call
whether the priority being set is compatible with the scheduling policy already
set in the structure; if the priority is not in the prescribed range, it fails,
generating the EINVAL error.

This check, although well intended, has a side effect that can break existing
code (at least the LSB tests): it makes the process of initializing a
pthread_attr structure order-dependent on Linux.

As Linux does not use the numeric priority for SCHED_OTHER, which is the
default, and sched_get_priority_min() and sched_priority_max() return 0. Therefore:

If a programmer calls pthread_attr_init(), then pthread_attr_setschedpolicy() to
set SCHED_RR or SCHED_FIFO, and then pthread_attr_setschedparam(), it works. But
if the other way around (priority first, then scheduling policy), it fails for
"no apparent reason".

-- 
           Summary: New check added in pthread_attr_setschedparam() causes
                    hard-to-explain behavior
           Product: glibc
           Version: 2.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: jdluhos at suse dot cz
                CC: glibc-bugs at sources dot redhat dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug nptl/10828] New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
  2009-10-22 13:41 [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior jdluhos at suse dot cz
@ 2009-10-22 13:52 ` drepper at redhat dot com
  2009-10-22 14:17 ` jdluhos at suse dot cz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: drepper at redhat dot com @ 2009-10-22 13:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2009-10-22 13:52 -------
File a bug with the LSB, as usual their code is broken.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug nptl/10828] New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
  2009-10-22 13:41 [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior jdluhos at suse dot cz
  2009-10-22 13:52 ` [Bug nptl/10828] " drepper at redhat dot com
@ 2009-10-22 14:17 ` jdluhos at suse dot cz
  2009-10-26 11:43 ` jdluhos at suse dot cz
  2010-06-01  3:09 ` pasky at suse dot cz
  3 siblings, 0 replies; 6+ messages in thread
From: jdluhos at suse dot cz @ 2009-10-22 14:17 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jdluhos at suse dot cz  2009-10-22 14:16 -------
I agree, LSB tests are often broken.

But in this specific case, I'd say the programmer did nothing wrong. POSIX does
not specify that the pthread_attr structure should be filled in a specific
order, and the EINVAL error in the case of wrong order is hard to explain (the
incorrect priority is not an error *yet*; it would become an error in the moment
of thread creation, but before this, the values in the structure can still be
changed).

Could you please consider this problem once more? If you still have the same
opinion, I will open the bug with LSB - but I'm afraid the same problem can
occur in another codes, as well.

Thank you for your patience.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug nptl/10828] New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
  2009-10-22 13:41 [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior jdluhos at suse dot cz
  2009-10-22 13:52 ` [Bug nptl/10828] " drepper at redhat dot com
  2009-10-22 14:17 ` jdluhos at suse dot cz
@ 2009-10-26 11:43 ` jdluhos at suse dot cz
  2010-06-01  3:09 ` pasky at suse dot cz
  3 siblings, 0 replies; 6+ messages in thread
From: jdluhos at suse dot cz @ 2009-10-26 11:43 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jdluhos at suse dot cz  2009-10-26 11:43 -------
Problem also reported in LSB bugzilla:

http://bugs.linuxbase.org/show_bug.cgi?id=2784
(which seems equivalent to http://bugs.linuxbase.org/show_bug.cgi?id=2663)


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug nptl/10828] New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
  2009-10-22 13:41 [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior jdluhos at suse dot cz
                   ` (2 preceding siblings ...)
  2009-10-26 11:43 ` jdluhos at suse dot cz
@ 2010-06-01  3:09 ` pasky at suse dot cz
  3 siblings, 0 replies; 6+ messages in thread
From: pasky at suse dot cz @ 2010-06-01  3:09 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From pasky at suse dot cz  2010-06-01 03:08 -------
we actually already track this

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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |DUPLICATE


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug nptl/10828] New check added in pthread_attr_setschedparam() causes hard-to-explain behavior
       [not found] <bug-10828-131@http.sourceware.org/bugzilla/>
@ 2014-07-01  5:35 ` fweimer at redhat dot com
  0 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2014-07-01  5:35 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
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:[~2014-07-01  5:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22 13:41 [Bug nptl/10828] New: New check added in pthread_attr_setschedparam() causes hard-to-explain behavior jdluhos at suse dot cz
2009-10-22 13:52 ` [Bug nptl/10828] " drepper at redhat dot com
2009-10-22 14:17 ` jdluhos at suse dot cz
2009-10-26 11:43 ` jdluhos at suse dot cz
2010-06-01  3:09 ` pasky at suse dot cz
     [not found] <bug-10828-131@http.sourceware.org/bugzilla/>
2014-07-01  5:35 ` 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).