HPDCS/ROOT-Sim

signal SIGUSR1 not correctly handled

Closed this issue · 1 comments

when User Level Thread is enabled,
the execution crash on raising SIGUSR1.

Here you have some insight from gdb:

Program received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x2aaabf728700 (LWP 22290)]
0x00002aaaab15e6ab in raise () from /lib64/libpthread.so.0

(gdb) bt
#0  0x00002aaaab15e6ab in raise () from /lib64/libpthread.so.0
#1  0x000000000041a008 in context_create (context=0x7b7e90, entry_point=0x411b56 <LP_main_loop>, args=0x0, 
   stack=0x2aaabf92a010, stack_size=4194304) at arch/ult.c:183
#2  0x0000000000411fd1 in initialize_LP (lp=4) at scheduler/scheduler.c:294
#3  0x000000000041204e in initialize_worker_thread () at scheduler/scheduler.c:315
#4  0x000000000040a811 in main_simulation_loop (arg=0x0) at main.c:101
#5  0x000000000040cd99 in __helper_create_thread (arg=0x7f77e0) at arch/thread.c:79
#6  0x00002aaaab156806 in start_thread () from /lib64/libpthread.so.0
#7  0x00002aaaab447b7d in clone () from /lib64/libc.so.6
#8  0x0000000000000000 in ?? ()

(gdb) up
#1  0x000000000041a008 in context_create (context=0x7b7e90, entry_point=0x411b56 <LP_main_loop>, args=0x0, 
   stack=0x2aaabf92a010, stack_size=4194304) at arch/ult.c:183
183		raise(SIGUSR1);

and here the configuration:

  * ROOT-Sim Configuration on Current Machine *

CPU Architecture.......... : x86_64 (available supports: rdtcs SSE3 SSSE3 SSE4.2 )
Operating System.......... : linux-gnu
Debugging Support......... : Enabled
User-Level Threads........ : Enabled (use --disable-ult if not wanted)
Parallel Allocator........ : Enabled (By default, use --disable-allocator if not wanted)
NUMA Subsystem............ : Enabled (by default on NUMA machines, use --disable-numa if not wanted)
LP Preemption Support..... : Disabled (libtimestretch not found)
LP Rebinding.............. : Enabled (By default, use --disable-rebinding if not wanted)

This is not a bug: it's how ULTs are actually created on Unix boxes. The signal is raised in order to create a different stack for every LP, thus allowing e.g. a preëmptable execution of events.

gdb correctly intercepts the signal. Issuing handle SIGUSR1 noprint nostop command on the debugger shell, and then continuing, ignores the signals in debug mode and allows the execution to proceed.

If it's crashing when running without a debugger, then some regression happened somewhere, but I cannot tell from this log, which appears correct with respect to how ULTs have been implemented.