Shared Memory Segments may be unmapped or unlinkced while in use #3408
hg-zt
started this conversation in
Unofficial support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm using ros2 with fastdds as the middleware.
For data sharing publishers and subscribers, when the publisher is shutdown (Ctrl-C or SIGKILL), subscribers sometimes crash with segfault.
By tracing with GDB,
/proc/{pid}/maps
and/dev/shm
, I found the mapped memory could be unmapped (munmap
is called and the mapping disappeared fromproc/{pid}/maps
) or unlinked (disappeared in/dev/shm
) even if the subscriber callback which is using the data has not finished.The backtrace for munmap
The profile
I'm not sure if its a dds issue or ros2 issue. I guess there should be some reference-counting mechanisms (shared_ptr) for keeping the mapping valid while in use instead of releasing the segments immediately when the writer status is changed?
Beta Was this translation helpful? Give feedback.
All reactions