Opened 13 months ago

Closed 6 months ago

#24197 closed task (fixed)

Building Windows 64 firefox with the sandbox enabled fails

Reported by: boklm Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-rbm, GeorgKoppen201805, TorBrowserTeam201806
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When trying to build Tor Browser for Windows 64 with the firefox sandbox enabled, firefox fails to build with the following error:

/var/tmp/dist/mingw-w64/helpers/x86_64-w64-mingw32-g++ -std=gnu++11 -mwindows -o file_path.o -c   -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -DNS_NO_XPCOM -D_CRT_RAND_S -DCHROMIUM_SANDBOX_BUILD -I/var/tmp/build/firefox-a99a3504e931/security/sandbox -I/var/tmp/build/firefox-a99a3504e931/obj-mingw/security/sandbox -I/var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium-shim -I/var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium -I/var/tmp/build/firefox-a99a3504e931/nsprpub -I/var/tmp/build/firefox-a99a3504e931/obj-mingw/dist/include  -I/var/tmp/build/firefox-a99a3504e931/obj-mingw/dist/include/nspr -I/var/tmp/build/firefox-a99a3504e931/obj-mingw/dist/include/nss         -DMOZILLA_CLIENT -include /var/tmp/build/firefox-a99a3504e931/obj-mingw/mozilla-config.h -MD -MP -MF .deps/file_path.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-format -fno-lifetime-dse -fno-exceptions -fno-strict-aliasing -mms-bitfields -fno-rtti -fno-exceptions -fno-math-errno -pipe  -g -O -fomit-frame-pointer    /var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium-shim/base/files/file_path.cpp
In file included from /var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium/base/files/file_path.h:113:0,
                 from /var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium-shim/base/files/file_path.cpp:9:
/var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium/base/containers/hash_tables.h: In member function 'std::size_t base_hash::hash<T*>::operator()(T*) const':
/var/tmp/build/firefox-a99a3504e931/security/sandbox/chromium/base/containers/hash_tables.h:79:43: error: no match for call to '(__gnu_cxx::hash<long long unsigned int>)
 (uintptr_t)'
         reinterpret_cast<uintptr_t>(value));
                                           ^
/var/tmp/build/firefox-a99a3504e931/nsprpub/pr/src/io/prpolevt.c: In function 'PR_NewPollableEvent':
/var/tmp/build/firefox-a99a3504e931/nsprpub/pr/src/io/prpolevt.c:121:14: warning: variable 'rv' set but not used [-Wunused-but-set-variable]
     PRStatus rv;
              ^
make[5]: *** [file_path.o] Error 1
make[5]: Leaving directory `/var/tmp/build/firefox-a99a3504e931/obj-mingw/security/sandbox'
make[4]: *** [security/sandbox/target] Error 2

Child Tickets

Attachments (2)

bug24197.patch (19.7 KB) - added by boklm 12 months ago.
0001-Bug-24197-fix-uppercase-lowercase-issue-in-Wow64.h-i.patch (815 bytes) - added by boklm 12 months ago.

Download all attachments as: .zip

Change History (19)

Changed 12 months ago by boklm

Attachment: bug24197.patch added

comment:1 Changed 12 months ago by boklm

It looks like this patch from chromium is fixing the build issue we have in security/sandbox/chromium/base/containers/hash_tables.h:
https://chromium.googlesource.com/chromium/src/+/411d3f7a3a18335713a46d9022ce25e018a19e47%5E%21/

I attached it as bug24197.patch after removing from the patch the changes to the files that are not included in firefox.

However, we now have a different build error:

/var/tmp/dist/mingw-w64/helpers/x86_64-w64-mingw32-g++ -std=gnu++11 -mwindows -o Wow64_64.o -c   -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -DNS_NO_XPCOM -D_CRT_RAND_S 
-DCHROMIUM_SANDBOX_BUILD -I/var/tmp/build/firefox-dca73c105071/security/sandbox -I/var/tmp/build/firefox-dca73c105071/obj-mingw/security/sandbox -I/var/tmp/build/firefox
-dca73c105071/security/sandbox/chromium-shim -I/var/tmp/build/firefox-dca73c105071/security/sandbox/chromium -I/var/tmp/build/firefox-dca73c105071/nsprpub -I/var/tmp/bui
ld/firefox-dca73c105071/obj-mingw/dist/include  -I/var/tmp/build/firefox-dca73c105071/obj-mingw/dist/include/nspr -I/var/tmp/build/firefox-dca73c105071/obj-mingw/dist/in
clude/nss         -DMOZILLA_CLIENT -include /var/tmp/build/firefox-dca73c105071/obj-mingw/mozilla-config.h -MD -MP -MF .deps/Wow64_64.o.pp  -Wall -Wc++11-compat -Wempty-
body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-
error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-format -fno-lifetime-dse -fno-exceptions -fno-strict-aliasing -mms-bitfields -f
no-rtti -fno-exceptions -fno-math-errno -pipe  -g -O -fomit-frame-pointer    /var/tmp/build/firefox-dca73c105071/security/sandbox/chromium/sandbox/win/src/Wow64_64.cc
/var/tmp/build/firefox-dca73c105071/security/sandbox/chromium/sandbox/win/src/Wow64_64.cc:7:35: fatal error: sandbox/win/src/wow64.h: No such file or directory
compilation terminated.
make[5]: *** [Wow64_64.o] Error 1

comment:2 Changed 12 months ago by gk

I guess that's one of the usual uppercase/lowercase issues. We have e.g.

-#include "sandbox/win/src/wow64.h"
+#include "sandbox/win/src/Wow64.h"

in our already included sandbox patch in interception.cc.

comment:3 in reply to:  2 Changed 12 months ago by boklm

Replying to gk:

I guess that's one of the usual uppercase/lowercase issues. We have e.g.

-#include "sandbox/win/src/wow64.h"
+#include "sandbox/win/src/Wow64.h"

in our already included sandbox patch in interception.cc.

Thanks. After changing wow64.h to Wow64.h I was able to finish a build.

comment:4 Changed 11 months ago by boklm

Those patches are fixing the build, however it seems it is not enough to get the sandbox working on Windows 64. After starting the browser the about:page tab stays blank. When trying to load a web page in a new tab, the tab also stays blank. After changing security.sandbox.content.level from 1 to 0 in about:config and restarting, the browser is working correctly.

To try to debug this I tried setting security.sandbox.windows.log and security.sandbox.logging.enabled to true, but didn't see anything related to sandbox in the browser console.

comment:5 in reply to:  4 Changed 11 months ago by gk

Keywords: TorBrowserTeam201801 GeorgKoppen201801 added

Replying to boklm:

Those patches are fixing the build, however it seems it is not enough to get the sandbox working on Windows 64. After starting the browser the about:page tab stays blank. When trying to load a web page in a new tab, the tab also stays blank. After changing security.sandbox.content.level from 1 to 0 in about:config and restarting, the browser is working correctly.

To try to debug this I tried setting security.sandbox.windows.log and security.sandbox.logging.enabled to true, but didn't see anything related to sandbox in the browser console.

Hm. Maybe I did not fix all the issues in #16010 then? Let me look closer at that...

comment:6 Changed 11 months ago by gk

The two attached patches look good. I put them onto our new alpha branch, tor-browser-52.5.2esr-8.0-1 as commits bc76eaae7a83e73d7e5ba5e759829afa9df7bf5b and 15939efc6cbd64ca1f20e826e2ab0329bc42a659.

comment:7 Changed 10 months ago by gk

Keywords: GeorgKoppen201802 added; GeorgKoppen201801 removed

Moving my tickets to Feb.

comment:8 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802 added; TorBrowserTeam201801 removed

Moving tickets to Feb

comment:9 Changed 9 months ago by gk

Keywords: GeorgKoppen201803 added; GeorgKoppen201802 removed

Moving my tickets to March.

comment:10 Changed 9 months ago by gk

Keywords: TorBrowserTeam201803 added; TorBrowserTeam201802 removed

Adding to our March plate.

comment:11 Changed 8 months ago by gk

Keywords: GeorgKoppen201804 added; GeorgKoppen201803 removed

Moving my tickets to April 2018

comment:12 Changed 8 months ago by gk

Keywords: TorBrowserTeam201804 added; TorBrowserTeam201803 removed

Moving our tickets to April.

comment:13 Changed 7 months ago by gk

Keywords: TorBrowserTeam201805 added; TorBrowserTeam201804 removed

Moving remaining tickets to May.

comment:14 Changed 7 months ago by gk

Keywords: GeorgKoppen201805 added; GeorgKoppen201804 removed

Moving my tickets.

comment:16 Changed 6 months ago by gk

Keywords: TorBrowserTeam201806 added; TorBrowserTeam201805 removed

Moving our tickets to June 2018

comment:17 in reply to:  15 Changed 6 months ago by gk

Resolution: fixed
Status: newclosed

Replying to tom:

Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1461421

We cherry-picked the proposed fix (commit a64a7c2de648ad87f392e407a92589515a72b0ef on `tor-browser-60.0.1esr-8.0-1) and are good for now. We'll backport later on the fix that actually landed.

Note: See TracTickets for help on using tickets.