Closed Bug 1600149 Opened 10 months ago Closed 10 months ago

Code coverage loses information during runtime shutdown

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

Details

Attachments

(1 file)

When running a simple shell example with JS_CODE_COVERAGE_OUTPUT_DIR we don't get any coverage output. This is due to ordering issues during js::Runtime shutdown removing the Zone::scriptLCovMap before the scripts are finalized.

We shouldn't actually need to cleanup in Realm::finishRoots(). https://searchfox.org/mozilla-central/rev/42c2ecdc429115c32e6bcb78bf087a228a051044/js/src/vm/Realm.cpp#339-340

Summary: Code coverage loses due during runtime shutdown → Code coverage loses information during runtime shutdown

The coverage tables stored on the Zone are weak references. Entries are
removed when JSScripts are finalized. This patch removes the erroneous calls
to clearScriptLCov in Realm::finishRoots. Without this, the map gets
destroyed during shutdown before it is finished being used by the JSScript
finalizers.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/38cc7c4b3c01
Don't cleanup coverage in Realm::finishRoots. r=jonco
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.