Last Comment Bug 634609 - Fix GetNativeStackBaseImpl() on OpenBSD
: Fix GetNativeStackBaseImpl() on OpenBSD
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: Other OpenBSD
-- normal (vote)
: mozilla6
Assigned To: Landry Breuil (:gaston)
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: openbsdmeta
  Show dependency treegraph
Reported: 2011-02-16 08:30 PST by Landry Breuil (:gaston)
Modified: 2011-04-21 01:15 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

use pthread_stackseg_np() on OpenBSD (957 bytes, patch)
2011-02-16 08:34 PST, Landry Breuil (:gaston)
gal: review+
joe: approval2.0-
Details | Diff | Splinter Review
Include pthread_np.h on OpenBSD too for pthread_stackseg_np() (653 bytes, patch)
2011-04-20 00:31 PDT, Landry Breuil (:gaston)
gal: review+
Details | Diff | Splinter Review

Description User image Landry Breuil (:gaston) 2011-02-16 08:30:32 PST
User-Agent:       Midori/0.3 (X11; OpenBSD; U; fr-fr) WebKit/531.2+
Build Identifier: 

As of now, js fails to build on OpenBSD because either pthread_attr_get_np() or pthread_getattr_np() don't exist.

pthread_attr_init() + pthread_attr_getstack() won't work on OpenBSD, so we have to use pthread_stackseg_np() instead.

Reproducible: Always
Comment 1 User image Landry Breuil (:gaston) 2011-02-16 08:34:02 PST
Created attachment 512815 [details] [diff] [review]
use pthread_stackseg_np() on OpenBSD

First proposition for a patch, minimizing the diff.
Ideally, the codepath for OpenBSD wouldn't need pthread_attr_t/pthread_attr_init/pthread_attr_destroy, so maybe it should be inside its own #ifdef block like macos code.
We might still need the last part of the function changing what's returned depending on JS_STACK_GROWTH_DIRECTION (though we don't build mozilla on hppa yet)
Comment 2 User image Andreas Gal :gal 2011-02-16 09:25:58 PST
Comment on attachment 512815 [details] [diff] [review]
use pthread_stackseg_np() on OpenBSD

Stealing. NPOTB, so no risk but even than approval might not come until after FF4 branched.
Comment 3 User image Landry Breuil (:gaston) 2011-02-24 01:06:14 PST
What's the procedure to get that commited now that there's r+ and a2.0+ ?
Should i do another patch putting the OpenBSD code inside its own #ifdef block for the sake of readability ?
Comment 4 User image Andreas Gal :gal 2011-02-24 01:18:29 PST
Just land it on the TM tree if you have commit access, or find someone who has.
Comment 5 User image Joe Drew (not getting mail) 2011-03-03 10:13:08 PST
Comment on attachment 512815 [details] [diff] [review]
use pthread_stackseg_np() on OpenBSD

Sorry, too late for 2.0.
Comment 6 User image Boris Zbarsky [:bz] (still a bit busy) 2011-03-22 17:31:00 PDT
Comment 7 User image Chris Leary [:cdleary] (not checking bugmail) 2011-03-31 14:49:15 PDT
Comment 8 User image Landry Breuil (:gaston) 2011-04-20 00:31:06 PDT
Created attachment 527210 [details] [diff] [review]
Include pthread_np.h on OpenBSD too for pthread_stackseg_np()

Duh!. pthread_np.h also needs to be included on OpenBSD for pthread_stackseg_np() to be defined... sorry i missed that one.
Comment 9 User image Landry Breuil (:gaston) 2011-04-20 00:31:36 PDT
And reopening.
Comment 10 User image Mounir Lamouri (:mounir) 2011-04-20 13:30:09 PDT
Pushed to cedar.
Comment 11 User image Mounir Lamouri (:mounir) 2011-04-21 01:15:32 PDT

(oups, I didn't meant to mark the bug as fixed before...)

Note You need to log in before you can comment on or make changes to this bug.