You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can reproduce this usually with about 100-200 repeated runs of the test on the RPi4 I've been using.
Each time, a halcmd ping leaves a core dump in the test directory; halcmd ping is run by realtime as part of starting up. gdb shows it's segfaulting while trying to read something I think is from a shm segment.
I added commands to test.sh to show the processes running in the container, and in the latest failure, runtime.log shows three msgd:0 and one rtapi:0. This leads me to believe there's a race condition between the realtime script starting up, and a previous RTAPI session shutting down: perhaps the halcmd ping attaches to the old shm segment just before it is removed by the previous session, resulting in a segfault.
While that seems like a problem whose underlying cause needs closer attention (why should halcmd be allowed to attach to a segment that's being shut down?), a simpler fix would be to improve realtime stop to ensure that all rtapi:0 and msgd:0 processes are completely shut down and all shm segments are cleaned up.
Activity
zultron commentedon Aug 31, 2020
I can reproduce this usually with about 100-200 repeated runs of the test on the RPi4 I've been using.
Each time, a
halcmd pingleaves a core dump in the test directory;halcmd pingis run byrealtimeas part of starting up.gdbshows it's segfaulting while trying to read something I think is from ashmsegment.I added commands to
test.shto show the processes running in the container, and in the latest failure,runtime.logshows threemsgd:0and onertapi:0. This leads me to believe there's a race condition between therealtimescript starting up, and a previous RTAPI session shutting down: perhaps thehalcmd pingattaches to the oldshmsegment just before it is removed by the previous session, resulting in asegfault.While that seems like a problem whose underlying cause needs closer attention (why should
halcmdbe allowed to attach to a segment that's being shut down?), a simpler fix would be to improverealtime stopto ensure that allrtapi:0andmsgd:0processes are completely shut down and allshmsegments are cleaned up.