Bug 1815270 - Gazebo crashes on Fedora 31
Summary: Gazebo crashes on Fedora 31
Keywords:
Status: CLOSED DUPLICATE of bug 1816487
Alias: None
Product: Fedora
Classification: Fedora
Component: gazebo
Version: 31
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Rich Mattes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-19 20:29 UTC by Michał Rokita
Modified: 2020-04-18 18:40 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-04-18 18:40:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
QPA workaround (1.11 KB, patch)
2020-03-26 03:15 UTC, Rich Mattes
no flags Details | Diff

Description Michał Rokita 2020-03-19 20:29:13 UTC
Error message:
terminate called after throwing an instance of 'gazebo::common::Exception'
AL lib: (WW) alcCloseDevice: Releasing context 0x563d9c1feb70
AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa002

F31 on ThinkPad x260 (Intel Core i7-6600U @ 4x 3.4GHz, Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2))

Comment 1 Scott K Logan 2020-03-19 21:04:14 UTC
I'm seeing the same behavior.

I'm fairly confident that these reports are the same issue:
https://retrace.fedoraproject.org/faf/reports/2745154/
https://retrace.fedoraproject.org/faf/reports/2824832/

Comment 2 Rich Mattes 2020-03-20 23:11:51 UTC
Running with --verbose gets:

[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:132]  Unable to create the rendering window
[Err] [WindowManager.cc:139] EXCEPTION: Unable to create the rendering window

Unfortunately gazebo is swallowing the underlying OGRE exception when it can't create the rendering window, I'll try to see what is happening underneath.

Comment 3 Rich Mattes 2020-03-21 00:29:47 UTC
I updated the code responsible for the output above to write the exception text as part of the error message:

[Err] [WindowManager.cc:132]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): Invalid parentWindowHandle (wrong server or screen) in GLXWindow::create at /builddir/build/BUILD/ogre-1.9.0/RenderSystems/GL/src/GLX/OgreGLXWindow.cpp (line 240)

It looks like it's an OGRE/Wayland issue.  I found a similar error report from rviz here:
https://github.com/ros-visualization/rviz/issues/1442

The work-around listed in the bug report works, and gazebo launches properly:
QT_QPA_PLATFORM=xcb gazebo

One way forward is to force gazebo to use xcb platform.  I'll see if there's a way to do that in code so you don't have to use the environment variable.

Comment 4 Rich Mattes 2020-03-26 03:15:05 UTC
Created attachment 1673680 [details]
QPA workaround

Comment 5 Rich Mattes 2020-03-26 03:15:22 UTC
Reported upstream at https://bitbucket.org/osrf/gazebo/issues/2704/gazebo-fails-to-launch-under-wayland

I haven't been able to figure out how to override the QPA without an environment variable.  We could set the environment variable via the gazebo.desktop launcher, but that would only work when launching gazebo from the GUI, and wouldn't apply when launching from the CLI.  Given that the 'gazebo' executable is launching 'gzserver' and 'gzclient' via 'execvp', we can work around the problem by changing the execvp call for 'gzclient' to execvpe, and supply a modified set of environment variables with the QT_QPA_PLATFORM override appended to the existing environment variables.  It would let you launch 'gazebo' from the cli and from the gui, but launching 'gzclient' from the cli would still require the QPA override.  The attached patch implements this workaround, and works on my machine.  It's not great, but I can add it as a workaround for now.

Comment 6 Rich Mattes 2020-04-18 18:40:30 UTC

*** This bug has been marked as a duplicate of bug 1816487 ***


Note You need to log in before you can comment on or make changes to this bug.