Open Bug 1818243 Opened 2 years ago Updated 2 years ago

Investigate hangs in CycleCollectedJSContext::PerformMicroTaskCheckPoint reported by BHR

Categories

(Core :: Cycle Collector, task)

task

Tracking

()

People

(Reporter: jstutte, Unassigned)

Details

It seems we can get stuck in CycleCollectedJSContext::PerformMicroTaskCheckPoint.

In particular there are stacks that indicate we are hanging directly inside that function, not within something called from it:

mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) xul

which would probably mean that we are hanging directly inside its for loop.

Note about BHR: It truncates stacks up to the first event loop processing and if there is a bhr: whiteboard tag, it will group and truncate stacks also down to the first line that contains the search string. But those single line stacks were already present before adding the bhr: whiteboard tag here, so I must assume they are real.

Whiteboard: [bhr:PerformMicroTaskCheckPoint]

Adding the BHR annotation actually groups more hangs than expected. Not all of them originally read just with one frame, but there is a decent amount of them that apparently hang directly in the for loop inside PerformMicroTaskCheckPoint. The latest optimization around mSuppressedMicroTasks might be of interest here ?

Flags: needinfo?(smaug)

It is somewhat expected to see hangs under PerformMicroTaskCheckPoint. That is where long js promise chains are handled.
Do you have a link to something where mSuppressedMicroTasks shows up?

Flags: needinfo?(smaug)

(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #2)

It is somewhat expected to see hangs under PerformMicroTaskCheckPoint. That is where long js promise chains are handled.
Do you have a link to something where mSuppressedMicroTasks shows up?

Sorry, the description omitted some context. See updated description.

Flags: needinfo?(smaug)

Removing [bhr:PerformMicroTaskCheckPoint] to check the full stacks.

Whiteboard: [bhr:PerformMicroTaskCheckPoint]

So the empty stack this bug is interested in ranks #17 currently.

It is probably better for other bugs (like bug 1688963) to not add the whiteboard bhr tag here.

I guess the hang could look like this if there are tons of promises

Flags: needinfo?(smaug)
You need to log in before you can comment on or make changes to this bug.