Skip to content

Commit 22d25b1

Browse files
committed
Revert "Update references to tsan state (#42440)"
This reverts commit 15772ba.
1 parent d2289e6 commit 22d25b1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/gc-stacks.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ void sweep_stack_pools(void)
234234
_jl_free_stack(ptls2, stkbuf, bufsz);
235235
}
236236
#ifdef _COMPILER_TSAN_ENABLED_
237-
if (t->tsan_state) {
238-
__tsan_destroy_fiber(t->tsan_state);
239-
t->tsan_state = NULL;
237+
if (t->ctx.tsan_state) {
238+
__tsan_destroy_fiber(t->ctx.tsan_state);
239+
t->ctx.tsan_state = NULL;
240240
}
241241
#endif
242242
}

src/task.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ static inline void sanitizer_finish_switch_fiber(void) {}
5555
#endif
5656

5757
#if defined(_COMPILER_TSAN_ENABLED_)
58-
static inline void tsan_destroy_ctx(jl_ptls_t ptls, void **state) {
59-
if (state != &ptls->root_task->tsan_state) {
60-
__tsan_destroy_fiber(*state);
58+
static inline void tsan_destroy_ctx(jl_ptls_t ptls, void *state) {
59+
if (state != &ptls->root_task->state) {
60+
__tsan_destroy_fiber(ctx->state);
6161
}
62-
*state = NULL;
62+
ctx->state = NULL;
6363
}
6464
static inline void tsan_switch_to_ctx(void *state) {
6565
__tsan_switch_to_fiber(state, 0);
@@ -336,7 +336,7 @@ static void ctx_switch(jl_task_t *lastt)
336336
assert(ptls->locks.len == 0);
337337

338338
#ifdef _COMPILER_TSAN_ENABLED_
339-
if (lastt->tsan_state != __tsan_get_current_fiber()) {
339+
if (lastt->ctx.tsan_state != __tsan_get_current_fiber()) {
340340
// Something went really wrong - don't even assume that we can
341341
// use assert/abort which involve lots of signal handling that
342342
// looks at the tsan state.
@@ -402,7 +402,7 @@ static void ctx_switch(jl_task_t *lastt)
402402
jl_set_pgcstack(&t->gcstack);
403403

404404
#if defined(_COMPILER_TSAN_ENABLED_)
405-
tsan_switch_to_ctx(t->tsan_state);
405+
tsan_switch_to_ctx(&t->tsan_state);
406406
if (killed)
407407
tsan_destroy_ctx(ptls, &lastt->tsan_state);
408408
#endif

0 commit comments

Comments
 (0)