Closed Bug 595171 Opened 10 years ago Closed 10 years ago

crash reporting glue for Android


(Toolkit :: Crash Reporting, defect)

Not set



Tracking Status
fennec 2.0b2+ ---


(Reporter: ted, Assigned: ted)




(1 file, 4 obsolete files)

Once we have the Breakpad libraries working on Android, we'll need to ensure that all the glue that sets up crash reporting etc works. This is mostly in nsExceptionHandler.cpp. This will also cover hooking up the crash reporter client properly once it's implemented.
Blocks: 595172
While trying to get gdb to work on my galaxy S with 2.1, I discovered that

        // bionic doesn't define this.  SIIIGGGHHHH
#define PR_CAPBSET_READ 23
        int hasptrace = prctl(PR_CAPBSET_READ, CAP_SYS_PTRACE/*unused*/, 0, 0, 0);

E/Gecko   ( 4759): 0 == prctl(HAS_PTRACE) --- NO PTRACE!!! :(

So fennec on android doesn't have the PTRACE capability (on my device/version at least), which means breakpad won't work.  Maybe things are different in froyo.
The "real" ptrace cap check is .  It might be a good idea to integrate this into the breakpad startup path (it's cheap), and disable breakpad if we don't have ptrace.  Then we can log a warning or whatever and fend off "why is my breakpad borked" questions, as well as save on some system resources that will be unused.
(This is a generally useful check, BTW, not just for android.)
This patch + the patch on bug 595167 are sufficient to build Fennec for Android with --enable-crashreporter, and have it produce a minidump. We'll need to fix bug 595169 as well in order to get something that's actually usable.
Attachment #482865 - Attachment is obsolete: true
blassey and I came to an agreement on how to launch the crashreporter client, so this new patch uses the agreed-upon method.
Attachment #482919 - Attachment is obsolete: true
Comment on attachment 483159 [details] [diff] [review]
crashreporter glue for Android

Slight tweak to the commandline. This still doesn't launch the crashreporter for me when I crash using "Crash Me Now!" However, if I then run the same command via adb shell, it does:
adb shell /system/bin/am start -a org.mozilla.gecko.reportCrash -n org.mozilla.fennec/.CrashReporter --es minidumpPath /data/data/org.mozilla.fennec/mozilla/3km6sy6e.default/minidumps/713487e3-a74b-1a71-1b12fdc1-173831c0.dmp
Attachment #483159 - Attachment is obsolete: true
Comment on attachment 483188 [details] [diff] [review]
crashreporter glue for Android

blassey did some testing and found that execlp worked where execl did not. I don't know why, but this patch WFM. I can crash fennec and the crashreporter client is displayed.
Assignee: nobody → ted.mielczarek
Attachment #483188 - Flags: review?(blassey.bugs)
Attachment #483188 - Flags: review?(blassey.bugs) → review+
tracking-fennec: --- → 2.0b2+
Attachment #483188 - Attachment is obsolete: true
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.