ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
835 stars 464 forks source link

RViz crashes (segmentation fault) on launch #1159

Open diogoalmeida opened 7 years ago

diogoalmeida commented 7 years ago

Hi,

My installation of RViz started segfaulting everytime I try to run it. It was working until recently, but I had the unfortunate idea of doing an apt-get upgrade and since then I haven't been able to run RViz. I have tried all the solutions proposed in the Troubleshooting guide, and I've searched both in the issues page and the ROS answers website, but haven't found a solution. I run ubuntu 16.04 and ROS kinetic. When I run RViz, this is the output:

$ rosrun rviz rviz         
[ INFO] [1507195009.868024274]: rviz version 1.12.13
[ INFO] [1507195009.868098854]: compiled against Qt version 5.5.1
[ INFO] [1507195009.868116149]: compiled against OGRE version 1.9.0 (Ghadamon)
[1]    2980 segmentation fault (core dumped)  rosrun rviz rviz

I've made a gist with the gdb backtrace, ogre log and system info, and I've uploaded the core file to google drive. Hopefully this will be helpful.

I believe this to be a driver issue, but I have no idea what I could do. I would like to avoid reinstalling ubuntu. Thank you very much!

diogoalmeida commented 7 years ago

If I remove the intel video drivers (sudo apt-get remove xserver-xorg-video-intel) then RViz does not crash. However, the graphics performance goes down substancially :). Am I missing something here?

wjwwood commented 6 years ago

Looks like the segfault is within Ogre. Based on my experience I would guess (but I don't know for sure) that Ogre is assuming some GLX function is available, but it is not provided by your VM's video driver and therefore Ogre trys to call a function pointer that is nullptr. Without being able to reproduce it here, I doubt I can make progress on this issue. Even if I could, I fear all I could do is improve the error handling so that it throws an error that a required feature is unsupported (in fact I did this for Ogre 1.10: https://github.com/OGRECave/ogre/pull/507), avoiding the segfault but not making is so rviz can run.

dpipemazo commented 6 years ago

Thanks for the super-fast response. I agree on your analysis; it seems to be working better in Parallels for Mac for what it's worth if anyone else is running into the issue in VirtualBox.

diogoalmeida commented 6 years ago

I can add more info: I am running a laptop which docks with a displaylink adapter. If I configure my system to not shut down the laptop monitor when docked, then RViz starts, otherwise I get the segfault.

VictorLamoine commented 5 years ago

Same problem here:

#0  0x00007fff7f233496 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#1  0x00007fff7f237ee0 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#2  0x00007fff7f25c933 in Ogre::GLRenderSystem::GLRenderSystem() () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#3  0x00007fff7f2576e4 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#4  0x00007ffff31ada26 in Ogre::Root::installPlugin(Ogre::Plugin*) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#5  0x00007fff7f24079a in dllStartPlugin () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#6  0x00007ffff31adc61 in Ogre::Root::loadPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#7  0x00007ffff7ad3510 in rviz::RenderSystem::loadOgrePlugins() () from /opt/ros/melodic/lib/librviz.so
#8  0x00007ffff7ad7aa7 in rviz::RenderSystem::RenderSystem() () from /opt/ros/melodic/lib/librviz.so
#9  0x00007ffff7ad7c75 in rviz::RenderSystem::get() () from /opt/ros/melodic/lib/librviz.so
#10 0x00007ffff7ad2c11 in rviz::QtOgreRenderWindow::QtOgreRenderWindow(QWidget*) () from /opt/ros/melodic/lib/librviz.so
#11 0x00007ffff7af9ce9 in rviz::RenderPanel::RenderPanel(QWidget*) () from /opt/ros/melodic/lib/librviz.so
#12 0x00007ffff7b45d48 in rviz::VisualizationFrame::initialize(QString const&) () from /opt/ros/melodic/lib/librviz.so
#13 0x00007ffff7b501ce in rviz::VisualizerApp::init(int, char**) () from /opt/ros/melodic/lib/librviz.so
#14 0x0000555555554e86 in main (argc=2, argv=0x7fffffffe298) at /home/irt/rviz/src/src/rviz/main.cpp:40
dummy@dummy-DUMMY:~/rviz$ cd build_debug/ && gdb --args ./devel/lib/rviz/rviz -l
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./devel/lib/rviz/rviz...done.
(gdb) run
Starting program: /home/dummy/rviz/build_debug/devel/lib/rviz/rviz -l
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdc4c5700 (LWP 12991)]
[ INFO] [1542668463.576895821]: rviz version 1.13.1
[ INFO] [1542668463.576957496]: compiled against Qt version 5.9.5
[ INFO] [1542668463.576975196]: compiled against OGRE version 1.9.0 (Ghadamon)
[New Thread 0x7fffda872700 (LWP 12999)]
[New Thread 0x7fffda071700 (LWP 13000)]
[New Thread 0x7fffd9870700 (LWP 13001)]
[New Thread 0x7fffd906f700 (LWP 13002)]
[New Thread 0x7fffcbfff700 (LWP 13003)]
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[New Thread 0x7fffbc102700 (LWP 13010)]
[New Thread 0x7fffbb901700 (LWP 13011)]
[New Thread 0x7fffbb100700 (LWP 13012)]
[New Thread 0x7fffba8ff700 (LWP 13013)]
[New Thread 0x7fffba0fe700 (LWP 13014)]
[New Thread 0x7fffb98fd700 (LWP 13015)]
[New Thread 0x7fffb90fc700 (LWP 13016)]
[New Thread 0x7fffb88fb700 (LWP 13017)]
QXcbConnection: XCB error: 145 (Unknown), sequence: 171, resource id: 0, major code: 139 (Unknown), minor code: 20
[New Thread 0x7fff9bcff700 (LWP 13018)]
[New Thread 0x7fff9b4fe700 (LWP 13019)]
[New Thread 0x7fff9acfd700 (LWP 13020)]
[New Thread 0x7fff9a4fc700 (LWP 13021)]
[New Thread 0x7fff99cfb700 (LWP 13022)]
[New Thread 0x7fff994fa700 (LWP 13023)]
[New Thread 0x7fff98cf9700 (LWP 13024)]
[New Thread 0x7fff7ffff700 (LWP 13025)]
[ INFO] [1542668464.753702533]: Creating resource group General
[ INFO] [1542668464.755231275]: Creating resource group Internal
[ INFO] [1542668464.755315333]: Creating resource group Autodetect
[ INFO] [1542668464.755500955]: SceneManagerFactory for type 'DefaultSceneManager' registered.
[ INFO] [1542668464.755845126]: Registering ResourceManager for type Material
[ INFO] [1542668464.755916161]: Registering ResourceManager for type Mesh
[ INFO] [1542668464.755977423]: Registering ResourceManager for type Skeleton
[ INFO] [1542668464.756082241]: MovableObjectFactory for type 'ParticleSystem' registered.
[ INFO] [1542668464.756230148]: ArchiveFactory for archive type FileSystem registered.
[ INFO] [1542668464.756295213]: ArchiveFactory for archive type Zip registered.
[ INFO] [1542668464.756347103]: ArchiveFactory for archive type EmbeddedZip registered.
[ INFO] [1542668464.756411556]: DDS codec registering
[ INFO] [1542668464.756494153]: FreeImage version: 3.17.0
[ INFO] [1542668464.756563760]: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
[ INFO] [1542668464.756841011]: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,rgb,rgb,bw,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti,xf,webp,jxr,wdp,hdp
[ INFO] [1542668464.756901988]: PVRTC codec registering
[ INFO] [1542668464.756955051]: ETC codec registering
[ INFO] [1542668464.757004227]: Registering ResourceManager for type HighLevelGpuProgram
[ INFO] [1542668464.757085485]: Registering ResourceManager for type Compositor
[ INFO] [1542668464.757423826]: MovableObjectFactory for type 'Entity' registered.
[ INFO] [1542668464.757482455]: MovableObjectFactory for type 'Light' registered.
[ INFO] [1542668464.757535668]: MovableObjectFactory for type 'BillboardSet' registered.
[ INFO] [1542668464.757606160]: MovableObjectFactory for type 'ManualObject' registered.
[ INFO] [1542668464.757668656]: MovableObjectFactory for type 'BillboardChain' registered.
[ INFO] [1542668464.757729645]: MovableObjectFactory for type 'RibbonTrail' registered.
[ INFO] [1542668464.757882541]: *-*-* OGRE Initialising
[ INFO] [1542668464.757935126]: *-*-* Version 1.9.0 (Ghadamon)
[ INFO] [1542668464.758012993]: OverlayElementFactory for type Panel registered.
[ INFO] [1542668464.758066551]: OverlayElementFactory for type BorderPanel registered.
[ INFO] [1542668464.758119488]: OverlayElementFactory for type TextArea registered.
[ INFO] [1542668464.758179666]: Registering ResourceManager for type Font
[ INFO] [1542668464.758248185]: Loading library /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL
[ INFO] [1542668464.782136685]: Installing plugin: GL RenderSystem
[ INFO] [1542668464.782221251]: OpenGL Rendering Subsystem created.

Thread 1 "rviz" received signal SIGSEGV, Segmentation fault.
0x00007fff7f233496 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
(gdb) bt
#0  0x00007fff7f233496 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#1  0x00007fff7f237ee0 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#2  0x00007fff7f25c933 in Ogre::GLRenderSystem::GLRenderSystem() () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#3  0x00007fff7f2576e4 in ?? () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#4  0x00007ffff31ada26 in Ogre::Root::installPlugin(Ogre::Plugin*) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#5  0x00007fff7f24079a in dllStartPlugin () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so.1.9.0
#6  0x00007ffff31adc61 in Ogre::Root::loadPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#7  0x00007ffff7ad3510 in rviz::RenderSystem::loadOgrePlugins() () from /opt/ros/melodic/lib/librviz.so
#8  0x00007ffff7ad7aa7 in rviz::RenderSystem::RenderSystem() () from /opt/ros/melodic/lib/librviz.so
#9  0x00007ffff7ad7c75 in rviz::RenderSystem::get() () from /opt/ros/melodic/lib/librviz.so
#10 0x00007ffff7ad2c11 in rviz::QtOgreRenderWindow::QtOgreRenderWindow(QWidget*) () from /opt/ros/melodic/lib/librviz.so
#11 0x00007ffff7af9ce9 in rviz::RenderPanel::RenderPanel(QWidget*) () from /opt/ros/melodic/lib/librviz.so
#12 0x00007ffff7b45d48 in rviz::VisualizationFrame::initialize(QString const&) () from /opt/ros/melodic/lib/librviz.so
#13 0x00007ffff7b501ce in rviz::VisualizerApp::init(int, char**) () from /opt/ros/melodic/lib/librviz.so
#14 0x0000555555554e86 in main (argc=2, argv=0x7fffffffe298) at /home/dummy/rviz/src/src/rviz/main.cpp:40
(gdb) q
A debugging session is active.

        Inferior 1 [process 12975] will be killed.

Quit anyway? (y or n) y

Does anyone know a fix? Next step is building Ogre from source I guess.

diogoalmeida commented 5 years ago

My solution around this issue was making sure my laptop screen remained on even if docked. Every time I try launching RViz on the laptop without the main screen on, I'll get the segfault.

VictorLamoine commented 5 years ago

The problem was the remote connection with MobaXterm. Using a screen solved it.

amandayeyan commented 3 years ago

The problem was the remote connection with MobaXterm

Hi Victor, I encounter the same problem and most probably is the mobxterm remote connection causing such issue. So what do you mean by using a screen?

VictorLamoine commented 3 years ago

A physical screen 😄