-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Re-correct TSAN integration #42447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-correct TSAN integration #42447
Conversation
This reverts commit 15772ba.
Looks like #36929 got reverted without comment. Not sure what happened there. Re-apply it to fix TSAN.
Will fix it in the morning. |
In certain modes, we copy this state and expect to have certain properties. Need to look closer to see if if this is okay with all the various option combinations. |
memcpy(&t->copy_stack_ctx, &ptls->copy_stack_ctx, sizeof(t->copy_stack_ctx) - sizeof(t->copy_stack_ctx.tsan_state)); | ||
else | ||
memcpy(&t->ctx, &ptls->base_ctx, sizeof(t->ctx)); | ||
memcpy(&t->ctx, &ptls->base_ctx, sizeof(t->ctx) - sizeof(t->ctx.tsan_state)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcpy(&t->ctx, &ptls->base_ctx, sizeof(t->ctx) - sizeof(t->ctx.tsan_state)); | |
memcpy(&t->ctx.uc_mcontext, &ptls->base_ctx.uc_mcontext, sizeof(t->ctx.uc_mcontext)); |
t->bufsz = 0; | ||
if (always_copy_stacks) | ||
memcpy(&t->copy_stack_ctx, &ptls->copy_stack_ctx, sizeof(t->copy_stack_ctx)); | ||
memcpy(&t->copy_stack_ctx, &ptls->copy_stack_ctx, sizeof(t->copy_stack_ctx) - sizeof(t->copy_stack_ctx.tsan_state)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcpy(&t->copy_stack_ctx, &ptls->copy_stack_ctx, sizeof(t->copy_stack_ctx) - sizeof(t->copy_stack_ctx.tsan_state)); | |
memcpy(&t->copy_stack_ctx.uc_mcontext, &ptls->copy_stack_ctx.uc_mcontext, sizeof(t->copy_stack_ctx.uc_mcontext)); |
But I'm not sure if uc_mcontext
is something C can deal with, or if it needed to be wrapped in a struct to be something that C could create access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But note that this is in the COPY_STACKS
code path, so currently we disable this code path entirely if TSAN is enabled
I will fix and update this, with other fixes |
Looks like #36929 got reverted. Not sure what happened there. Re-apply it to fix TSAN.