fix: Avoid reading unmapped memory in FastTextRenderer - #3376
Merged
xen2 merged 2 commits intoSep 9, 2026
Conversation
Contributor
Author
|
@dotnet-policy-service agree |
Ethereal77
reviewed
Aug 26, 2026
ds5678
suggested changes
Sep 5, 2026
Vulkan says unmapped memory is no longer readable
BenjaBobs
force-pushed
the
fix/fast-text-renderer-vulkan-unmap
branch
from
September 5, 2026 12:39
8090d6d to
d493806
Compare
xen2
requested changes
Sep 7, 2026
…eates new ones End() re-initializes when the character count grows, which overwrote the index buffer, the vertex buffers and the effect instance without disposing them. Also removes IndexStride, unused since the indices moved to a managed array.
xen2
force-pushed
the
fix/fast-text-renderer-vulkan-unmap
branch
from
September 8, 2026 05:48
6388b3a to
3a0d448
Compare
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.
PR Details
FastTextRenderer.Initializeretained a pointer to mapped index-buffer memory and passed it toBuffer.Index.Newafter unmapping the buffer.On Linux/Vulkan the pointer was no longer valid, which caused an
AccessViolationExceptionwhenBuffer.Index.Newtried to copy the index data.This change builds the indices in a managed
int[]and passes that array directly toBuffer.Index.New.This also removes the temporary graphics buffer and the now-unnecessary
unsafemodifier.I rebuilt the local Stride packages and confirmed that a code-only game using Vulkan can render debug text without crashing.
Related Issue
Fixes #3375
Types of changes
Checklist
I tested the change in a code-only game on Linux/Vulkan.
I did not run Game Studio because it is not currently available on Linux.