native: note_written reads descriptor tables with plain loads on every dispatch #445

Closed
opened 2026-11-27 19:48:24 +00:00 by lautarocherro · 3 comments
lautarocherro commented 2026-11-27 19:48:24 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lautarocherro on 2026-11-27T19:48:24Z.


Since 95627c66, NativeHost::note_written runs for every dispatch the native host prepares, with or without copy-back. It reads each record of the bound resource tables through descriptor::view, a plain read_unaligned of title memory.

remirror_tables and resources_named read the same spans with safe_read, because part of a span can be unreadable. When it is, note_written faults the process instead of skipping those entries.

Plan: read the span with safe_read (entry by entry if that fails, as remirror_tables does) and look the views up from those records with one lock per table. Test: a dispatch whose bound table runs into an unreadable page.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6653486300 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/445). Originally posted by [lautarocherro](https://github.com/lautarocherro) on 2026-11-27T19:48:24Z. --- Since 95627c66, `NativeHost::note_written` runs for every dispatch the native host prepares, with or without copy-back. It reads each record of the bound resource tables through `descriptor::view`, a plain `read_unaligned` of title memory. `remirror_tables` and `resources_named` read the same spans with `safe_read`, because part of a span can be unreadable. When it is, `note_written` faults the process instead of skipping those entries. Plan: read the span with `safe_read` (entry by entry if that fails, as `remirror_tables` does) and look the views up from those records with one lock per table. Test: a dispatch whose bound table runs into an unreadable page.
lautarocherro commented 2026-11-27 19:48:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lautarocherro on 2026-11-27T19:48:29Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7226890219 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/445#issuecomment-7226890219). Originally posted by [lautarocherro](https://github.com/lautarocherro) on 2026-11-27T19:48:29Z. --- /claim
github-actions[bot] commented 2026-11-27 19:48:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T19:48:39Z.


Claimed by @lautarocherro. Open a draft pull request with Refs #445 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7226893045 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/445#issuecomment-7226893045). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T19:48:39Z. --- Claimed by @lautarocherro. Open a draft pull request with `Refs #445` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-28 00:36:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:36:06Z.


Thank you for this. It is fixed on main by #447. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231042267 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/445#issuecomment-7231042267). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T00:36:06Z. --- Thank you for this. It is fixed on main by #447. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#445
No description provided.