Thursday, July 04, 2024

Re: Tor Browser on -current dies with SIGILL

Hi,

I found the following piece of diff while I was reading through
the diff between 13.0.16 and 13.5.

$ git diff tor-browser-115.12.0esr-13.0-1-build1..tor-browser-115.12.0esr-13.5-1-build3
from https://gitlab.torproject.org/tpo/applications/tor-browser.git:
diff --git a/mozconfig-linux-x86_64 b/mozconfig-linux-x86_64
index 06cf6e75b14f..7d96d5aaa734 100644
--- a/mozconfig-linux-x86_64
+++ b/mozconfig-linux-x86_64
@@ -1,9 +1,13 @@
. $topsrcdir/browser/config/mozconfigs/tor-browser

-ac_add_options --enable-default-toolkit=cairo-gtk3
+# Moz switched to lld for all Linux targets in Bug 1839739.
+ac_add_options --enable-linker=lld

ac_add_options --disable-strip
ac_add_options --disable-install-strip


In the diff below I reverted that part. Warning: I have not
build-tested it myself yet, nor have I looked into what it is supposed
to do exactly (will do that later).

Is it possible for you to test diffs? If so, can you try the diff below
and report back?

Caspar



Index: patches/patch-mozconfig-linux-x86_64
===================================================================
RCS file: /cvs/ports/www/tor-browser/browser/patches/patch-mozconfig-linux-x86_64,v
diff -u -p -r1.1 patch-mozconfig-linux-x86_64
--- patches/patch-mozconfig-linux-x86_64 21 Jun 2024 16:35:34 -0000 1.1
+++ patches/patch-mozconfig-linux-x86_64 4 Jul 2024 20:11:35 -0000
@@ -6,10 +6,17 @@ https://gitlab.torproject.org/tpo/applic
Index: mozconfig-linux-x86_64
--- mozconfig-linux-x86_64.orig
+++ mozconfig-linux-x86_64
-@@ -8,6 +8,3 @@ ac_add_options --disable-install-strip
+@@ -1,13 +1,7 @@
+ . $topsrcdir/browser/config/mozconfigs/tor-browser

- ac_add_options --enable-default-toolkit=cairo-gtk3
+-# Moz switched to lld for all Linux targets in Bug 1839739.
+-ac_add_options --enable-linker=lld
+-
+ ac_add_options --disable-strip
+ ac_add_options --disable-install-strip

+ ac_add_options --enable-default-toolkit=cairo-gtk3
+-
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
--
+


On Tue, Jul 02, 2024 at 06:44:31PM +0200, Matthias Schmidt wrote:
> Hi,
>
> * Stuart Henderson wrote:
> > On 2024/07/01 22:09, Matthias Schmidt wrote:
> > > Hi,
> > >
> > > the recent update to tor-browser-13.5 on amd64 -current broke it for me.
> > > It aborts right after start with SIGILL. Doesn't matter if I use an existing
> > > config or a fresh one.
> > >
> > > $ egdb /usr/local/lib/tor-browser/tor-browser
> > > Reading symbols from /usr/local/lib/tor-browser/tor-browser...
> > > (No debugging symbols found in /usr/local/lib/tor-browser/tor-browser)
> > > (gdb) r
> > > Starting program: /usr/local/lib/tor-browser/tor-browser
> > > [New thread 600821]
> > > [New thread 465054]
> > > [New thread 362995]
> > > [New thread 178360]
> > > [New thread 381574]
> > > [New thread 412107]
> > > [New thread 509418]
> > > [New thread 420661]
> > >
> > > Thread 1 received signal SIGILL, Illegal instruction.
> > > 0x00000f503c91d3a0 in ?? ()
> > > (gdb) bt
> > > #0 0x00000f503c91d3a0 in ?? ()
> > > #1 0x00000f4ff04c0c3f in js::jit::MaybeEnterJit(JSContext*, js::RunState&) () from /usr/local/lib/tor-browser/libxul.so.9.0
> > >
> > > I have a 11th gen Intel CPU with BTI so it might be related to that...
> >
> > Based on the function name, SIGILL, and cpu that is quite likely.
> > The way to be sure is to run under ktrace and check kdump, on a
> > 12th gen Intel machine I have
> >
> > 67324 tor-browser PSIG SIGILL caught handler=0x3d79d66aa40 mask=0<> code=ILL_BTCFI addr=0x3d80b3fa3a0 trapno=21
>
> Yep, same here:
>
> 67083 tor-browser PSIG SIGILL caught handler=0x8caf8cd0a40 mask=0<> code=ILL_BTCFI addr=0x8cb6d9403a0 trapno=21
>
> > so yes.
> >
> > mozilla.port.mk is setting USE_NOBTCFI so it's supposed to be built
> > with the relevant linker flags to turn this off, but perhaps there's
> > something in tor-browser build which is overriding that..
>
> Sounds sound since I use Firefox on a daily basis.
>
> Cheers
>
> Matthias

No comments:

Post a Comment