Crash in [@ mozilla::layers::CanvasTranslator::AddBuffer]
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox135 | --- | wontfix |
| firefox136 | --- | wontfix |
| firefox137 | --- | fixed |
People
(Reporter: mccr8, Assigned: bobowen)
References
Details
(Keywords: crash)
Crash Data
Attachments
(2 files)
Crash report: https://crash-stats.mozilla.org/report/index/b2615140-5247-4741-8558-b32560250206
MOZ_CRASH Reason:
MOZ_CRASH(mHeader->readerState == State::Paused)
Top 10 frames:
0 libxul.so MOZ_CrashSequence(void*, long) mfbt/Assertions.h:245
0 libxul.so mozilla::layers::CanvasTranslator::AddBuffer(mozilla::UniquePtr<int, mozilla:... gfx/layers/ipc/CanvasTranslator.cpp:282
1 libxul.so mozilla::layers::CanvasTranslator::HandleCanvasTranslatorEvents() gfx/layers/ipc/CanvasTranslator.cpp:743
2 libxul.so mozilla::detail::RunnableMethodArguments<>::apply<nsObserverService, void (ns... xpcom/threads/nsThreadUtils.h:1085
2 libxul.so std::__invoke_impl<void, mozilla::detail::RunnableMethodArguments<>::apply<ns... /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/8/bits/invoke.h:60
2 libxul.so std::__invoke<mozilla::detail::RunnableMethodArguments<>::apply<nsObserverSer... /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/8/bits/invoke.h:95
2 libxul.so _ZSt12__apply_implIZN7mozilla6detail23RunnableMethodArgumentsIJEE5applyI17nsO... /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/8/tuple:1678
2 libxul.so std::apply<mozilla::detail::RunnableMethodArguments<>::apply<nsObserverServic... /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/8/tuple:1687
2 libxul.so mozilla::detail::RunnableMethodArguments<>::apply<nsObserverService, void (ns... xpcom/threads/nsThreadUtils.h:1083
2 libxul.so mozilla::detail::RunnableMethodImpl<mozilla::ScriptPreloader*, void (mozilla:... xpcom/threads/nsThreadUtils.h:1134
Steady trickle of these crashes. I don't know if this is of interest or not.
| Reporter | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Bob, any idea what's going on here?
| Assignee | ||
Comment 2•1 year ago
|
||
(In reply to Lee Salzman [:lsalzman] from comment #1)
Bob, any idea what's going on here?
I haven't looked at canvas for a while and nearly all of these seem to be coming from CanvasTranslator::HandleCanvasTranslatorEvents, which I don't recognise.
It seems we did occasionally hit this before, but I'm not sure if HandleCanvasTranslatorEvents altered the state change logic somewhat.
Doesn't look like crash-stats has old enough data to try and pin-point anything.
Comment 3•1 year ago
|
||
The crash reports had the following error log.
|[G0][GFX1-]: CanvasTranslator::AddBuffer bad state 0
Then when the crashes happened, state was State::Processing. It needs to be State::Paused. The Paused state was added by Bug 1863914.
Comment 4•1 year ago
|
||
Bug 1899231 added a capability to interrupt TranslateRecording() in CanvasTranslator. The change was done as not to change order of the canvas tasks.
Comment 5•1 year ago
|
||
:bobowen, do you have any ideas about the problem?
| Assignee | ||
Comment 6•1 year ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #3)
The crash reports had the following error log.
|[G0][GFX1-]: CanvasTranslator::AddBuffer bad state 0
Then when the crashes happened, state was State::Processing. It needs to be State::Paused. The Paused state was added by Bug 1863914.
I understand the immediate issue, it's just that the logic for starting and stopping translation has got a fair bit more complicated.
I've looked through the new code and I think possibly an issue in an original failure case could be the problem here.
The logic in HandleCanvasTranslatorEvents to maintain the ordering relies on TranslateRecording not returning false when the state is still Processing.
Looking at TranslateRecording I think this can only happen if ReadNextEvent returns false with a state of Processing.
I think ReadNextEvent can only return false with a state of Processing if either:
mFlushCheckpointis non-zero andHasPendingEventreturns falseReadPendingEventreturns false
In the HasPendingEvent case, as far as I can tell mFlushCheckpoint is only set from mHeader->eventCount so it must always be less than or equal to it.
So, it can only return false when mHeader->processedCount >= mFlushCheckpoint, so that would return true from logic in TranslateRecording.
In the ReadPendingEvent case that could return false if the read from the stream failed or the value wasn't a valid EventType. This should only happen if something has gone badly wrong in the content process, however in this case we don't set the state to Failed and I think we should.
I'll create a patch to do this and also address the places where we set Failed in TranslateRecording, to make them clearer and I think fix a separate issue. I'll also simplify the checking of mFlushCheckpoint, because I think we can just do it in one place in TranslateRecording.
| Assignee | ||
Comment 7•1 year ago
|
||
| Assignee | ||
Comment 8•1 year ago
|
||
| Assignee | ||
Comment 9•1 year ago
|
||
This moves all the logic for exiting translation for a reason other than there
being no pending events out of ReadNextEvent and into TranslateRecording.
This now means mFlushCheckpoint logic is in one place along with pausing for
IPDL messages.
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2ca338e4d9d1
https://hg.mozilla.org/mozilla-central/rev/56415f74ab24
Updated•1 year ago
|
Comment 13•1 year ago
|
||
The patch landed in nightly and beta is affected.
:bobowen, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox136towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 14•1 year ago
|
||
(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #13)
The patch landed in nightly and beta is affected.
:bobowen, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox136towontfix.For more information, please visit BugBot documentation.
While the changes seem correct in themselves, this is a rather speculative fix to this crash.
So, I think just letting it ride the trains is the best option.
Description
•