Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Firefox OS crash reporting

This article needs a technical review. How you can help.

This page details how to handle crash reporting on Firefox OS, including retrieving crash reports, and forcing crashes.

Note: Most Firefox desktop contributors are used to using about:crashes to retrieve crash reports (read Crash reporting for more details), but this isn't supported on Firefox OS.

Before you attempt anything else

The following instructions assume that you have already followed these three steps:

  1. Make sure remote debugging is enabled on your device, and ADB is installed. This allows your computer to communicate with your device.
  2. Connect your device to your computer via USB.
  3. Install the ADB Helper Add-on on desktop Firefox to handle any necessary port forwarding.

Installing BusyBox

It is also recommended that you install our BusyBox utility, which adds a number of useful commands to ADB for helping to test and debug Firefox OS.

To install it, ensure your device is awake and then:

  1. Download BusyBox.
  2. Unzip the tarball in a sensible location.
  3. cd into the resulting busybox-b2g directory.
  4. Run ./install.sh to install.

All of the busybox utilities get symlinks in /system/bin, so you can run commands like ping directly. Here are some sample commands:

adb shell ping 8.8.8.8   => ping command

adb shell ifconfig wlan0 => check tx/rx bytes 

adb shell cat /proc/net/route    => check the default route

adb shell iptables -t nat -nvL   => check if the packets are sent from application to IP layer, check Chain OUTPUT (policy ACCEPT 2 packets, 168 bytes)

Getting crash reports from a Firefox OS device

We have created a Firefox OS app to allow us to retrieve crash reports — About Crashes — which works on version 1.2+.

To install it on your device, follow these steps:

  1. About Crashes is a certified app, so you need to enable debugging of certified apps (see instructions for App Manager, and WebIDE).
  2. Download the About Crashes app zip file from the above link and extract it locally.
  3. In Firefox desktop, open the App Manager or WebIDE (depending on which version of Firefox you are using) under Tools > Web Developer.
  4. In either tool, add the About Crashes app as a packaged app (App Manager: click on the plus next to the Add Packaged App option, WebIDE: Open the left hand dropdown menu and select Add Packaged App...).
  5. Connect your device to App Manager/WebIDE (App Manager: find it listed at the bottom of the UI, WebIDE: Find it under Select Runtime).
  6. Install and open the app on the device (App Manager: Press the app's Update button, WebIDE: press the "Play" button (Install and Run)).
  7. On the device, press the Update button inside About Crashes to see your most recent crashes.

Getting crash IDs from the command line

You can get a list of crash IDs via the command line by entering the following command into your terminal:

adb shell ls -l /data/b2g/mozilla/Crash\ Reports/submitted/

If you have a long list of crashes and want them sorted by date, use this command instead:

adb shell busybox ls -ltr /data/b2g/mozilla/Crash\ Reports/submitted/

Getting/verifying the crash report

To verify a crash report:

  1. Copy the filename without the extension.
  2. Go to Mozilla Crash Reports.
  3. Paste the filename without the extension into the upper right hand search box.

This should display the crash report you have submitted.

How to Force a crash

To trigger a Firefox OS system crash, enter the following command in your terminal to find out the root process ID:

adb shell ps | grep b2g

You'll need to find the line that has root at the start of it, and /system/b2g/b2g at the end. It should look something like this:

root 109 1 191120 66024 ffffffff 400fa330 S /system/b2g/b2g

The number at the start of the line is the kill process id you'll need to use to kill that process. Run the following command, with the id filled in where the placeholder is:

adb shell kill -11 [ENTER ID HERE]

Killing the root process will crash your device.

How to run GDB script for b2g

  1. Start the gallery app on the phone, then run the following command in your terminal:
    adb shell b2g-ps
  2. Note down the pid of the gallery app, then run the following command:
    ./run-gdb.sh attach <pid>
  3. Cause the crash.
  4. Run this command:
    (gdb) bt

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, SteveOfTheStow
 Last updated by: chrisdavidmills,