Closed Bug 959214 Opened 12 years ago Closed 12 years ago

Use unwinder when getting ANR native stack

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 30

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(1 file, 1 obsolete file)

We need the Gecko thread stack to fix a majority of ANRs. So far the ANR native stack only includes the pseudostack, which limits its effectiveness. We can use the unwinder to get a better native stack.
Depends on: 959931
This patch turns on unwinding for ANR native stacks when running on high-memory devices (due to unwinding being somewhat memory-intensive). I also limited native stacks to the main thread and Compositor thread to make sure we can finish in reasonable time, before the user kills us.
Attachment #8360205 - Flags: review?(blassey.bugs)
Comment on attachment 8360205 [details] [diff] [review] Use unwinder when getting ANR native stack (v1) Review of attachment 8360205 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/android/AndroidJNI.cpp @@ +970,5 @@ > + if (aUnwind) { > + features = NATIVE_STACK_UNWIND_FEATURES; > + features_size = sizeof(NATIVE_STACK_UNWIND_FEATURES); > + // We want the new unwinder if the unwind mode has not been set yet > + putenv("MOZ_PROFILER_NEW=1"); What is the effect of this? It won't get unset if this is called with aUnwind = false later.
Attachment #8360205 - Flags: review?(blassey.bugs) → review+
> Too hackish for my taste. I'd rather see ReadSymbolData_ANDROID use plain > open/mmap/close for libmozglue.so instead, until the linker has the right > support to make this unnecessary (which is not trivial, but necessary for > other reasons anyways, so it will happen some day). Okay. It's hackish either way :) But here's the patch to use open/mmap.
Attachment #8360205 - Attachment is obsolete: true
Attachment #8367417 - Flags: review?(jseward)
Comment on attachment 8367417 [details] [diff] [review] Use open/mmap for libmozglue unwinding (v1) Oops wrong bug :)
Attachment #8367417 - Attachment is obsolete: true
Attachment #8367417 - Flags: review?(jseward)
Attachment #8360205 - Attachment is obsolete: false
https://hg.mozilla.org/integration/mozilla-inbound/rev/2414def6feab (In reply to Brad Lassey [:blassey] (use needinfo?) from comment #2) > Comment on attachment 8360205 [details] [diff] [review] > Use unwinder when getting ANR native stack (v1) > > Review of attachment 8360205 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: widget/android/AndroidJNI.cpp > @@ +970,5 @@ > > + if (aUnwind) { > > + features = NATIVE_STACK_UNWIND_FEATURES; > > + features_size = sizeof(NATIVE_STACK_UNWIND_FEATURES); > > + // We want the new unwinder if the unwind mode has not been set yet > > + putenv("MOZ_PROFILER_NEW=1"); > > What is the effect of this? It won't get unset if this is called with > aUnwind = false later. I don't think it's a concern because this env var is only used when we ask the profiler to unwind.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: