vectorgrp / sil-kit

Vector SIL Kit – Open-Source Library for Connecting Software-in-the-Loop Environments
https://vectorgrp.github.io/sil-kit-docs
MIT License
107 stars 32 forks source link

-- utilities: signal monitor: do not call signal handler upon destruction #43

Closed VDanielEdwards closed 6 months ago

VDanielEdwards commented 6 months ago

Subject

The sil-kit-system-controller currently crashes (SEGFAULT) if the simulation is stopped externally. This happens because the handler is called when the SignalMonitor instance is destroyed, and the handler calls the logging functions on a destroyed object.

The fix checks that the signal number is not the 'default' / 'invalid' signal number before calling the handler.

Instructions for review / testing

Please run the system controller and a participant that can be stopped 'by hand' without exiting the process. Then, when the participant stops, the system controller should exit normally. Check the exit code (PowerShell: $LASTEXITCODE, shell: $?).

Developer checklist (address before review)