https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082008-07-15T00:53:00ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49432008-07-15T00:53:00Zcorecode
<ul></ul><p>I thought we had fixed that some time ago already?</p> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49442008-07-15T01:04:00Zdillon
<ul></ul><p>:I have a Firefox problem caused by DragonFly and/or libthread_xu.<br />:sched_get_priority_min(SCHED_OTHER) and <br />:sched_get_priority_max(SCHED_OTHER) return values PRIO_MIN (-20) and <br />:PRIO_MAX(20), both defined in sys/sys/resource.h.<br />:When pthread_attr_setschedparam is called to set scheduling priority for <br />:scheduling policy SCHED_OTHER, the priority value is checked if it is <br />:within range by comparing it to THR_MIN_PRIORITY(0) and <br />:THR_MAX_PRIORITY(31), both defined in <br />:lib/libthread_xu/thread/thr_private.h. When a value in the range [-20; <br />:-1] is used, pthread_attr_setschedparam returns an error code of <br />:ENOTSUPP, which NSPR doesn't like. More precisely, when Firefox is <br />:compiled with the 'debug' pkgsrc option, an assert fails, abort() is <br />:called and a coredump written.</p>
<pre><code>Nice catch. I'll clean up the priority handling code right now.</code></pre>
<pre><code>-Matt<br /> Matthew Dillon <br /> &lt;<a class="email" href="mailto:dillon@backplane.com">dillon@backplane.com</a>&gt;</code></pre> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49452008-07-15T01:08:01Zdillon
<ul></ul><p>:...<br />:> THR_MAX_PRIORITY(31), both defined in <br />:> lib/libthread_xu/thread/thr_private.h. When a value in the range [-20; <br />:> -1] is used, pthread_attr_setschedparam returns an error code of <br />:> ENOTSUPP, which NSPR doesn't like. More precisely, when Firefox is <br />:> compiled with the 'debug' pkgsrc option, an assert fails, abort() is <br />:> called and a coredump written.<br />:<br />:I thought we had fixed that some time ago already?</p>
<pre><code>Nope, I'm looking at the code and it is definitely a problem. There<br /> are a bunch of THR_ defines that are essentially not used by<br /> the library at all, except for that (broken) range check.</code></pre>
<pre><code>The only thing that uses THR_MAX_PRIORITY is the m_ceiling<br /> attribute in the mutex attribute structure, which we don't use<br /> at all (and I think it operates in a private scheduling domain<br /> anyway).</code></pre>
<pre><code>I'll have a patch for people w/ the firefox setup to try in a moment.</code></pre>
<pre><code>-Matt<br /> Matthew Dillon <br /> &lt;<a class="email" href="mailto:dillon@backplane.com">dillon@backplane.com</a>&gt;</code></pre> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49462008-07-15T01:15:01Zdillon
<ul></ul><p>Please try the following patch to libthread_xu and tell me if it<br /> fixes firefox:</p>
<pre><code>fetch <a class="external" href="http://apollo.backplane.com/DFlyMisc/schedp01.patch">http://apollo.backplane.com/DFlyMisc/schedp01.patch</a></code></pre>
<pre><code>-Matt</code></pre> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49472008-07-15T01:18:01Zcorecode
<ul></ul><p>for the record, this seems to be related to</p>
<p><a class="external" href="http://bugs.dragonflybsd.org/issue622">http://bugs.dragonflybsd.org/issue622</a></p>
<p>cheers<br /> simon</p> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49482008-07-15T07:28:02Zwa1ter
<ul></ul><p>On Mon, 14 Jul 2008, Matthew Dillon wrote:</p>
<p>Yes, it works for me. Thanks to Jordan for tracking this down!</p> DragonFlyBSD - Bug #1072: Firefox/libthread_xu issue with pthread_attr_setschedparamhttps://bugs.dragonflybsd.org/issues/1072?journal_id=49492008-07-15T08:28:02Zdillon
<ul></ul><p>:On Mon, 14 Jul 2008, Matthew Dillon wrote:<br />:<br />:> Please try the following patch to libthread_xu and tell me if it<br />:> fixes firefox:<br />:><br />:> fetch <a class="external" href="http://apollo.backplane.com/DFlyMisc/schedp01.patch">http://apollo.backplane.com/DFlyMisc/schedp01.patch</a><br />:<br />:Yes, it works for me. Thanks to Jordan for tracking this down!</p>
<pre><code>Ok, I've committed it.</code></pre>
<pre><code>-Matt<br /> Matthew Dillon <br /> &lt;<a class="email" href="mailto:dillon@backplane.com">dillon@backplane.com</a>&gt;</code></pre>