Launching Nx server with address sanitizer
AnsweredAddress sanitizer worked with Nx 4.2 but I can't launch it now.
I've added the following to my CMakeLists.txt:
target_compile_options(my_plugin PRIVATE -fno-omit-frame-pointer -fsanitize=address)
target_link_options(my_plugin PRIVATE -fsanitize=address -fno-omit-frame-pointer)
And I launch it with the following command:
sudo ASAN_OPTIONS=detect_leaks=0:alloc_dealloc_mismatch=0 LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libasan.so.4 /opt/digitalwatchdog/mediaserver/bin/mediaserver
The result is:
[plugin] Created IPlugin @0x7f673be690 of vivotek_analytics_plugin
nx::utils::log::File(0x7f67917780): /opt/digitalwatchdog/mediaserver/var/log/hw_log.log
nx::utils::log::File(0x7f6790b180): /opt/digitalwatchdog/mediaserver/var/log/hw_log.log
Got hwID "{3ae09d68-ba16-e5bf-4b51-c6572c11c22b}"
nx_system_commands.ini (absent) To fill in defaults, touch /home/nvidia/.config/nx_ini/nx_system_commands.ini
db_helper.ini (absent) To fill in defaults, touch /home/nvidia/.config/nx_ini/db_helper.ini
ASAN:DEADLYSIGNAL
=================================================================
==6113==ERROR: AddressSanitizer: SEGV on unknown address 0x007f24000000 (pc 0x007f73db1914 bp 0x007f5e2fcb20 sp 0x007f5e2fcb20 T11)
==6113==The signal is caused by a READ memory access.
#0 0x7f73db1913 in free (/lib/aarch64-linux-gnu/libc.so.6+0x77913)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/aarch64-linux-gnu/libc.so.6+0x77913) in free
Thread T11 (MediaServerProc) created by T0 here:
#0 0x7f773799a7 in pthread_create (/usr/lib/aarch64-linux-gnu/libasan.so.4+0x389a7)
#1 0x7f7412fd7f in QThread::start(QThread::Priority) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0xc9d7f)
#2 0x7f7433a3a3 in QObject::event(QEvent*) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x2d43a3)
#3 0x7f7430bd13 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x2a5d13)
#4 0x7f7430edb7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x2a8db7)
#5 0x7f74367197 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x301197)
#6 0x7f6ba5fd7f in g_main_context_dispatch (/usr/lib/aarch64-linux-gnu/libglib-2.0.so.0+0x4ed7f)
#7 0x7f6ba5ffdb (/usr/lib/aarch64-linux-gnu/libglib-2.0.so.0+0x4efdb)
#8 0x7f6ba6007b in g_main_context_iteration (/usr/lib/aarch64-linux-gnu/libglib-2.0.so.0+0x4f07b)
#9 0x7f743666a3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x3006a3)
#10 0x7f7430a3d3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x2a43d3)
#11 0x7f74312d67 in QCoreApplication::exec() (/opt/digitalwatchdog/mediaserver/bin/../lib/libQt5Core.so.5+0x2acd67)
#12 0x7f760c28cb in QnVideoService::executeApplication() /home/jenkins/release.vms.vms_5.0.linux_arm64-3/nx_vms/vms/server/nx_vms_server/src/media_server_process.cpp:3785
#13 0x7f76a9631f in QtServiceBasePrivate::run(bool, QStringList const&) /home/jenkins/release.vms.vms_5.0.linux_arm64-3/nx_vms/artifacts/qt-solutions/qtservice/src/qtservice.cpp:477
#14 0x7f75d01c2f in MediaServerProcess::main(int, char**) /home/jenkins/release.vms.vms_5.0.linux_arm64-3/nx_vms/vms/server/nx_vms_server/src/media_server_process.cpp:3910
#15 0x7f73d5a71f in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x2071f)
#16 0x555d01641f (/opt/digitalwatchdog/mediaserver/bin/mediaserver+0xf41f)
==6113==ABORTING
What can I do?
UPD: you can test it even without compiling plugin, just try to launch it on some Jetson device.
-
Hello Hendrik Baekeland,
What is OS, gcc version on your Jetson?
Have you tried with the 5.0 release version?
Have you tried to load just the Server without plugins? What is the outpout?
JIRA-VMS-35343
0 -
Hello Andrey,
Thank you for your answer,
OS info:
Ubuntu 18.04.6
R32 (release), REVISION: 6.1 (Jetpack 4.6)
$ gcc --version
gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
$ dpkg -l | grep asan
ii libasan4:arm64 7.5.0-3ubuntu1~18.04 arm64 AddressSanitizer -- a fast memory error detector
The output without plugins is the same as in the first post.0 -
Hello Hendrik Baekeland,
This seems to be fixed and be available in the upcoming monthly patch.
To run Server with Address Sanitizer you have to set the
disableLinuxPluginDeepBindoption invms_server_plugins.inifile totrue.0 -
Thanks, Andrey
0
Please sign in to leave a comment.
Comments
4 comments