gzclient crash when inserting Cessna model

Issue #2384 new
Louise Poubel created an issue

Backtrace:

terminate called after throwing an instance of 'gazebo::common::Exception'
[New Thread 0x7fff461f8700 (LWP 21742)]

Thread 1 "gzclient" received signal SIGABRT, Aborted.
0x00007ffff3368428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff3368428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff336a02a in __GI_abort () at abort.c:89
#2  0x00007ffff39a284d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff39a06b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff39a0701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff39a0919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff4e40ac3 in gazebo::common::SubMesh::Vertex (this=0x6bfacb0, _i=32)
    at /media/louise/TERA/code/gazeboA/gazebo/common/Mesh.cc:560
#7  0x00007ffff24788d0 in gazebo::rendering::RayQuery::SelectMeshTriangle (this=0x7fffffffc780, _x=973, _y=376, _visual=
    std::shared_ptr (count 4, weak 2) 0x5db7640, _intersect=..., _triangle=...)
    at /media/louise/TERA/code/gazeboA/gazebo/rendering/RayQuery.cc:94
#8  0x00007ffff24e8b5f in gazebo::rendering::Scene::FirstContact (this=0x1b7c7c0, _camera=..., _mousePos=..., _position=...)
    at /media/louise/TERA/code/gazeboA/gazebo/rendering/Scene.cc:1159
#9  0x00007ffff24501e4 in gazebo::rendering::OrbitViewController::HandleMouseEvent (this=0x3825aa0, _event=...)
    at /media/louise/TERA/code/gazeboA/gazebo/rendering/OrbitViewController.cc:171

Not sure if it is related, but RayQuery::SelectMeshTriangle was changed on pull request #2688

Comments (2)

  1. Ian Chen

    ran into this problem with other models before. Should be able to fix it with these change:

    diff -r 374363e4067f gazebo/rendering/RayQuery.cc
    --- a/gazebo/rendering/RayQuery.cc  Thu Aug 31 17:48:24 2017 -0700
    +++ b/gazebo/rendering/RayQuery.cc  Wed Oct 11 15:52:53 2017 -0700
    @@ -73,10 +73,14 @@
         for (unsigned int j = 0; j < mesh->GetSubMeshCount(); ++j)
         {
           const common::SubMesh *submesh = mesh->GetSubMesh(j);
    -      for (unsigned int k = 0; k < submesh->GetIndexCount(); k += 3)
    +      if (submesh->GetVertexCount() < 3u || submesh->GetIndexCount() < 3u)
    +        continue;
    +
    +      unsigned int indexCount = submesh->GetIndexCount();
    +      for (unsigned int k = 0; k < indexCount; k += 3)
           {
    -        if (submesh->GetVertexCount() < 3u)
    -          continue;
    +        if (indexCount <= k+2)
    +          break;
    
             ignition::math::Vector3d vertexA =
               submesh->Vertex(submesh->GetIndex(k))
    

    will create a pull request for it

  2. Log in to comment