mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 17:43:44 +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
|
||||
// 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));
|
||||
for (Telemetry::HangHistogram* oldHistogram = mStats.mHangs.begin();
|
||||
oldHistogram != mStats.mHangs.end(); oldHistogram++) {
|
||||
|
@ -673,10 +673,8 @@ ThreadStackHelper::FillStackBuffer()
|
||||
}
|
||||
#endif
|
||||
const char* const label = entry->label();
|
||||
if (mStackToFill->IsSameAsEntry(prevLabel, label) ||
|
||||
!strcmp(label, "js::RunScript")) {
|
||||
if (mStackToFill->IsSameAsEntry(prevLabel, label)) {
|
||||
// Avoid duplicate labels to save space in the stack.
|
||||
// Avoid js::RunScript labels because we save actual JS frames above.
|
||||
continue;
|
||||
}
|
||||
mStackToFill->infallibleAppend(label);
|
||||
|
Loading…
Reference in New Issue
Block a user