mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 07:24:47 +00:00
Bug 1113416 - Don't read stack labels inside hang monitor sighandler; r=nfroyd r=snorp
When we're inside the hang monitor's signal handler, we must not read any string labels. Doing so may result in on-demand decompression kicking in on Android, which may result in a deadlock.
This commit is contained in:
parent
3e54f20e33
commit
c2e9cb1c30
@ -360,6 +360,13 @@ BackgroundHangThread::ReportHang(PRIntervalTime aHangTime)
|
|||||||
// Recovered from a hang; called on the monitor thread
|
// Recovered from a hang; called on the monitor thread
|
||||||
// mManager->mLock IS locked
|
// mManager->mLock IS locked
|
||||||
|
|
||||||
|
// Remove unwanted "js::RunScript" frame from the stack
|
||||||
|
for (const char** f = &mHangStack.back(); f >= mHangStack.begin(); f--) {
|
||||||
|
if (!mHangStack.IsInBuffer(*f) && !strcmp(*f, "js::RunScript")) {
|
||||||
|
mHangStack.erase(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Telemetry::HangHistogram newHistogram(Move(mHangStack));
|
Telemetry::HangHistogram newHistogram(Move(mHangStack));
|
||||||
for (Telemetry::HangHistogram* oldHistogram = mStats.mHangs.begin();
|
for (Telemetry::HangHistogram* oldHistogram = mStats.mHangs.begin();
|
||||||
oldHistogram != mStats.mHangs.end(); oldHistogram++) {
|
oldHistogram != mStats.mHangs.end(); oldHistogram++) {
|
||||||
|
@ -673,10 +673,8 @@ ThreadStackHelper::FillStackBuffer()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
const char* const label = entry->label();
|
const char* const label = entry->label();
|
||||||
if (mStackToFill->IsSameAsEntry(prevLabel, label) ||
|
if (mStackToFill->IsSameAsEntry(prevLabel, label)) {
|
||||||
!strcmp(label, "js::RunScript")) {
|
|
||||||
// Avoid duplicate labels to save space in the stack.
|
// Avoid duplicate labels to save space in the stack.
|
||||||
// Avoid js::RunScript labels because we save actual JS frames above.
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mStackToFill->infallibleAppend(label);
|
mStackToFill->infallibleAppend(label);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user