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

TF display segfault (openni_tracker related) #808

Closed
jkramer3 opened this issue Aug 27, 2014 · 5 comments
Closed

TF display segfault (openni_tracker related) #808

jkramer3 opened this issue Aug 27, 2014 · 5 comments
Labels

Comments

@jkramer3
Copy link

I'm attempting to play a bag file captured from openni_tracker (skeleton tracking using the kinect), with an additional (custom) frame meant to provide a global reference. The custom frame is produced using a static transform publisher started in the launch file. During playback, RViz crashes if the TF plugin is loaded. If I don't load the TF plugin, RViz is fine; other nodes I'm running that do transforms between global and other frames also seem happy.

The crash can be reproduced by launching the following (note that I left gdb in there):

<launch>
  <param name="use_sim_time" type="bool" value="true" />
  <node pkg="tf" type="static_transform_publisher" name="depth_2_global" args="3.0 0.25 0 0 0 0 /global /camera_link 100"/>
  <node pkg="rviz" name="rviz" type="rviz" output="screen" launch-prefix="gdb -ex run --args" args="-d tf_debug.rviz" />
</launch>

then playing a bag file that recorded the /tf topic produced by openni_tracker:

rosbag play --clock skeleton.bag

I'm not sure I got the static transform correct, which is why I was attempting to view the TF frames. Since I can't post the bag file and the .rviz file is a bit unwieldy, all three files (gdb_rviz.launch, skeleton.bag.tar.gz, and tf_debug.rviz) are available at: https://personal.traclabs.com/~jkramer3/.

The crash happens about 8 seconds in, with the following gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7b03221 in rviz::Property::Property(QString const&, QVariant, QString const&, rviz::Property*, char const*, QObject*) () from /opt/ros/hydro/lib/librviz.so
#2  0x00007fffb03d64f2 in rviz::TFDisplay::updateFrame(rviz::FrameInfo*) ()
   from /opt/ros/hydro/lib/libdefault_plugin.so
#3  0x00007fffb03d8189 in rviz::TFDisplay::createFrame(std::string const&) ()
   from /opt/ros/hydro/lib/libdefault_plugin.so
#4  0x00007fffb03d875e in rviz::TFDisplay::updateFrames() () from /opt/ros/hydro/lib/libdefault_plugin.so
#5  0x00007fffb03d8826 in rviz::TFDisplay::update(float, float) () from /opt/ros/hydro/lib/libdefault_plugin.so
#6  0x00007ffff7aa4a91 in rviz::DisplayGroup::update(float, float) () from /opt/ros/hydro/lib/librviz.so
#7  0x00007ffff7b53749 in rviz::VisualizationManager::onUpdate() () from /opt/ros/hydro/lib/librviz.so
#8  0x00007ffff2c17281 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007ffff2c1c179 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007ffff6ec7894 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007ffff6ecc713 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff2c02e9c in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#13 0x00007ffff2c341f2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007ffff2c31c0d in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff1987d13 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff1988060 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff1988124 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff2c32426 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007ffff6f6fd9e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007ffff2c01c82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff2c01ed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007ffff2c06f67 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#23 0x0000000000400b0c in main ()

I'm running hydro on Ubuntu 12.04, everything up to date as of today.

@wjwwood
Copy link
Member

wjwwood commented Aug 27, 2014

Thanks for the report, and for taking the time to describe how to reproduce it.

Looks like the problem manifest at either:

https://github.com/ros-visualization/rviz/blob/indigo-devel/src/rviz/default_plugin/tf_display.cpp#L578

or

https://github.com/ros-visualization/rviz/blob/indigo-devel/src/rviz/default_plugin/tf_display.cpp#L643

Though neither jump out at me as implicitly wrong. Unfortunately, without a traceback on rviz built with debug, this isn't going to be enough information.

My rviz issue queue is pretty backed up, so I probably won't have time to reproduce this problem locally in the near term.

@OkkeHendriks
Copy link

Hello, I am also seeing a crash of rviz (segmentation fault) when running a minimal rviz config with only tf enabled. It seems to only be happening when there are appearing/disappearing transforms.

A bag file which crashes rviz at the end of the bag: rviz_tf_crash_ar_markers.bag

In this bag file our robot is driving in our office and the ar_track_alvar node is running. On the wall there are a number of markers which you can see appear and disappear a number of times. When driving around with ar_track_alvar disabled or when the markers are not in the field of view of the kinect rviz seems not crash.

I'm also running hydro on Ubuntu 12.04, everything up to date as of today.

Rviz GDB backtrace:

Starting program: /opt/ros/hydro/bin/rviz 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
/opt/ros/hydro/bin/rviz: /home/okke/git/rose2_0/shared/src/third_party/robai/lib/libcurl.so.4: no version information available (required by /opt/ros/hydro/lib/libresource_retriever.so)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffde1c6700 (LWP 28293)]
[New Thread 0x7fffdd9c5700 (LWP 28294)]
[New Thread 0x7fffd7fff700 (LWP 28295)]
1417018163.020242937|ros.rviz[ INFO]: rviz version 1.10.18
1417018163.020349879|ros.rviz[ INFO]: compiled against OGRE version 1.7.4 (Cthugha)
[New Thread 0x7fffd6f6a700 (LWP 28298)]
[New Thread 0x7fffd6769700 (LWP 28299)]
[New Thread 0x7fffd5f68700 (LWP 28300)]
[New Thread 0x7fffd5767700 (LWP 28305)]
[New Thread 0x7fffb557a700 (LWP 28306)]
[New Thread 0x7fffb4d79700 (LWP 28307)]
[New Thread 0x7fffaffff700 (LWP 28308)]
[New Thread 0x7fffaf7fe700 (LWP 28309)]
[New Thread 0x7fffaeffd700 (LWP 28310)]
[New Thread 0x7fffae7fc700 (LWP 28311)]
[New Thread 0x7fffadffb700 (LWP 28312)]
[New Thread 0x7fffad7fa700 (LWP 28313)]
1417018163.769125339|ros.rviz[ INFO]: Stereo is NOT SUPPORTED
1417018163.769230136|ros.rviz[ INFO]: OpenGl version: 3 (GLSL 1.3).
[New Thread 0x7fff8ffff700 (LWP 28316)]
[New Thread 0x7fff8f7fe700 (LWP 28317)]
[New Thread 0x7fff8e16a700 (LWP 28326)]
[Thread 0x7fffd7fff700 (LWP 28295) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b1012b in rviz::Property::Property(QString const&, QVariant, QString const&, rviz::Property*, char const*, QObject*) ()
   from /opt/ros/hydro/lib/librviz.so
(gdb) backtrace
#0  0x00007ffff7b1012b in rviz::Property::Property(QString const&, QVariant, QString const&, rviz::Property*, char const*, QObject*)
    ()
   from /opt/ros/hydro/lib/librviz.so
#1  0x00007fff8ed0c8a4 in rviz::TFDisplay::updateFrame(rviz::FrameInfo*) ()
   from /opt/ros/hydro/lib/libdefault_plugin.so
#2  0x00007fff8ed0dee1 in rviz::TFDisplay::createFrame(std::string const&) ()
   from /opt/ros/hydro/lib/libdefault_plugin.so
#3  0x00007fff8ed0e45e in rviz::TFDisplay::updateFrames() ()
   from /opt/ros/hydro/lib/libdefault_plugin.so
#4  0x00007fff8ed0e526 in rviz::TFDisplay::update(float, float) ()
   from /opt/ros/hydro/lib/---Type <return> to continue, or q <return> to quit---
libdefault_plugin.so
#5  0x00007ffff7ab3651 in rviz::DisplayGroup::update(float, float) ()
   from /opt/ros/hydro/lib/librviz.so
#6  0x00007ffff7b5f1d9 in rviz::VisualizationManager::onUpdate() ()
   from /opt/ros/hydro/lib/librviz.so
#7  0x00007ffff2c21281 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007ffff2c26179 in QObject::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007ffff6ed9894 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
---Type <return> to continue, or q <return> to quit---
#10 0x00007ffff6ede713 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007ffff2c0ce9c in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#12 0x00007ffff2c3e1f2 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#13 0x00007ffff2c3bc0d in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007ffff2c3bc31 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff1991d13 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff1992060 in ?---Type <return> to continue, or q <return> to quit---
? ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff1992124 in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff2c3c3bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007ffff6f81d9e in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007ffff2c0bc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff2c0bed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007ffff2c10f67 in QCoreApplication::exec() ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#23 0x0000000000400b0c in main ()

@wjwwood
Copy link
Member

wjwwood commented Dec 4, 2014

Thanks for the added comment @OkkeHendriks, unfortunately your backtrace is also of a non-debug version of rviz, and so there are no line numbers to give us a hint, but it is most likely a cross thread race condition in this code path.

arntanguy added a commit to arntanguy/rviz that referenced this issue Oct 9, 2015
…et/create

Do not needlessly delete tree_property_ elements, update them instead.

Most likely fixes ros-visualization#808 too.
arntanguy added a commit to arntanguy/rviz that referenced this issue Oct 9, 2015
…et/update

Do not needlessly delete tree_property_ elements, update them instead.

Most likely fixes ros-visualization#808 too.
@wjwwood
Copy link
Member

wjwwood commented Oct 9, 2015

I found that #926 solved this issue on my machine using the skeleton bag example in the OP. Please comment if anyone still has a problem with this.

Unfortunately it will only go out into Indigo and Jade since Hydro is eol and I cannot make new releases of it.

@frovida
Copy link

frovida commented Nov 19, 2015

Hi wjwwood,

I'm getting into the same segfault on rviz whenever I add a new tf. This is the debug output:
Program received signal SIGSEGV, Segmentation fault.
0x00007fff9d3eb882 in rviz::TFDisplay::updateFrame(rviz::FrameInfo_) ()
from /opt/ros/indigo/lib/libdefault_plugin.so
(gdb) backtrace
#0 0x00007fff9d3eb882 in rviz::TFDisplay::updateFrame(rviz::FrameInfo_) ()
from /opt/ros/indigo/lib/libdefault_plugin.so
#1 0x00007fff9d3ecf57 in rviz::TFDisplay::updateFrames() ()
from /opt/ros/indigo/lib/libdefault_plugin.so
#2 0x00007fff9d3ed1d6 in rviz::TFDisplay::update(float, float) ()
from /opt/ros/indigo/lib/libdefault_plugin.so
#3 0x00007ffff7aa5a12 in rviz::DisplayGroup::update(float, float) ()
from /opt/ros/indigo/lib/librviz.so
#4 0x00007ffff7b47f5e in rviz::VisualizationManager::onUpdate() ()
from /opt/ros/indigo/lib/librviz.so
#5 0x00007ffff2e2187a in QMetaObject::activate(QObject_, QMetaObject const_, int, void*) ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6 0x00007ffff2e25a31 in QObject::event(QEvent
) ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

I'm sorry, I don't know how to extract info about the exact line of the error, and I saw that the updateFrame function is quite huge xD

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

No branches or pull requests

4 participants