summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <[email protected]>2024-01-12 17:32:16 +1100
committerKJ Tsanaktsidis <[email protected]>2024-01-12 17:58:54 +1100
commit6af0f442c7d16ab526c0e6859aa97ff217b73f99 (patch)
tree341104ff60401c9525815db42d980c11acbd7ba6 /thread_pthread.c
parentac0ba3c07ee3f700b0b45176a7bdd322d8773e27 (diff)
Revert "Make stack bounds detection work with ASAN"
This reverts commit 6185cfdf38e26026c6d38220eeca48689e54cdcf.
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index af50d50699..a6a6c9d127 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -12,7 +12,6 @@
#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
#include "internal/gc.h"
-#include "internal/sanitizers.h"
#include "rjit.h"
#ifdef HAVE_SYS_RESOURCE_H
@@ -1968,7 +1967,6 @@ void
ruby_init_stack(volatile void *addr)
{
native_main_thread.id = pthread_self();
- addr = asan_get_real_stack_addr((void *)addr);
#if MAINSTACKADDR_AVAILABLE
if (native_main_thread.stack_maxsize) return;
@@ -2067,7 +2065,7 @@ native_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
if (get_stack(&start, &size) == 0) {
uintptr_t diff = (uintptr_t)start - (uintptr_t)local_in_parent_frame;
- th->ec->machine.stack_start = asan_get_real_stack_addr(local_in_parent_frame);
+ th->ec->machine.stack_start = (uintptr_t)local_in_parent_frame;
th->ec->machine.stack_maxsize = size - diff;
}
}
@@ -2194,10 +2192,12 @@ call_thread_start_func_2(rb_thread_t *th)
on a new thread, and replacing that data on fiber-switch would break it (see
bug #13887) */
VALUE stack_start = 0;
- VALUE *stack_start_addr = asan_get_real_stack_addr(&stack_start);
-
+ VALUE *stack_start_addr = &stack_start;
native_thread_init_stack(th, stack_start_addr);
thread_start_func_2(th, th->ec->machine.stack_start);
+
+ /* Ensure that stack_start really was spilled to the stack */
+ RB_GC_GUARD(stack_start)
}
static void *