Skip to content

Fix guest thread GS initialization race - #1565

Merged
Weiteng Chen (CvvT) merged 3 commits into
mainfrom
weiteng/guest-thread-gs-race
Oct 12, 2026
Merged

Weiteng Chen (CvvT) merged 3 commits into
mainfrom
weiteng/guest-thread-gs-race

Conversation

@CvvT

Copy link
Copy Markdown
Contributor

A newly spawned guest thread could receive SIGALRM, SIGINT, or interrupt signal before its GS base was initialized. The signal handler could then access invalid or inherited TLS state.

Initializing GS while guest signals remain blocked closes this race.

@CvvT
Weiteng Chen (CvvT) marked this pull request as ready for review October 10, 2026 01:02

@wdcui Weidong Cui (wdcui) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@wdcui

Copy link
Copy Markdown
Member

When this is cherry-picked into ulitebox, we may need to do some extra work to make sure the platform handles different shims properly.

@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@CvvT

Weiteng Chen (CvvT) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

When this is cherry-picked into ulitebox, we may need to do some extra work to make sure the platform handles different shims properly.

ulitebox already has the fix for aarch64, I don't need to cherry-pick this one. Instead, I made some adjustment to backport some changes from ulitebox to main so that two branches look more similar. For ulitebox, some adaptation is needed and was made in #1567 when cherry-picking a previous PR that added fp support for x86_64.

@CvvT
Weiteng Chen (CvvT) added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit 8c2c76a Oct 12, 2026
16 checks passed
@CvvT
Weiteng Chen (CvvT) deleted the weiteng/guest-thread-gs-race branch October 12, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants