librealsense: Segfault when playing back prerecorded file
Required Info | |
---|---|
Camera Model | Prerecorded video from D435 |
Firmware Version | N/A |
Operating System & Version | Linux (Ubuntu 18.04) |
Kernel Version (Linux Only) | 5.10.25-linuxkit |
Platform | x64 VM, x64 Docker container (nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu18.04) |
SDK Version | 2.50 |
Language | Python 3.6.9 |
Segment | Other |
Issue Description
- Our application starts by loading a small “blank” BAG file to display to the user prior to a camera being connected.
- This file is only a couple of second long, and was recorded on a D435 while covering the sensors so that everything was blackened.
- After approx 3 minutes of pre-recorded video looping (sometimes sooner), our application crashes with a Segmentation Fault.
- This fault does not seem to consistently occur on a specific line during the execution of our main loop (i.e. on a specific function call), which leads me to believe the segfault is triggered by a background thread within the realsense sdk
- I’ve attached a GDB session to the runtime and I get the following backtrace when the segfault occurs
Thread 12 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe5f1e700 (LWP 45183)]
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:435
435 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0 0x00007ffff7b70bb4 in __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:435
#1 0x00007fff575b9fe5 in XXH32_update () at /usr/lib/x86_64-linux-gnu/liblz4.so.1
#2 0x00007fff3ad0e14e in decompressBlock () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#3 0x00007fff3ad0e269 in roslz4_decompress () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#4 0x00007fff3ad0e3fd in roslz4_buffToBuffDecompress () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#5 0x00007fff3ad0c861 in rosbag::LZ4Stream::decompress(unsigned char*, unsigned int, unsigned char*, unsigned int) () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#6 0x00007fff3acfbddc in rosbag::ChunkedFile::decompress(rosbag::compression::CompressionType, unsigned char*, unsigned int, unsigned char*, unsigned int) () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#7 0x00007fff3ad02a6b in rosbag::Bag::decompressChunk(unsigned long) const () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#8 0x00007fff3ab1e142 in std::shared_ptr<diagnostic_msgs::KeyValue_<std::allocator<void> > > rosbag::Bag::instantiateBuffer<diagnostic_msgs::KeyValue_<std::allocator<void> > >(rosbag::IndexEntry const&) const ()
at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#9 0x00007fff3ab1ef60 in diagnostic_msgs::KeyValue_<std::allocator<void> >::ConstPtr librealsense::ros_reader::instantiate_msg<diagnostic_msgs::KeyValue_<std::allocator<void> > >(rosbag::MessageInstance const&) ()
at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#10 0x00007fff3aaef3d1 in librealsense::ros_reader::get_frame_metadata(rosbag::Bag const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, librealsense::device_serializer::stream_identifier const&, rosbag::MessageInstance const&,
librealsense::frame_additional_data&) () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#11 0x00007fff3aaf930f in librealsense::ros_reader::create_image_from_message(rosbag::MessageInstance const&) const () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#12 0x00007fff3aafca65 in librealsense::ros_reader::create_frame(rosbag::MessageInstance const&) () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#13 0x00007fff3aafd0c2 in librealsense::ros_reader::read_next_data() () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#14 0x00007fff3a98a01c in () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#15 0x00007fff3a98ba49 in () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#16 0x00007fff3aa61060 in () at /usr/local/lib/python3.6/dist-packages/pyrealsense2/pyrealsense2.cpython-36m-x86_64-linux-gnu.so
#17 0x00007fffeb1e1a50 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#18 0x00007ffff77ca6db in start_thread (arg=0x7fffe5f1e700) at pthread_create.c:463
#19 0x00007ffff7b0361f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
- Here is a (modified/redacted) snippet of how we set up our pipeline based on our code:
def init(self):
self.pipeline = rs.pipeline()
self.config = rs.config()
rs.config.enable_device_from_file(self.config, file_path, True) # Repeat playback = True
self.config.enable_all_streams()
# This block retrieves the sensor intrinsics by starting the pipeline. Once we have the intrinsics we stop it
profile = self.pipeline.start(config)
depth_profile = rs.video_stream_profile(profile.get_stream(rs.stream.depth))
color_profile = rs.video_stream_profile(profile.get_stream(rs.stream.color))
self.depth_intrinsics = Intrinsics(depth_profile.get_intrinsics())
self.color_intrinsics = Intrinsics(color_profile.get_intrinsics())
self.pipeline.stop()
def start(self):
playback = self.profile.get_device().as_playback()
playback.set_real_time(True)
# Wait for the first frame with a longer timeout because large recorded files can take a while for the first frame to arrive
self.pipeline.wait_for_frames(FRAME_WAIT_TIMEOUT_STARTUP)
Other notes:
- This failure only happens in some environments. For environments where the failure occurs, it is reliably reproducible.
- We have observed this failure in a Docker container based on nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu18.04
- We have observed this failure if run in a VM, but not all VMs. For instance I do not get the problem in my 18.04 VM run on Parallels Desktop (OSX), but my colleague does get the error when run under VMWare Workstation (Windows 11)
- This problem happens on any bag file, but I’ve uploaded the relevant
.bag
file we use for reproducing the issue here: https://www.icloud.com/iclouddrive/001aH2Ru3LFmc79ZlC5yRTK1A#_blank_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 41
I just posted a new comment above at the exact moment that you did. 😃