diff --git a/LibOS/shim/include/shim_internal.h b/LibOS/shim/include/shim_internal.h index 2838921b..31b348f4 100644 --- a/LibOS/shim/include/shim_internal.h +++ b/LibOS/shim/include/shim_internal.h @@ -161,8 +161,6 @@ void syscall_wrapper_after_syscalldb(void); #define SHIM_ARG_TYPE long -void check_stack_hook (void); - static inline int64_t get_cur_preempt (void) { shim_tcb_t* tcb = shim_get_tcb(); assert(tcb); @@ -173,8 +171,7 @@ static inline int64_t get_cur_preempt (void) { SHIM_ARG_TYPE __shim_##name(args) { \ SHIM_ARG_TYPE ret = 0; \ int64_t preempt = get_cur_preempt(); \ - __UNUSED(preempt); \ - /* check_stack_hook(); */ + __UNUSED(preempt); #define END_SHIM(name) \ handle_signals(); \ diff --git a/LibOS/shim/src/shim_init.c b/LibOS/shim/src/shim_init.c index f2df69d8..c7493001 100644 --- a/LibOS/shim/src/shim_init.c +++ b/LibOS/shim/src/shim_init.c @@ -870,22 +870,6 @@ int create_handle (const char * prefix, char * uri, size_t size, id ? : &suffix, hdl, NULL); } -void check_stack_hook (void) -{ - struct shim_thread * cur_thread = get_cur_thread(); - - void* rsp = current_stack(); - - if (rsp <= cur_thread->stack_top && rsp > cur_thread->stack) { - if ((uintptr_t)rsp - (uintptr_t)cur_thread->stack < PAL_CB(alloc_align)) - SYS_PRINTF("*** stack is almost drained (RSP = %p, stack = %p-%p) ***\n", - rsp, cur_thread->stack, cur_thread->stack_top); - } else { - SYS_PRINTF("*** context dismatched with thread stack (RSP = %p, stack = %p-%p) ***\n", - rsp, cur_thread->stack, cur_thread->stack_top); - } -} - noreturn void shim_clean_and_exit(int exit_code) { static int in_terminate = 0; if (__atomic_add_fetch(&in_terminate, 1, __ATOMIC_RELAXED) > 1) {