Closed
Bug 1431803
Opened 8 years ago
Closed 8 years ago
Sandbox MinGW Compilation errors: __try / __except
Categories
(Core :: Security: Process Sandboxing, enhancement, P1)
Core
Security: Process Sandboxing
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: tjr, Assigned: tjr)
References
Details
(Whiteboard: [tor][mingw-upstream-pending][sb+])
Attachments
(2 files)
MinGW doesn't support __try / __except.
Tor has successfully shipped Tor Browser replacing __try with if(true) and commenting out all __except blocks.
Can I take this approach? Would you accept patches to this effect bob? (Step after that will be trying to get it into chromium...)
Flags: needinfo?(bobowencode)
Comment 1•8 years ago
|
||
I thought the patches I saw were using __try1 and removing blocks that were needed only for debug or ignored exceptions that possibly shouldn't be.
(I'm guessing this is something they might not take upstream, but we could possibly do it with a force included header.)
Did that approach not work out?
Flags: needinfo?(bobowencode) → needinfo?(tom)
Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Bob Owen (:bobowen) from comment #1)
> I thought the patches I saw were using __try1 and removing blocks that were
> needed only for debug or ignored exceptions that possibly shouldn't be.
> Did that approach not work out?
That was a guesswork approach. It might work, but we haven't tested it. What I'm doing is trying to port the patches Tor Browser has tested (and is running with) into -central keeping the other builds working. (Their patch is https://gitweb.torproject.org/tor-browser.git/patch/?id=258b15f9 FWIW) They didn't use the __try1 approach.
Right now, our MinGW build of -central isn't actually running, we're working on tracking that down Bug 1411401
> (I'm guessing this is something they might not take upstream, but we could
> possibly do it with a force included header.)
Yea, this part will probably involve some patches we have to carry, but I'll try to minimize it.
Flags: needinfo?(tom)
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(bobowencode)
Comment 3•8 years ago
|
||
OK, I see.
So if we add a force included file like [1], but just for MinGW, with those two #defines I guess that should work.
Probably ought to get a build peer review on that as well.
[1] https://searchfox.org/mozilla-central/source/mozilla-config.h.in#59
Flags: needinfo?(bobowencode)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
![]() |
||
Updated•8 years ago
|
Priority: -- → P1
Whiteboard: [tor][mingw-upstream-pending] → [tor][mingw-upstream-pending][sb+]
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 10•8 years ago
|
||
Okay bob, I reviewed the cases more carefully and I think this is ready for review now.
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8944751 [details]
Bug 1431803 Disable a specific __try block on MinGW
https://reviewboard.mozilla.org/r/214910/#review221344
Patch file as well please.
Attachment #8944751 -
Flags: review?(bobowencode) → review+
Comment 12•8 years ago
|
||
mozreview-review |
Comment on attachment 8944748 [details]
Bug 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code
https://reviewboard.mozilla.org/r/214908/#review221342
We should probably have a build peer review as well because of mozilla-config.h.in changes.
Maybe glandium.
::: security/sandbox/chromium-shim/base/win/mingw.h:1
(Diff revision 4)
> +#ifdef __MINGW32__
emacs and vim lines, license header and #if header guard please.
Also, a comment explaining how this is included and how it can potentially be used for other MinGW build issues.
Attachment #8944748 -
Flags: review?(bobowencode)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 15•8 years ago
|
||
mozreview-review |
Comment on attachment 8944748 [details]
Bug 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code
https://reviewboard.mozilla.org/r/214908/#review221384
Thanks.
Attachment #8944748 -
Flags: review?(bobowencode) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8944748 -
Flags: review?(mh+mozilla)
Comment 16•8 years ago
|
||
mozreview-review |
Comment on attachment 8944748 [details]
Bug 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code
https://reviewboard.mozilla.org/r/214908/#review222260
A cursory grep __try says there are some outside security/sandbox. Are all of those in msvc-only sections?
::: security/sandbox/chromium-shim/base/win/mingw.h:26
(Diff revision 5)
> +#define __try if(true)
> +#define __except(x) else
Why not simply set that in mozilla-include.h.in?
Attachment #8944748 -
Flags: review?(mh+mozilla)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 19•8 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #16)
> Comment on attachment 8944748 [details]
> Bug 1431803 Force-include a header to turn __try into if(true) and __except
> into else
>
> https://reviewboard.mozilla.org/r/214908/#review222260
>
> A cursory grep __try says there are some outside security/sandbox. Are all
> of those in msvc-only sections?
Yes (otherwise the MinGW build wouldn't build.)
> ::: security/sandbox/chromium-shim/base/win/mingw.h:26
> (Diff revision 5)
> > +#define __try if(true)
> > +#define __except(x) else
>
> Why not simply set that in mozilla-include.h.in?
Moved!
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(mh+mozilla)
Comment 20•8 years ago
|
||
mozreview-review |
Comment on attachment 8944748 [details]
Bug 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code
https://reviewboard.mozilla.org/r/214908/#review222628
::: commit-message-4c8d4:1
(Diff revision 6)
> +Bug 1431803 Force-include a header to turn __try into if(true) and __except into else r?bobowen
You should adjust the commit message.
Attachment #8944748 -
Flags: review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 23•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c0de1027fbda
Turn __try into if(true) and __except into else in the chromium sandbox code r=bobowen,glandium
https://hg.mozilla.org/integration/autoland/rev/5506a531ce36
Disable a specific __try block on MinGW r=bobowen
Keywords: checkin-needed
Comment 24•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c0de1027fbda
https://hg.mozilla.org/mozilla-central/rev/5506a531ce36
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Updated•8 years ago
|
Flags: needinfo?(mh+mozilla)
You need to log in
before you can comment on or make changes to this bug.
Description
•