Closed Bug 1597006 Opened 5 years ago Closed 5 years ago

Firefox build is successfully but it crashes after launching

Categories

(Firefox :: General, defect)

72 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1594686

People

(Reporter: a.alamin.cse, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

I followed this tutorial:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation

  1. ran python bootstrap.py
    It downloaded the code but probably due to some network issue it gave an error. I tried around 5 times same error. But the code was downloaded.
    NB: I am inside a proxy network. I need to use a custom CA root certificate .cer to connect to internet.
    NB: Can you please how can I build firefox i.e run python bootstrap.py which will use custom CA root certificate to connect to internet.

  2. Then i ran ./mach build
    There was some issue with missing packages like nodejs old vervion etc. I fixed those manually.
    14:46.42 We know it took a while, but your build finally finished successfully!
    To take your build for a test drive, run: |mach run|
    For more information on what to do now, see https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox

Actual results:

when I ran "mach run"
0:00.27 /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
Exiting due to channel error.
Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=0.40875)

if I run ./firefox:
###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

1573881856638 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1573881856638 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1573881856639 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1573881856639 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
ExceptionHandler::GenerateDump cloned child 24631
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
Exiting due to channel error.

everytime there is an error like this. firefox starts for like 1 second and crash.

Expected results:

Firefox should have run successfully after build

The root cause is probably not IPC.

Component: IPC → General
Product: Core → Firefox

Hi, Md Abdullah Al Alamin. I wonder if we can get more information if you create a debug build.

If you create a .mozconfig file in your source directory with the following content:

ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --enable-application=browser

And then do:

  1. ./mach clobber
  2. ./mach build

This will create a new build that's got more debugging information in it. If you re-create the crash with that build, that might help us figure out what's happening.

Flags: needinfo?(a.alamin.cse)
Flags: needinfo?(a.alamin.cse)

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation
It says
"
If you plan to walk through code with a debugger, set up a .mozconfig file with the following options:
ac_add_options --disable-optimize
ac_add_options --enable-debug
"
So I assumed adding ac_add_options --enable-debug in the .mozconfig is optional.

But if I build firefox without adding ac_add_options --enable-debug in the .mozconfig build is successful.
But when I run
./mach clobber
./mach build [ shows that build is successful]
./mach run it crashes with following erros.

l-al-alamin01@alamin:~/Desktop/firefox/mozilla-unified$ ./mach run
0:00.24 /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
1575424937055 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1575424937055 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1575424937056 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1575424937056 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
Exiting due to channel error.

I have tried and build this more than 10 times and every time it crashes.
Can you please check this happens?

The priority flag is not set for this bug.
:Dolske, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dolske)

(In reply to Md Abdullah Al Alamin from comment #3)

"
So I assumed adding ac_add_options --enable-debug in the .mozconfig is optional.

So for the purposes of diagnosing this issue, that addition to .mozconfig is not optional. In fact, I'm hoping that by adding it, we'll glean more information about why your build is crashing.

Flags: needinfo?(dolske) → needinfo?(a.alamin.cse)

Mike is right, you should compile with debug info so we can get more information.

Also, what compiler are you using? There are some known issues with clang 6 ( bug 1594686)

If I build firefox with --enable-debug in the .mozconfig ==> build successful ==> runs fine
If I build firefox WITHOUT --enable-debug in the .mozconfig ==> build successful ==> firefox crashes right after launch everytime.

l-al-alamin01@alamin:/Desktop/firefox/mozilla-unified$ clang --version
clang version 5.0.0-3
16.04.1 (tags/RELEASE_500/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

l-al-alamin01@alamin:~/Desktop/firefox/mozilla-unified$ $HOME/.mozbuild/clang/bin/clang --version
clang version 9.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/l-al-alamin01/.mozbuild/clang/bin

when I ran ./mach bootstrap it said my systems have all the software packages necessary to build firefox. So I assumed my system has all the packages with right version.

Flags: needinfo?(a.alamin.cse)

On a broken build, if you use ./mach run --debugger=gdb (when gdb opens you may need to use the run command to actually start Firefox from within gdb), does it stop with a crash, too? If you run the bt command in gdb when it's crashed, can you copy-paste the stacktrace that gets printed?

Flags: needinfo?(a.alamin.cse)

after ./mach build
.....
.....
6:46.06 /usr/bin/notify-send --app-name=Mozilla Build System Mozilla Build System Build complete
To view resource usage of the build, run |mach resource-usage|.
6:46.23 Your build was successful!
To take your build for a test drive, run: |mach run|
For more information on what to do now, see https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox

l-al-alamin01@alamin:~/Desktop/firefox/mozilla-unified$ ./mach run --debugger=gdb
0:00.24 /usr/bin/gdb -q --args /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
Reading symbols from /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox...done.
warning: File "/home/l-al-alamin01/Desktop/firefox/mozilla-unified/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /home/l-al-alamin01/Desktop/firefox/mozilla-unified/.gdbinit
line to your configuration file "/home/l-al-alamin01/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/l-al-alamin01/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
(gdb) c
The program is not being run.
(gdb)

It crashes right after lunch.

Flags: needinfo?(a.alamin.cse)

(In reply to Md Abdullah Al Alamin from comment #9)

l-al-alamin01@alamin:~/Desktop/firefox/mozilla-unified$ ./mach run --debugger=gdb
<snip>
(gdb) c
The program is not being run.
(gdb)

It crashes right after lunch.

This doesn't show it crashing, it shows that you're not running it. Please run the program with run from the gdb commandline.

Flags: needinfo?(a.alamin.cse)

l-al-alamin01@alamin:~/Desktop/firefox/mozilla-unified$ ./mach run --debugger=gdb

0:00.35 /usr/bin/gdb -q --args /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
Reading symbols from /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox...done.
warning: File "/home/l-al-alamin01/Desktop/firefox/mozilla-unified/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /home/l-al-alamin01/Desktop/firefox/mozilla-unified/.gdbinit
line to your configuration file "/home/l-al-alamin01/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/l-al-alamin01/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
(gdb)
(gdb) run
Starting program: /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/l-al-alamin01/Desktop/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff69ff700 (LWP 6690)]
[Thread 0x7ffff69ff700 (LWP 6690) exited]
[Detaching after fork from child process 6691]
[Detaching after fork from child process 6775]
[New Thread 0x7ffff69ff700 (LWP 6776)]
[New Thread 0x7fffe24ff700 (LWP 6777)]
[New Thread 0x7fffe1cfe700 (LWP 6778)]
[New Thread 0x7ffff7e8b700 (LWP 6779)]
[New Thread 0x7ffff7fee700 (LWP 6780)]
[New Thread 0x7fffdfcff700 (LWP 6781)]
[New Thread 0x7fffdfb01700 (LWP 6782)]
[New Thread 0x7fffdf903700 (LWP 6783)]
[New Thread 0x7fffdf705700 (LWP 6784)]
[New Thread 0x7fffdf507700 (LWP 6785)]
[New Thread 0x7fffdf309700 (LWP 6786)]
[New Thread 0x7fffdf10b700 (LWP 6787)]
[New Thread 0x7fffdef0d700 (LWP 6788)]
[New Thread 0x7ffff7e4a700 (LWP 6789)]
[New Thread 0x7ffff6ce7700 (LWP 6790)]
[New Thread 0x7ffff6ca6700 (LWP 6791)]
[New Thread 0x7ffff6c65700 (LWP 6792)]
[New Thread 0x7fffde6ff700 (LWP 6793)]
[Detaching after fork from child process 6794]
[New Thread 0x7ffff6c24700 (LWP 6795)]
[New Thread 0x7fffe26c8700 (LWP 6796)]
[Thread 0x7fffde6ff700 (LWP 6793) exited]
[New Thread 0x7fffe2687700 (LWP 6797)]
[New Thread 0x7fffe2646700 (LWP 6798)]
[New Thread 0x7fffe108e700 (LWP 6799)]
[New Thread 0x7fffe104d700 (LWP 6800)]
[New Thread 0x7fffdfe87700 (LWP 6801)]
[New Thread 0x7fffdfe46700 (LWP 6802)]
[New Thread 0x7fffdc178700 (LWP 6803)]
[New Thread 0x7fffdbfff700 (LWP 6804)]
[New Thread 0x7fffde6ff700 (LWP 6805)]
[New Thread 0x7fffdb38e700 (LWP 6806)]
[New Thread 0x7fffdbf48700 (LWP 6808)]
[New Thread 0x7fffdb94e700 (LWP 6809)]
[New Thread 0x7fffda8ff700 (LWP 6810)]
[Thread 0x7ffff6c65700 (LWP 6792) exited]
[New Thread 0x7fffdab8d700 (LWP 6811)]
[New Thread 0x7fffdab4c700 (LWP 6812)]
[New Thread 0x7fffda3ff700 (LWP 6813)]
[New Thread 0x7fffda3be700 (LWP 6814)]
[New Thread 0x7ffff6c65700 (LWP 6815)]
[New Thread 0x7fffda37d700 (LWP 6816)]
[New Thread 0x7fffd96ff700 (LWP 6817)]
[New Thread 0x7fffd96be700 (LWP 6818)]
[New Thread 0x7fffd967d700 (LWP 6819)]
[New Thread 0x7fffd92ff700 (LWP 6820)]
[New Thread 0x7fffd92be700 (LWP 6821)]
[New Thread 0x7fffd8aff700 (LWP 6822)]
[New Thread 0x7fffd8abe700 (LWP 6823)]
[Detaching after fork from child process 6824]
[New Thread 0x7fffd8a7d700 (LWP 6828)]
[New Thread 0x7fffd87ff700 (LWP 6840)]
[Thread 0x7fffd8abe700 (LWP 6823) exited]
[New Thread 0x7fffd85ff700 (LWP 6845)]
[New Thread 0x7fffd83fe700 (LWP 6846)]
[New Thread 0x7fffd81fd700 (LWP 6847)]
[New Thread 0x7fffd8abe700 (LWP 6864)]
[New Thread 0x7fffd87be700 (LWP 6865)]
[New Thread 0x7fffd877d700 (LWP 6866)]
[New Thread 0x7fffd77dc700 (LWP 6867)]
[New Thread 0x7fffd779b700 (LWP 6868)]
[Thread 0x7fffde6ff700 (LWP 6805) exited]
[New Thread 0x7fffd775a700 (LWP 6869)]
[New Thread 0x7fffd6edc700 (LWP 6870)]
[New Thread 0x7fffd6e9b700 (LWP 6875)]
console.log: "RemoteSettingsWorker error: ConstraintError: A mutation operation in the transaction failed because a constraint was not satisfied."
[New Thread 0x7fffd6e5a700 (LWP 6881)]

Thread 40 "IndexedDB #1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6c65700 (LWP 6815)]
nsTSubstringTuple<char>::Length (this=0x7ffff6c64850) at /home/l-al-alamin01/Desktop/firefox/mozilla-unified/xpcom/string/nsTSubstringTuple.cpp:23
23 MOZ_RELEASE_ASSERT(len.isValid(), "Substring tuple length is invalid");
(gdb) c
Continuing.

Thread 40 "IndexedDB #1" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bcb269 in raise (sig=11) at ../sysdeps/unix/sysv/linux/pt-raise.c:35
35 ../sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
(gdb) c
Continuing.

[1]+ Stopped ./mach run --debugger=gdb
l-al-alamin01@alamin:/Desktop/firefox/mozilla-unified$ Exiting due to channel error.
c
c: command not found
l-al-alamin01@alamin:
/Desktop/firefox/mozilla-unified$

Flags: needinfo?(a.alamin.cse)

Yeah, so this is the top of the same stack as bug 1594686, by the looks of it (you didn't run the bt command so the full stack is not there... it looks the same though.). It's because your version of clang is broken. You can fix it by trying to build with a newer clang (not a distro version as that's too old) or building with the clang that ./mach bootstrap set up for you in ~/.mozbuild/.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

ok.
But I did run ./mach bootstrap and it said my system has all the package necessary to build firefox.
~/Desktop/firefox/mozilla-unified$ $HOME/.mozbuild/clang/bin/clang --version
clang version 9.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix

(In reply to Md Abdullah Al Alamin from comment #13)

ok.
But I did run ./mach bootstrap and it said my system has all the package necessary to build firefox.
~/Desktop/firefox/mozilla-unified$ $HOME/.mozbuild/clang/bin/clang --version
clang version 9.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix

What are the full contents of your mozconfig file? And what are the values of your PATH and CC and CXX environment variables?

You could try using:

export CC=path/to/home/.mozbuild/clang/bin/clang
export CXX=path/to/home/.mozbuild/clang/bin/clang++

in your mozconfig.

Flags: needinfo?(a.alamin.cse)

If I add these two lines in .mozconfig file then the build is successful and after run the browser does not crash
export CC=path/to/home/.mozbuild/clang/bin/clang
export CXX=path/to/home/.mozbuild/clang/bin/clang++

My suggestion:
I was following the tutorial to build firefox for the first time.
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation

"building with the clang that ./mach bootstrap set up for you in ~/.mozbuild/."

  1. I ran ./mach bootstrap and it said my system has all the necessary package and ready to build firefox.
  2. then I ran ./mach build ==> It says build successful ==> ./mach run crashes firefox.

May be in the documentation page it should very clearly say that avoid clang related issue its best to add
export CC=path/to/home/.mozbuild/clang/bin/clang
export CXX=path/to/home/.mozbuild/clang/bin/clang++

As I was building it for the first time, I had no idea what was the problem. It showed everything is successful but the firefox crashes.

Flags: needinfo?(a.alamin.cse)

(In reply to Md Abdullah Al Alamin from comment #15)

May be in the documentation page it should very clearly say that avoid clang related issue its best to add
export CC=path/to/home/.mozbuild/clang/bin/clang
export CXX=path/to/home/.mozbuild/clang/bin/clang++

I think the build process should tell you this if your clang version is too old, and we shouldn't rely on people reading the documentation / adding more stuff to their .mozconfig if it's not necessary. Making the build process do this is what bug 1594686 is about.

(In reply to :Gijs (he/him) from comment #16)

(In reply to Md Abdullah Al Alamin from comment #15)

May be in the documentation page it should very clearly say that avoid clang related issue its best to add
export CC=path/to/home/.mozbuild/clang/bin/clang
export CXX=path/to/home/.mozbuild/clang/bin/clang++

I think the build process should tell you this if your clang version is too old, and we shouldn't rely on people reading the documentation / adding more stuff to their .mozconfig if it's not necessary. Making the build process do this is what bug 1594686 is about.

I added a note to the docs for now, but I'll also see if I can get some progress on that bug...

You need to log in before you can comment on or make changes to this bug.