fix(rendering): update BlitDesc.blit on reuse to prevent stale-reference crash#19166
Open
YW1975 wants to merge 2 commits intococos:v3.8.8from
Open
fix(rendering): update BlitDesc.blit on reuse to prevent stale-reference crash#19166YW1975 wants to merge 2 commits intococos:v3.8.8from
YW1975 wants to merge 2 commits intococos:v3.8.8from
Conversation
…nce crash (cocos#18884) When DeviceRenderQueue.createBlitDesc() reused an existing _blitDesc, it did not update the stored blit reference. This caused BlitDesc.createStageDescriptor() to read a stale Blit whose material/passID could be invalid, resulting in "Cannot read 'localSetLayout' of undefined" — an infinite error loop that froze the editor. The fix updates this._blitDesc.blit = blit in the reuse path before calling createScreenQuad() and createStageDescriptor(). Closes cocos#18884 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Code Size Check Report
Interface Check ReportThis pull request does not change any public interfaces ! |
The standalone ts-node script caused CI npm_test to fail with "Your test suite must contain at least one test". Rewritten using describe/test/expect to match the project's jest convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BlitDesc.createStageDescriptorcrashes with "Cannot read 'localSetLayout' of undefined" duringWebPipeline.render(), causing an infinite error loop that freezes the editorDeviceRenderQueue.createBlitDesc()reuses an existing_blitDesc, the storedblitreference was not updated, socreateStageDescriptor()read a staleBlitwith invalid material/passIDthis._blitDesc.blit = blitin theelsebranch beforecreateScreenQuad()andcreateStageDescriptor()Changes
cocos/rendering/custom/executor.ts:618-625— update_blitDesc.bliton reusetests/rendering/blit-desc-stale-ref.test.ts— verification test proving BROKEN crashes and FIXED succeedsTest plan
npx ts-node --skip-project tests/rendering/blit-desc-stale-ref.test.ts→ 6/6 passnpx jest→ no new failures (163/163 = 162 pre-existing + 1 new file, all blocked by unrelatedexternal:emscriptenmapping)localSetLayoutcrash🤖 Generated with Claude Code