Closed Bug 1897479 Opened 4 months ago Closed 4 months ago

Add detection and diagnostics code for improper initialization of block-scope static variables at xul.dll load time

Categories

(Core :: IPC: MSCOM, task)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: yannis, Assigned: yannis)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

The crashes in bug 1816848 suggest improper initialization of block-scope static variables in xul.dll (and no ASLR for xul.dll). To investigate the issue, we can try to detect this situation and add diagnostics data, in particular single-step data that reveals the code paths that are taken internally in ntdll.dll during the call to LdrLoadDll.

This patch makes the single-step data collection code that we
implemented for bug 1571516 reusable, while preserving its behavior.

We define a generic CollectSingleStepData function that embeds the
magic for starting to trigger single step exceptions and for acting upon
them.

We define a more specialized CollectModuleSingleStepData function which
can be reused if the purpose of single step data collection is to
monitor what paths are taken within a specific module. It stores the
collected data in stack, so that it can be accessed from crash reports.

This code is considered unstable and thus only available in Nightly and
early Beta and only used on paths that are known to crash already.

Assignee: nobody → yjuglaret
Status: NEW → ASSIGNED

This patch introduces an InstructionFilter template argument to
CollectModuleSingleStepData to allow filtering which kind of
instructions should be recorded. We implement the All default filter and
the CallRet filter.

Depends on D211195

This patch lets us detect the situation that appears to be causing
crashes in bug 1816848. We add a block-scope static variable that lives
in xul.dll and gets trivially initialized to true -- and we check that
the initialization to true really happens.

Depends on D211196

This patch lets us collect single-step data in the crash reports on
nightly and early beta, when we detect the situation that appears to be
causing crashes in bug 1816848.

Depends on D211197

Pushed by yjuglaret@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9dc37de1d995 Abstract away single-step data collection for reusability. r=rkraesig,win-reviewers https://hg.mozilla.org/integration/autoland/rev/0a4a4134458f Filter instructions when collecting single-step data. r=rkraesig,win-reviewers https://hg.mozilla.org/integration/autoland/rev/bf417d63d261 Detect improper initialization of block-scope static variables in xul. r=rkraesig,win-reviewers https://hg.mozilla.org/integration/autoland/rev/0cb3ce4032e4 Collect single-step data for improper initialization of block-scope static variables in xul. r=rkraesig,win-reviewers
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: