X forwarding + indirect 3D rendering = segmentation fault

asked 2016-08-08 03:39:38 -0500

rukkal gravatar image

updated 2016-08-08 12:33:09 -0500

Hi all

I am debugging gazebo with remote X forwarding. Gazebo works fine when I run it locally on my machine. Gazebo also works fine when I ssh with X forwarding to my own machine. However, when I use the same machine as a remote one and I ssh with X forwarding to it (from another machine) I get a segmentation fault. This is a detailed list of what I do and what happens:

  1. ssh -Y <remote_machine_were_gazebo_is_installed>
  2. launch gazebo.
  3. gazebo starts and the GUI appears on the local machine.
  4. the 3D world is correctly rendered on the local machine and I can also move/rotate it.
  5. click on the 3D world on the local machine.
  6. gazebo crashes with a segmentation fault.

I Debugged the program and I found out that when I click the image a piece of code similar to the following snippet is executed:

Ogre::HardwareIndexBuffer& buf = ... ;
if (buf.getType() == Ogre::HardwareIndexBuffer::IT_32BIT)
{
   uint32_t*  pLong = static_cast<uint32_t*>(buf.lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
   idx0 = pLong[0];
   idx1 = pLong[1];
   ...
}

The exact code is at gazebo/rendering/Scene.cc:1590 (gazebo 7.3.1).

The indices retrieved from the Ogre::HardwareBuffer are then used to dereference an array of vertices (array of Ogre::Vector3 declared at gazebo/rendering/Scene.cc:1529). Some of the indices are fishy because they are definitely out of the bounds of the array of vertices and they cause the segmentation fault.

Is gazebo reading garbage from the remote GPU here? If so, is there any way that gazebo could possibly run remotely with X forwarding and indirect 3D rendering or am I trying to do something impossible? I am asking this because to me it looks like the problem is the fact that OpenGL commands are sent to the local client machine, whereas gazebo reads garbage from the remote GPU because it has been hardcoded to do so.

Thank you in advance for any input on this!

edit retag flag offensive close merge delete

Comments

Can you explicitly spell out the problem scenario? Don't use pronouns, such as "it". Instead use the noun, such as "gazebo" or "remote pc". It would also be useful if you include a numbered lists of steps to follow to reproduce your error.

nkoenig gravatar imagenkoenig ( 2016-08-08 10:09:30 -0500 )edit

I modified the original post. Please don't hesitate to ask for more details, if needed.

rukkal gravatar imagerukkal ( 2016-08-08 12:32:20 -0500 )edit