浏览代码

[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 年之前
父节点
当前提交
74ce0ae3e1
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 =
             thread->signal_handles[i].action =
                     malloc_copy(cur_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,
         memcpy(&thread->signal_mask, &cur_thread->signal_mask,