Closed Bug 1432381 Opened 2 years ago Closed 2 years ago

Sandbox MinGW Compilation errors: error: narrowing conversion

Categories

(Core :: Security: Process Sandboxing, defect, P1)

All
Windows
defect

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: tjr, Assigned: bobowen)

References

Details

(Whiteboard: [tor][mingw-upstream-pending][sb+])

Attachments

(1 file, 1 obsolete file)

0:01.74 /home/tom/Documents/moz/mingw-work/sandbox/security/sandbox/chromium/sandbox/win/src/sidestep/ia32_opcode_map.cpp:283:1: error: narrowing conversion of ‘2148073472u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
 0:01.74  };
 0:01.74  ^
 0:01.77 /home/tom/Documents/moz/mingw-work/sandbox/security/sandbox/chromium/sandbox/win/src/sidestep/ia32_opcode_map.cpp:887:1: error: narrowing conversion of ‘2148073472u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
 0:01.77  };
Blocks: 1432505
(In reply to Tom Ritter [:tjr] from comment #1)
> Created attachment 8944746 [details]
> Bug 1432381 Promote ints to unsigned ints, because they are assigned an
> unsigned int value 2148073472u

I guess this might be because gcc is using a different underlying type for the enum.

Anyway, I think these sidestep resolvers are probably a legacy from before Google bought the sandbox code. Apart from being constructed, they are not actually used as far as I can tell and it seems unlikely they will be given they are not supported on x64.

So here's a patch that replaces them with stubs, which should allow them to be created, but crash if they are used.

This should get rid of these errors and the ones for bug 1432505 (and hopefully not introduce new ones).
Attachment #8945057 - Flags: feedback?(tom)
Comment on attachment 8945057 [details] [diff] [review]
Replace sidestep resolvers with stubs as they are not actually used.

Try run went fine, looks good to me!

https://treeherder.mozilla.org/#/jobs?repo=try&revision=3fb9a147373ce56e1ad4e39edd98faacbb4d714b
Attachment #8945057 - Flags: feedback?(tom) → feedback+
Attachment #8944746 - Attachment is obsolete: true
Attachment #8944746 - Flags: review?(bobowencode)
Attachment #8945057 - Flags: review?(aklotz)
Assignee: tom → bobowencode
Status: NEW → ASSIGNED
OS: Unspecified → Windows
Priority: -- → P1
Hardware: Unspecified → All
Whiteboard: [tor][mingw-upstream-pending] → [tor][mingw-upstream-pending][sb+]
Attachment #8945057 - Flags: review?(aklotz) → review+
Keywords: checkin-needed
Pushed by bobowencode@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8646839dba1f
Replace sidestep resolvers with stubs as they are not actually used. r=aklotz
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8646839dba1f
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.