Browse Source

[LibOS] Copy signal handler's __kernel_sigaction in get_new_thread()

Previously, there was a bug in copy of the shim_thread::signal_handles[].action
due to sizeof on the wrong type (shim_signal_handle instead of __kernel_sigaction).
This led to incomplete action object in signal_handles[].
Isaku Yamahata 5 years ago
parent
commit
74ce0ae3e1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      LibOS/shim/src/bookkeep/shim_thread.c

+ 1 - 1
LibOS/shim/src/bookkeep/shim_thread.c

@@ -206,7 +206,7 @@ struct shim_thread * get_new_thread (IDTYPE new_tid)
 
             thread->signal_handles[i].action =
                     malloc_copy(cur_thread->signal_handles[i].action,
-                                sizeof(struct shim_signal_handle));
+                                sizeof(*thread->signal_handles[i].action));
         }
 
         memcpy(&thread->signal_mask, &cur_thread->signal_mask,