Closed Bug 1841538 Opened 3 years ago Closed 3 years ago

Deadlock on apparent mmap failure in PHC

Categories

(Core :: Memory Allocator, defect, P1)

Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox115 --- wontfix
firefox116 --- wontfix
firefox117 --- fixed

People

(Reporter: jesup, Assigned: pbone)

References

Details

(Keywords: crash)

Attachments

(1 file, 3 external files)

I hit a deadlock when running the profiler. Looking at the stacks, it appears PHC was deadlocked with one thread trying to call MOZ_CRASH in response to a mmap failure, and that thread seems to be waiting on some crashreporter lock.

Search the backtraces attached for threads with PHC.cpp on the stack, etc.

Flags: needinfo?(pbone)

Thanks jesup!

I see the problem, the crash reporter asks PHC about the cause of the crash - which causes it to reenter and deadlock. There's two things we should do and IMHO we should do both:

  • Unlock PHC before executing MOZ_CRASH.
  • Use a try-lock while querying PHC so that if we did crash within PHC the crash reporter can continue.
Assignee: nobody → pbone
Blocks: PHC2023
Status: NEW → ASSIGNED
Flags: needinfo?(pbone)

Depends on D183242

Attachment #9343229 - Attachment description: WIP: Bug 1841538 - Unlock the PHC mutex before crashing → Bug 1841538 - Unlock the PHC mutex before crashing r=jesup,glandium
Attachment #9343230 - Attachment description: WIP: Bug 1841538 - Use a try lock while retreiving PHC information → Bug 1841538 - Use a try lock while retreiving PHC information r=jesup,glandium
Attachment #9343231 - Attachment description: WIP: Bug 1841538 - Fix punctuation → WIP: Bug 1841538 - Fix punctuation r-jesup,glandium
Attachment #9343231 - Attachment description: WIP: Bug 1841538 - Fix punctuation r-jesup,glandium → Bug 1841538 - Fix punctuation r=jesup,glandium

The severity field is not set for this bug.
:glandium, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mh+mozilla)
Severity: -- → S3
Flags: needinfo?(mh+mozilla)
Priority: -- → P1
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/052b5225dd18 Unlock the PHC mutex before crashing r=glandium https://hg.mozilla.org/integration/autoland/rev/564bee2d9b2c Use a try lock while retreiving PHC information r=jesup https://hg.mozilla.org/integration/autoland/rev/57f9fc8d9487 Fix punctuation r=glandium
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: