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

Segfault on launch with Debian build of Rviz #1026

Closed
cdellin opened this issue Jun 16, 2016 · 18 comments
Closed

Segfault on launch with Debian build of Rviz #1026

cdellin opened this issue Jun 16, 2016 · 18 comments
Labels

Comments

@cdellin
Copy link

cdellin commented Jun 16, 2016

(Note: I'm not sure where to file this bug ... perhaps there's a place that's appropriate for packaging bugs?)

I installed the ros-kinetic-rviz package, and I get the following segfault:

$ gdb --args /opt/ros/kinetic/lib/rviz/rviz
...
Program received signal SIGSEGV, Segmentation fault.
0x00007fffd9608dbc in ?? () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
(gdb) where
#0  0x00007fffd9608dbc in ?? () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#1  0x00007ffff7dea9ba in call_init (l=<optimized out>, argc=argc@entry=1, 
    argv=argv@entry=0x7fffffffe128, env=env@entry=0x7fffffffe138)
    at dl-init.c:78
#2  0x00007ffff7deaaa3 in call_init (env=0x7fffffffe138, argv=0x7fffffffe128, 
    argc=1, l=<optimized out>) at dl-init.c:36
#3  _dl_init (main_map=0x7ffff7ffe1a8, argc=1, argv=0x7fffffffe128, 
    env=0x7fffffffe138) at dl-init.c:126
#4  0x00007ffff7ddd1ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#5  0x0000000000000001 in ?? ()
#6  0x00007fffffffe41a in ?? ()
#7  0x0000000000000000 in ?? ()

It looks like it could be a Qt-related problem. Here are the libraries the linker finds:

$ ldd /opt/ros/kinetic/lib/rviz/rviz | grep Qt
    libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f15d0efd000)
    libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f15d07c7000)
    libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f15d008b000)
    libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f15b4248000)
    libQtTest.so.4 => /usr/lib/x86_64-linux-gnu/libQtTest.so.4 (0x00007f15b4022000)
    libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f15b3b33000)

... so I expect there's a problem with Rviz being linked against both Qt4 and Qt5?

I'm running an freshly-installed and up-to-date Debian 8 Jessie system. I followed the ROS installation instructions here: http://wiki.ros.org/action/fullsearch/Installation/Debian

@wjwwood
Copy link
Member

wjwwood commented Jun 16, 2016

... so I expect there's a problem with Rviz being linked against both Qt4 and Qt5?

I think that's right. Some dependency of rviz's must be pulling in Qt4. What version of rviz is it?

@wjwwood wjwwood added the bug label Jun 16, 2016
@cdellin
Copy link
Author

cdellin commented Jun 16, 2016

Here's the version information:

$ cat /etc/apt/sources.list.d/ros-latest.list 
deb http://packages.ros.org/ros/ubuntu jessie main
$ grep version /opt/ros/kinetic/share/rviz/package.xml
  <version>1.12.1</version>
$ dpkg-query --show ros-kinetic-rviz
ros-kinetic-rviz    1.12.1-0jessie-20160610-152205-0700
$ apt-cache depends ros-kinetic-rviz | grep qt
  Depends: libqt5core5a
  Depends: libqt5gui5
  Depends: libqt5widgets5
  Depends: libqt5opengl5
  Depends: ros-kinetic-python-qt-binding

I'm not sure what could be pulling in Qt4 ... any ideas?

@cdellin
Copy link
Author

cdellin commented Jun 16, 2016

Smoking gun?

$ apt-cache rdepends libqtcore4 | grep ros-kinetic
  ros-kinetic-rtabmap-ros
  ros-kinetic-rtabmap
  ros-kinetic-opencv3
  ros-kinetic-octovis

EDIT: Actually, ros-kinetic-opencv3 is the only package of those I have installed. It's a direct dependency of ros-kinetic-rviz, so I expect that's the problem.

@wjwwood
Copy link
Member

wjwwood commented Jun 16, 2016

The latest version of rviz (which it appears you have) does not depend on anyone of those packages. Maybe you have an rviz plugin that does though? But I wouldn't have pinned it on that since your rviz executable is linked against qt4 directly.

@cdellin
Copy link
Author

cdellin commented Jun 16, 2016

(to clarify my above comment edit:)

cdellin@xxx:~$ apt-cache depends ros-kinetic-rviz
  ...
  Depends: libqt5core5a
  Depends: libqt5gui5
  Depends: libqt5widgets5
  Depends: libqt5opengl5
  Depends: ros-kinetic-opencv3
  ...
cdellin@xxx:~$ apt-cache depends ros-kinetic-opencv3
  ...
  Depends: libqt4-test
  Depends: libqtcore4
  Depends: libqtgui4
  Depends: libvtk5-qt4-dev
  ...

@wjwwood
Copy link
Member

wjwwood commented Jun 16, 2016

Ah, I removed that dependency on OpenCV here: #1009

But I haven't released that yet. Sorry. I'll try to get a release out this week.

@cdellin
Copy link
Author

cdellin commented Jun 16, 2016

Ah, excellent! Thanks.

@koniarik
Copy link

Was this solved?

I can't run actual rviz on actual debian jessie...

$ rosrun --debug rviz rviz
[rosrun] Looking in catkin libexec dirs: /opt/ros/kinetic/lib/rviz
[rosrun] Looking in rospack dir: /opt/ros/kinetic/share/rviz
[rosrun] Searching for rviz with permissions /111
[rosrun] Running  /opt/ros/kinetic/lib/rviz/rviz
Segmentation fault



Program received signal SIGSEGV, Segmentation fault.
0x00007fffd9601dbc in ?? () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
(gdb) where
#0  0x00007fffd9601dbc in ?? () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#1  0x00007ffff7dea9ba in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffe388, 
    env=env@entry=0x7fffffffe398) at dl-init.c:78
#2  0x00007ffff7deaaa3 in call_init (env=0x7fffffffe398, argv=0x7fffffffe388, argc=1, l=<optimized out>)
    at dl-init.c:36
#3  _dl_init (main_map=0x7ffff7ffe1a8, argc=1, argv=0x7fffffffe388, env=0x7fffffffe398) at dl-init.c:126
#4  0x00007ffff7ddd1ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#5  0x0000000000000001 in ?? ()
#6  0x00007fffffffe5f2 in ?? ()
#7  0x0000000000000000 in ?? ()


$ ldd /opt/ros/kinetic/lib/rviz/rviz | grep Qt
        libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f3741843000)
        libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f374110d000)
        libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f37409d1000)
        libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f3724b87000)
        libQtTest.so.4 => /usr/lib/x86_64-linux-gnu/libQtTest.so.4 (0x00007f3724961000)
        libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f3724472000)


$ dpkg-query --show ros-kinetic-rviz
ros-kinetic-rviz        1.12.1-0jessie-20160724-122351-0700

$ apt-cache depends ros-kinetic-opencv3 | grep qt4
  Depends: libqt4-test
  Depends: libvtk5-qt4-dev

@wjwwood
Copy link
Member

wjwwood commented Sep 19, 2016

It hasn't been released yet. It will probably be after ROSCon before I'll have time to catch up on rviz and make a new release.

@mryellow
Copy link

Work-around: catkin config --append-args --cmake-args -DWITH_QT=4 -DUseQt5=OFF

@pcarleton
Copy link

@mryellow Thanks for that workaround. For it to work, do I need to rebuild rviz using catkin? If so, are there instructions somewhere on how to do that? The build instructions on http://wiki.ros.org/rviz/UserGuide#Install_or_build_rviz give rosmake commands which do not take in to account the catkin config.

@mryellow
Copy link

mryellow commented Oct 6, 2016

@pcarleton Yeah that's with a source install where you can force everything (other packages using those flags) to use QT4.

Here is a semi-unattended install script I use (on Debian), along with the ROS source docs it might help show how the whole process works. Manually you don't need to specify dirs and everything like that script does as you're running from those paths already. Note the overlay workspace is a specific robot, replace packages in assets/rosinstall/kinetic-kulbu.rosinstall with whatever you want in your workspace. RVIZ is installed to root workspace, specified in assets/rosinstall/kinetic-desktop-custom.rosinstall along with a bunch of other deps.

https://github.com/mryellow/debian-scripts/blob/master/ros-kinetic.sh

http://wiki.ros.org/kinetic/Installation/Source
http://wiki.ros.org/catkin/Tutorials/workspace_overlaying

@mryellow
Copy link

mryellow commented Oct 7, 2016

@pcarleton Oh I probably have a fork or two coded into those dependencies in root_ws. There were a few issues with packages half-way through transitioning to new versions of libraries. Those issues are all closed now and anything you see with mryellow as the user can be replaced with the official repos again.

Best bet is probably using the generator to create your own desktop rosinstall file.

@jdbug1
Copy link

jdbug1 commented Oct 18, 2016

@wjwwood Can you tell us when the release will be done? I did a fresh Debian 8.6 and ROS installation (from the official repositories, not from source) today and it's still not working

@wjwwood
Copy link
Member

wjwwood commented Oct 18, 2016

No, but I was working on it yesterday and I'll probably work on it today too. By "official repositories" you mean packages.ros.org or the official Debian repositories?

@jdbug1
Copy link

jdbug1 commented Oct 18, 2016

I installed following the instructions on http://wiki.ros.org/kinetic/Installation/Debian, so the official Debian repositories. I installed the ros-kinetic-desktop-full package.

@wjwwood
Copy link
Member

wjwwood commented Oct 18, 2016

@jdbug1 no, actually that wiki uses the packages.ros.org repository. I think we agree, but I would consider the "official Debian repositories" to be packages.debian.org. If you installed ros-kinetic-desktop-full then you are using the ROS repositories, i.e. packages.ros.org.

@wjwwood
Copy link
Member

wjwwood commented May 2, 2017

Closing since the released version of rviz no longer has the OpenCV dependency.

@wjwwood wjwwood closed this as completed May 2, 2017
130s pushed a commit to 130s/rviz that referenced this issue Aug 21, 2024
…ualization#1030)

* Fix memory leak in effort_visual.cpp.

When shutting down, we were forgetting to free the
effort_arrow and effort_circle memory.  Switch to
using unique pointers there, which will take care of
this for us.

* Make sure to initialize ScrewVisual member variables.

Otherwise you can run into situations where the user
forgets to call one of the 'set' methods, and we now
access uninitialized memory.

* Make sure to set the frame orientation and position in effort visual.

As the API currently stands, it is very easy to access
uninitialized memory by forgetting to call setFramePosition()
and setFrameOrientation() before calling setEffort().
Fix at least this bit in the tests, and clean things
up a little so this is easier to read.

* Change EffortVisual constructor to take width and scale.

That way we ensure that these will always be set.

* Revamp adding things to the EffortVisual class during setEffort.

This is in an attempt to make sure we don't access
uninitialized memory.  It is a little complicated because
it is possible for the user to have set some of the information
before the setEffort() call, and we don't want to forget that.
So when setEffort() is called, we use the already set values
if they are available.  If they aren't, we use the identity.

On disable, we only erase the effort_arrow and effort_circle,
again so we don't forget information the user may have otherwise
provided us.

With all of this in place, it isn't possible to call setEffort
anymore and access uninitialized memory.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ebf54352606df837715bc4992c502449a1596efa)

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
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

6 participants