Move asan_fake_stack_handle to EC, not thread
It's really a property of the EC; each fiber (which has its own EC) also has its own asan_fake_stack_handle. [Bug #20310]
This commit is contained in:
parent
ea31228d0c
commit
48d3bdddba
2
gc.c
2
gc.c
@ -6410,7 +6410,7 @@ gc_mark_machine_stack_location_maybe(rb_objspace_t *objspace, VALUE obj)
|
|||||||
void *fake_frame_start;
|
void *fake_frame_start;
|
||||||
void *fake_frame_end;
|
void *fake_frame_end;
|
||||||
bool is_fake_frame = asan_get_fake_stack_extents(
|
bool is_fake_frame = asan_get_fake_stack_extents(
|
||||||
ec->thread_ptr->asan_fake_stack_handle, obj,
|
ec->machine.asan_fake_stack_handle, obj,
|
||||||
ec->machine.stack_start, ec->machine.stack_end,
|
ec->machine.stack_start, ec->machine.stack_end,
|
||||||
&fake_frame_start, &fake_frame_end
|
&fake_frame_start, &fake_frame_end
|
||||||
);
|
);
|
||||||
|
3
thread.c
3
thread.c
@ -527,9 +527,6 @@ void
|
|||||||
ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
|
ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
|
||||||
{
|
{
|
||||||
native_thread_init_stack(th, local_in_parent_frame);
|
native_thread_init_stack(th, local_in_parent_frame);
|
||||||
#ifdef RUBY_ASAN_ENABLED
|
|
||||||
th->asan_fake_stack_handle = asan_get_thread_fake_stack_handle();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const VALUE *
|
const VALUE *
|
||||||
|
@ -2081,6 +2081,7 @@ native_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame)
|
|||||||
rb_nativethread_id_t curr = pthread_self();
|
rb_nativethread_id_t curr = pthread_self();
|
||||||
#ifdef RUBY_ASAN_ENABLED
|
#ifdef RUBY_ASAN_ENABLED
|
||||||
local_in_parent_frame = asan_get_real_stack_addr(local_in_parent_frame);
|
local_in_parent_frame = asan_get_real_stack_addr(local_in_parent_frame);
|
||||||
|
th->ec->machine.asan_fake_stack_handle = asan_get_thread_fake_stack_handle();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!native_main_thread.id) {
|
if (!native_main_thread.id) {
|
||||||
|
@ -1044,6 +1044,10 @@ struct rb_execution_context_struct {
|
|||||||
VALUE *stack_end;
|
VALUE *stack_end;
|
||||||
size_t stack_maxsize;
|
size_t stack_maxsize;
|
||||||
RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs;
|
RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs;
|
||||||
|
|
||||||
|
#ifdef RUBY_ASAN_ENABLED
|
||||||
|
void *asan_fake_stack_handle;
|
||||||
|
#endif
|
||||||
} machine;
|
} machine;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1164,11 +1168,6 @@ typedef struct rb_thread_struct {
|
|||||||
void **specific_storage;
|
void **specific_storage;
|
||||||
|
|
||||||
struct rb_ext_config ext_config;
|
struct rb_ext_config ext_config;
|
||||||
|
|
||||||
#ifdef RUBY_ASAN_ENABLED
|
|
||||||
void *asan_fake_stack_handle;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} rb_thread_t;
|
} rb_thread_t;
|
||||||
|
|
||||||
static inline unsigned int
|
static inline unsigned int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user