Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program with D435 Segmentation fault (core dumped) #10112

Closed
Earl-chen opened this issue Dec 28, 2021 · 3 comments · Fixed by bitbrain-za/librealsense#2
Closed

Program with D435 Segmentation fault (core dumped) #10112

Earl-chen opened this issue Dec 28, 2021 · 3 comments · Fixed by bitbrain-za/librealsense#2

Comments

@Earl-chen
Copy link

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { D435 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Ubuntu 18.04.4 LTS
Kernel Version (Linux Only) 4.9.140-tegra
Platform NVIDIA Jetson nano
SDK Version { librealsens 2.25.0 }
Language {C++ }
Segment {Robot }

Issue Description

hello,

My code use one D435.

When the program runs for more than an hour or so, errors occur. GDB returns the following information:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  __GI___pthread_mutex_lock (mutex=0x20) at pthread_mutex_lock.c:65
65	pthread_mutex_lock.c: No such file or directory.
[Current thread is 1 (Thread 0x7f98d911e0 (LWP 25861))]
(gdb) bt
#0  __GI___pthread_mutex_lock (mutex=0x20) at pthread_mutex_lock.c:65
#1  0x0000007fb3a43f34 in libusb_get_device_list () from /lib/aarch64-linux-gnu/libusb-1.0.so.0
#2  0x0000007fb5ba67b4 in librealsense::platform::usb_context::usb_context (this=0x7f74027fe0) at /home/ubuntu/work/librealsense/src/libusb/context-libusb.cpp:18
#3  0x0000007fb5bc4348 in __gnu_cxx::new_allocator<librealsense::platform::usb_context>::construct<librealsense::platform::usb_context> (this=0x7f98d90278, __p=0x7f74027fe0)
    at /usr/include/c++/7/ext/new_allocator.h:136
#4  0x0000007fb5bc3e80 in std::allocator_traits<std::allocator<librealsense::platform::usb_context> >::construct<librealsense::platform::usb_context> (__a=..., __p=0x7f74027fe0)
    at /usr/include/c++/7/bits/alloc_traits.h:475
#5  0x0000007fb5bc3890 in std::_Sp_counted_ptr_inplace<librealsense::platform::usb_context, std::allocator<librealsense::platform::usb_context>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<librealsense::platform::usb_context>) (this=0x7f74027fd0, __a=...) at /usr/include/c++/7/bits/shared_ptr_base.h:526
#6  0x0000007fb5bc31d8 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<librealsense::platform::usb_context, std::allocator<librealsense::platform::usb_context>>(std::_Sp_make_shared_tag, librealsense::platform::usb_context*, std::allocator<librealsense::platform::usb_context> const&) (this=0x7f98d903f0, __a=...) at /usr/include/c++/7/bits/shared_ptr_base.h:637
#7  0x0000007fb5bc2df8 in std::__shared_ptr<librealsense::platform::usb_context, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<librealsense::platform::usb_context>>(std::_Sp_make_shared_tag, std::allocator<librealsense::platform::usb_context> const&) (this=0x7f98d903e8, __tag=..., __a=...) at /usr/include/c++/7/bits/shared_ptr_base.h:1295
#8  0x0000007fb5bc289c in std::shared_ptr<librealsense::platform::usb_context>::shared_ptr<std::allocator<librealsense::platform::usb_context>>(std::_Sp_make_shared_tag, std::allocator<librealsense::platform::usb_context> const&) (this=0x7f98d903e8, __tag=..., __a=...) at /usr/include/c++/7/bits/shared_ptr.h:344
#9  0x0000007fb5bc25fc in std::allocate_shared<librealsense::platform::usb_context, std::allocator<librealsense::platform::usb_context>>(std::allocator<librealsense::platform::usb_context> const&) (__a=...)
    at /usr/include/c++/7/bits/shared_ptr.h:691
#10 0x0000007fb5bc22f0 in std::make_shared<librealsense::platform::usb_context> () at /usr/include/c++/7/bits/shared_ptr.h:707
#11 0x0000007fb5bc0194 in librealsense::platform::usb_enumerator::query_devices_info () at /home/ubuntu/work/librealsense/src/libusb/enumerator-libusb.cpp:83
#12 0x0000007fb5bd07f4 in librealsense::platform::v4l_backend::query_usb_devices (this=0x55bd5d2ca0) at /home/ubuntu/work/librealsense/src/linux/backend-v4l2.cpp:1894
#13 0x0000007fb5bd9348 in librealsense::polling_device_watcher::polling (this=0x55bd5d2fc0, cancellable_timer=...) at /home/ubuntu/work/librealsense/src/linux/../polling-device-watcher.h:34
#14 0x0000007fb5bd8e68 in librealsense::polling_device_watcher::polling_device_watcher(librealsense::platform::backend const*)::{lambda(dispatcher::cancellable_timer)#1}::operator()(dispatcher::cancellable_timer) const (__closure=0x55bd5d2fc8, cancellable_timer=...) at /home/ubuntu/work/librealsense/src/linux/../polling-device-watcher.h:21
#15 0x0000007fb5bddae8 in std::_Function_handler<void (dispatcher::cancellable_timer), librealsense::polling_device_watcher::polling_device_watcher(librealsense::platform::backend const*)::{lambda(dispatcher::cancellable_timer)#1}>::_M_invoke(std::_Any_data const&, dispatcher::cancellable_timer&&) (__functor=..., __args#0=...) at /usr/include/c++/7/bits/std_function.h:316
#16 0x0000007fb57fd1b8 in std::function<void (dispatcher::cancellable_timer)>::operator()(dispatcher::cancellable_timer) const (this=0x55bd5d2fc8, __args#0=...) at /usr/include/c++/7/bits/std_function.h:706
#17 0x0000007fb57fcfc8 in active_object<std::function<void (dispatcher::cancellable_timer)> >::do_loop()::{lambda(dispatcher::cancellable_timer)#1}::operator()(dispatcher::cancellable_timer) const (
    __closure=0x7f98d908c8, ct=...) at /home/ubuntu/work/librealsense/src/concurrency.h:444
#18 0x0000007fb57fd938 in std::_Function_handler<void (dispatcher::cancellable_timer), active_object<std::function<void (dispatcher::cancellable_timer)> >::do_loop()::{lambda(dispatcher::cancellable_timer)#1}>::_M_invoke(std::_Any_data const&, dispatcher::cancellable_timer&&) (__functor=..., __args#0=...) at /usr/include/c++/7/bits/std_function.h:316
#19 0x0000007fb57fd1b8 in std::function<void (dispatcher::cancellable_timer)>::operator()(dispatcher::cancellable_timer) const (this=0x7f98d908c8, __args#0=...) at /usr/include/c++/7/bits/std_function.h:706
#20 0x0000007fb5cba714 in dispatcher::<lambda()>::operator()(void) const (__closure=0x55bd5d3588) at /home/ubuntu/work/librealsense/src/dispatcher.cpp:31
#21 0x0000007fb5cbc608 in std::__invoke_impl<void, dispatcher::dispatcher(unsigned int, std::function<void(std::function<void(const dispatcher::cancellable_timer&)>)>)::<lambda()> >(std::__invoke_other, dispatcher::<lambda()> &&) (__f=...) at /usr/include/c++/7/bits/invoke.h:60
#22 0x0000007fb5cbb498 in std::__invoke<dispatcher::dispatcher(unsigned int, std::function<void(std::function<void(const dispatcher::cancellable_timer&)>)>)::<lambda()> >(dispatcher::<lambda()> &&) (__fn=...)
    at /usr/include/c++/7/bits/invoke.h:95
#23 0x0000007fb5cbd9f0 in std::thread::_Invoker<std::tuple<dispatcher::dispatcher(unsigned int, std::function<void(std::function<void(const dispatcher::cancellable_timer&)>)>)::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x55bd5d3588) at /usr/include/c++/7/thread:234
#24 0x0000007fb5cbd9a4 in std::thread::_Invoker<std::tuple<dispatcher::dispatcher(unsigned int, std::function<void(std::function<void(const dispatcher::cancellable_timer&)>)>)::<lambda()> > >::operator()(void)
    (this=0x55bd5d3588) at /usr/include/c++/7/thread:243
#25 0x0000007fb5cbd970 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<dispatcher::dispatcher(unsigned int, std::function<void(std::function<void(const dispatcher::cancellable_timer&)>)>)::<lambda()> > > >::_M_run(void) (this=0x55bd5d3580) at /usr/include/c++/7/thread:186
#26 0x0000007fb3d57e94 in ?? () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#27 0x0000007fb4748088 in start_thread (arg=0x7ff08fa18f) at pthread_create.c:463
#28 0x0000007fb3b354ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78

What could possibly have caused this?

@MartyG-RealSense
Copy link
Collaborator

Hi @Earl-chen Would it be possible to monitor memory usage during the running of your application to see whether memory is being consumed over time (a 'memory leak'). An example of such a system monitoring tool in Ubuntu is htop.

A memory leak would cause an active program's performance to decline over time as available memory is consumed by the leak, to the point where the program may eventually freeze or crash.

@MartyG-RealSense
Copy link
Collaborator

Hi @Earl-chen Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants