Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#420] Do not treat case of signal forwarded from MAIN worker thread …
…as a new signal; Reuse pre-existing info/context from original signal handler for this case too Fixes an occasional dual_fail_extend/dual_fail2_mustop_sigquit subtest failure where a KILLBYSIGUINFO message is expected when another process sends a SIG-3 but instead we see a KILLBYSIGSINFO1 message in the .mje file. Below is one such stack trace where such an incorrect message gets sent out. While we were handling the SIG-3 in a deferred fashion (through deferred_signal_handler()), another SIG-3 came in from the MAIN worker thread which drove generic_signal_handler() in a nested fashion and caused the issue. (gdb) where #0 __pthread_kill () at ../sysdeps/unix/sysv/linux/pthread_kill.c:57 #1 gtm_dump_core () at sr_unix/gtm_dump_core.c:72 #2 ch_cond_core () at sr_unix/ch_cond_core.c:77 #3 rts_error_va () at sr_unix/rts_error.c:194 #4 rts_error_csa () at sr_unix/rts_error.c:101 #5 generic_signal_handler () at sr_unix/generic_signal_handler.c:195 #6 <signal handler called> #7 semop () at ../sysdeps/unix/sysv/linux/semop.c:30 #8 try_semop_get_c_stack () at sr_unix/gtm_c_stack_trace_semop.c:59 #9 ftok_sem_lock () at sr_unix/ftok_sems.c:232 #10 gds_rundown () at sr_unix/gds_rundown.c:324 #11 gv_rundown () at sr_port/gv_rundown.c:123 #12 gtm_exit_handler () at sr_unix/gtm_exit_handler.c:215 #13 __run_exit_handlers () at exit.c:108 #14 __GI_exit () at exit.c:139 #15 gtm_image_exit () at sr_unix/gtm_image_exit.c:27 #16 generic_signal_handler () at sr_unix/generic_signal_handler.c:361 #17 ydb_stm_invoke_deferred_signal_handler () at sr_unix/ydb_stm_invoke_deferred_signal_handler.c:51 #18 deferred_signal_handler () at sr_port/deferred_signal_handler.c:55 #19 tp_tend () at sr_port/tp_tend.c:1887 #20 op_tcommit () at sr_port/op_tcommit.c:496 This is now fixed by checking if the signal came in from another thread in the same process (SI_TKILL) and if so treat this as a forwarded signal and not reset info/context but instead reuse whatever was there from the original signal handler invocation. A consequence of this change is that a pre-existing assert (that checked "stapi_signal_handler_deferred") could now fail. That is now removed.
- Loading branch information