Last Comment Bug 634609 - Fix GetNativeStackBaseImpl() on OpenBSD
: Fix GetNativeStackBaseImpl() on OpenBSD
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: Other OpenBSD
: -- normal (vote)
: mozilla6
Assigned To: Landry Breuil (:gaston)
:
Mentors:
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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
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 | 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 | Review

Description 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 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 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 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 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 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 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-03-22 17:31:00 PDT
http://hg.mozilla.org/tracemonkey/rev/489cdb307e41
Comment 7 Chris Leary [:cdleary] (not checking bugmail) 2011-03-31 14:49:15 PDT
http://hg.mozilla.org/mozilla-central/rev/489cdb307e41
Comment 8 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 Landry Breuil (:gaston) 2011-04-20 00:31:36 PDT
And reopening.
Comment 10 Mounir Lamouri (:mounir) 2011-04-20 13:30:09 PDT
Pushed to cedar.
Comment 11 Mounir Lamouri (:mounir) 2011-04-21 01:15:32 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/6588e8a0c8c5

(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.