DragonFly BSD
 

Issue1072

Title Firefox/libthread_xu issue with pthread_attr_setschedparam
Priority Status chatting
Superseder Nosy List jgordeev
Assigned To Topics

Created on 2008-07-14.16:26:07 by jgordeev, last changed 2008-07-15.01:28:06 by dillon.

Messages
msg4949 (view) Author: dillon Date: 2008-07-15.01:28:02
:On Mon, 14 Jul 2008, Matthew Dillon wrote:
:
:>     Please try the following patch to libthread_xu and tell me if it
:>     fixes firefox:
:>
:>     fetch http://apollo.backplane.com/DFlyMisc/schedp01.patch
:
:Yes, it works for me.  Thanks to Jordan for tracking this down!

    Ok, I've committed it.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>
msg4948 (view) Author: wa1ter Date: 2008-07-15.00:28:02
On Mon, 14 Jul 2008, Matthew Dillon wrote:

Yes, it works for me.  Thanks to Jordan for tracking this down!
msg4947 (view) Author: corecode Date: 2008-07-14.18:18:01
for the record, this seems to be related to

http://bugs.dragonflybsd.org/issue622

cheers
   simon
msg4946 (view) Author: dillon Date: 2008-07-14.18:15:01
Please try the following patch to libthread_xu and tell me if it
    fixes firefox:

    fetch http://apollo.backplane.com/DFlyMisc/schedp01.patch

					-Matt
msg4945 (view) Author: dillon Date: 2008-07-14.18:08:01
:...
:> THR_MAX_PRIORITY(31), both defined in 
:> lib/libthread_xu/thread/thr_private.h. When a value in the range [-20; 
:> -1] is used, pthread_attr_setschedparam returns an error code of 
:> ENOTSUPP, which NSPR doesn't like. More precisely, when Firefox is 
:> compiled with the 'debug' pkgsrc option, an assert fails, abort() is 
:> called and a coredump written.
:
:I thought we had fixed that some time ago already?

     Nope, I'm looking at the code and it is definitely a problem.  There
     are a bunch of THR_ defines that are essentially not used by
     the library at all, except for that (broken) range check.

     The only thing that uses THR_MAX_PRIORITY is the m_ceiling
     attribute in the mutex attribute structure, which we don't use
     at all (and I think it operates in a private scheduling domain
     anyway).

     I'll have a patch for people w/ the firefox setup to try in a moment.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>
msg4944 (view) Author: dillon Date: 2008-07-14.18:04:00
:I have a Firefox problem caused by DragonFly and/or libthread_xu.
:sched_get_priority_min(SCHED_OTHER) and 
:sched_get_priority_max(SCHED_OTHER) return values PRIO_MIN (-20) and 
:PRIO_MAX(20), both defined in sys/sys/resource.h.
:When pthread_attr_setschedparam is called to set scheduling priority for 
:scheduling policy SCHED_OTHER, the priority value is checked if it is 
:within range by comparing it to THR_MIN_PRIORITY(0) and 
:THR_MAX_PRIORITY(31), both defined in 
:lib/libthread_xu/thread/thr_private.h. When a value in the range [-20; 
:-1] is used, pthread_attr_setschedparam returns an error code of 
:ENOTSUPP, which NSPR doesn't like. More precisely, when Firefox is 
:compiled with the 'debug' pkgsrc option, an assert fails, abort() is 
:called and a coredump written.

    Nice catch.  I'll clean up the priority handling code right now.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>
msg4943 (view) Author: corecode Date: 2008-07-14.17:53:00
I thought we had fixed that some time ago already?
msg4940 (view) Author: jgordeev Date: 2008-07-14.16:26:02
I have a Firefox problem caused by DragonFly and/or libthread_xu.
sched_get_priority_min(SCHED_OTHER) and 
sched_get_priority_max(SCHED_OTHER) return values PRIO_MIN (-20) and 
PRIO_MAX(20), both defined in sys/sys/resource.h.
When pthread_attr_setschedparam is called to set scheduling priority for 
scheduling policy SCHED_OTHER, the priority value is checked if it is 
within range by comparing it to THR_MIN_PRIORITY(0) and 
THR_MAX_PRIORITY(31), both defined in 
lib/libthread_xu/thread/thr_private.h. When a value in the range [-20; 
-1] is used, pthread_attr_setschedparam returns an error code of 
ENOTSUPP, which NSPR doesn't like. More precisely, when Firefox is 
compiled with the 'debug' pkgsrc option, an assert fails, abort() is 
called and a coredump written.
History
Date User Action Args
2008-07-15 01:28:06dillonsetmessages: + msg4949
2008-07-15 00:28:05wa1tersetmessages: + msg4948
2008-07-14 18:18:02corecodesetmessages: + msg4947
2008-07-14 18:15:06dillonsetmessages: + msg4946
2008-07-14 18:08:02dillonsetmessages: + msg4945
2008-07-14 18:04:01dillonsetmessages: + msg4944
2008-07-14 17:53:00corecodesetstatus: unread -> chatting
messages: + msg4943
2008-07-14 16:26:07jgordeevcreate