Skip to content

Explicitly initialize shim's new thread state after clone#1943

Merged
sporksmith merged 2 commits intoshadow:mainfrom
sporksmith:early-thread-init
Mar 2, 2022
Merged

Explicitly initialize shim's new thread state after clone#1943
sporksmith merged 2 commits intoshadow:mainfrom
sporksmith:early-thread-init

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

@sporksmith sporksmith commented Mar 1, 2022

Fixes #1931 and #1549.

Also reduces the failure rate of the goroutines test
(#1932) from ~80% to ~10%.

@sporksmith sporksmith added this to the Support for golang milestone Mar 1, 2022
@github-actions github-actions bot added Component: Build Build/install tools and dependencies Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks labels Mar 1, 2022
@sporksmith sporksmith changed the title Explicitly initialize new thread state after clone Explicitly initialize shim's new thread state after clone Mar 1, 2022
@sporksmith sporksmith force-pushed the early-thread-init branch 2 times, most recently from d9eef44 to ab38c58 Compare March 1, 2022 22:48
@sporksmith sporksmith linked an issue Mar 1, 2022 that may be closed by this pull request
4 tasks
@sporksmith sporksmith marked this pull request as ready for review March 1, 2022 23:39
@sporksmith sporksmith requested a review from stevenengler March 1, 2022 23:39
@sporksmith
Copy link
Copy Markdown
Contributor Author

Demo of the underlying issue this solves: godbolt

@sporksmith
Copy link
Copy Markdown
Contributor Author

Relevant message to LKML for posterity: https://lkml.org/lkml/2022/3/2/602

Copy link
Copy Markdown
Contributor

@stevenengler stevenengler left a comment

Choose a reason for hiding this comment

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

This seems like it was fun to debug :)

Fixes shadow#1931

Also reduces the failure rate of the goroutines test
(shadow#1932) from ~80% to ~10%.
@sporksmith sporksmith enabled auto-merge March 2, 2022 17:58
@sporksmith
Copy link
Copy Markdown
Contributor Author

This seems like it was fun to debug :)

Hah, yes and no. Definitely got more fun as I homed in on the root cause, but spent some painful time getting there from "memory corruption happened at some earlier point"

@sporksmith sporksmith merged commit 76cf1bc into shadow:main Mar 2, 2022
@sporksmith sporksmith deleted the early-thread-init branch March 2, 2022 18:33
@sporksmith sporksmith mentioned this pull request Mar 2, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

golang garbage collector crashes in preload mode snowflake simulation broken

2 participants