Conversation
duvanan13
commented
Jul 16, 2024
- Prevent new daemon initialization when using FIFO
- Unit test gateway IPC changes to UNIX_SOCKET
- Shared memory is used for multinode testing
- Resolve the TOCTOU issue
+ Prevent new daemon initialization when using FIFO + Unit test gateway IPC changes to UNIX_SOCKET + Shared memory is used for multinode testing + Resolve the TOCTOU issue Signed-off-by: andv <fixed-term.An.DuVan@vn.bosch.com> Signed-off-by: LUU QUANG MINH <Minh.LuuQuang@vn.bosch.com>
|
Thanks @duvanan13 for joining the pair programming section. Hello @michael-methner , could you kindly review this fix? |
|
Hello @duvanan13 , hello @minminlittleshrimp , |
|
Hello @michael-methner , dlt-daemon/src/daemon/dlt-daemon.c Line 2135 in 358ab08 Please kindly check my point. |
Signed-off-by: andv <fixed-term.An.DuVan@vn.bosch.com>
| signal(SIGHUP, dlt_daemon_signal_handler); /* hangup signal */ | ||
| signal(SIGQUIT, dlt_daemon_signal_handler); | ||
| signal(SIGINT, dlt_daemon_signal_handler); | ||
| signal(SIGSEGV, dlt_daemon_signal_handler); |
There was a problem hiding this comment.
The handler for SIGSEGV should not be added here. This will cause the application to hang in an endless loop in case a segmentation fault occurs as it will re-execute the same instruction again which caused the segmentation fault (and signal is triggered again)
| case SIGTERM: | ||
| case SIGINT: | ||
| case SIGQUIT: | ||
| case SIGSEGV: |
There was a problem hiding this comment.
SIGSEGV needs to be handled separately. For example, after calling dlt_daemon_exit_trigger() set the SIG_DFL for SIGSEGV and raise() the same signal (or just let it hit SIGSEGV on its own again).
I really don't advise calling dlt_daemon_exit_trigger() since it calls async-unsafe functions in a signal handler, but since you already break that rule I wont complain.
There was a problem hiding this comment.
It should be removed