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

Segmentation fault when using TransformControl tool in crowded worlds #483

Closed
luca-della-vedova opened this issue Dec 11, 2020 · 1 comment · Fixed by #495
Closed

Segmentation fault when using TransformControl tool in crowded worlds #483

luca-della-vedova opened this issue Dec 11, 2020 · 1 comment · Fixed by #495
Labels
bug Something isn't working 🔮 dome Ignition Dome

Comments

@luca-della-vedova
Copy link
Member

When using the Transform Control plugin to move objects around, it "often" results in a segmentation fault in https://github.com/ignitionrobotics/ign-gazebo/blob/ign-gazebo4/src/EntityComponentManager.cc#L788 line with the following backtrace:

#0  ignition::gazebo::v4::EntityComponentManagerPrivate::SetRemovedComponentsMsgs (this=0x555555b08f60, _entity=@0x7fffce60b888: 22, _msg=...) at /home/luca/ws_citadel/src/ign-gazebo/src/EntityComponentManager.cc:794
#1  0x00007ffff38a0110 in ignition::gazebo::v4::EntityComponentManager::AddEntityToMessage (this=0x555555891650, _msg=..., _entity=<optimized out>, _types=..., _full=false) at /usr/include/c++/9/bits/unique_ptr.h:360
#2  0x00007ffff38a147e in ignition::gazebo::v4::EntityComponentManager::State (this=this@entry=0x555555891650, _state=..., _entities=std::unordered_set with 0 elements, _types=std::unordered_set with 1 element = {...}, _full=_full@entry=false)
    at /home/luca/ws_citadel/src/ign-gazebo/src/EntityComponentManager.cc:1031
#3  0x00007fffce658bd0 in ignition::gazebo::v4::systems::SceneBroadcaster::PostUpdate (this=0x55555cb2b350, _info=..., _manager=...) at /home/luca/ws_citadel/install/include/ignition/msgs6/ignition/msgs/serialized_map.pb.h:724
#4  0x00007ffff3944505 in ignition::gazebo::v4::SimulationRunner::<lambda()>::operator()(void) const (__closure=0x55555cc108e8) at /home/luca/ws_citadel/src/ign-gazebo/src/SimulationRunner.cc:430
#5  0x00007ffff2fdad84 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff7a20609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007ffff7b5e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

To reproduce:

  • Run a world with many objects (I used actors_population with 100 actors).
  • Select an actor and a transform tool (translation)
  • Click on an arrow many times in a sequence.

It seems the reason for the crash is that, at least in this world, the mutable_entities() structure is empty, hence the find returns an iterator to end().
I tried a hacky fix by doing early return if the entity is not found but that didn't sound like a sensible solution so I avoided creating a PR.

Here is an example:
Transform_segfault

I'm not familiar enough with the EntityComponentManager to know why this would happen so any input is welcome!

@luca-della-vedova luca-della-vedova added bug Something isn't working 🔮 dome Ignition Dome labels Dec 11, 2020
@iche033
Copy link
Contributor

iche033 commented Dec 11, 2020

looks like that function was added recently in Dome in #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants