fix(cli): preserve zero-filled Mach-O TLS initializers during hot patches - #5875
Open
andrewtdiz wants to merge 1 commit into
Open
andrewtdiz wants to merge 1 commit into
andrewtdiz wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Mach-O thread-local zero-fill symbols are absent from the hot-patch cache's initializer size map. When creating a stub for one of these symbols, the missing-symbol fallback copies unrelated nonzero
__thread_databytes. In a native Dioxus0.7.10 app, a component-body patch consequently producedstd::thread::AccessErrorwhile allocating its template signal; the thread-local owner storage contained an invalid state byte.Index both initialized and zero-fill TLS sections, preserve each initializer's adjacent-symbol size, and encode zero-fill entries without a source-data offset. Stub construction then emits zero bytes for BSS while preserving initialized data. This retains the existing preprocessing complexity and adds no callback-time work.
The regression builds a real AArch64 Mach-O object with one nonzero initialized TLS value and two differently sized BSS values, then checks their extracted initializer bytes and sizes.
Validation:
dioxus-cliTLS regression passes on current main (1passed,161filtered; dev build, assertions enabled). The same test passes onv0.7.10. A live native component patch with the v0.7.10 fix preserves process, game state and Dioxus hook state. The existing TLS rewrite in#5291 andv0.8.0-alpha.1 retain the missing BSS initializer path; this addresses that case separately.