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

Crash after dynamically adding plugin LiftDrag to non-existing entity #2508

Closed
gzfuzz opened this issue Aug 4, 2024 · 0 comments · Fixed by #2516
Closed

Crash after dynamically adding plugin LiftDrag to non-existing entity #2508

gzfuzz opened this issue Aug 4, 2024 · 0 comments · Fixed by #2516
Labels
bug Something isn't working

Comments

@gzfuzz
Copy link

gzfuzz commented Aug 4, 2024

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build?
    source build
    gz-sim version: 907efc3
    built with
    gcc version: 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
    build options: -DCMAKE_BUILD_TYPE=Coverage

Description

  • Expected behavior: Gazebo doesn't crash
  • Actual behavior: Gazebo crashes

Steps to reproduce

  1. gz sim a.txt -r # an empty world with name world_0
  2. add plugin LiftDrag with gz service command, to a non-existing entity id
gz service --timeout 10000 -s /world/world_0/entity/system/add --reptype gz.msgs.Boolean --reqtype gz.msgs.EntityPlugin_V --req 'entity {
  id: 47
}
plugins {
  name: "gz::sim::systems::LiftDrag"
  filename: "gz-sim-lift-drag-system"
  innerxml: "<a0>0.1</a0>\n        \n<cla>0.1</cla>\n        \n<cda>0.001</cda>\n        \n<cma>0.0</cma>\n        \n<cp>0.0 0.5 0</cp>\n        \n<area>0.2</area>\n        \n<air_density>1.2041</air_density>\n        \n<forward>1 0 0</forward>\n        \n<upward>0 0 1</upward>\n        \n<link_name>blade_2::link</link_name>\n      "
}'

could also be reproduced by extracting a.tar.gz, and then run

bash a.sh

Output

[Err] [EntityComponentManager.cc:1083] Trying to create a component of type [9904571861011273795] attached to entity [47], but this entity does not exist. This create component request will be ignored.
[Err] [LiftDrag.cc:537] The LiftDrag system should be attached to a model entity. Failed to initialize.
Stack trace (most recent call last):
#31   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab5dce19, in ruby_run_node
#30   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab5d9317, in
#29   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab76e33c, in rb_vm_exec
#28   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab768cc6, in
#27   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab765ff5, in
#26   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab763c64, in
#25   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab6afa4e, in
#24   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab5da9ac, in rb_protect
#23   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab772c91, in rb_yield
#22   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab76e33c, in rb_vm_exec
#21   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab768cc6, in
#20   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab765ff5, in
#19   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab763c64, in
#18   Object "/usr/lib/x86_64-linux-gnu/ruby/3.0.0/fiddle.so", at 0x7f91a731144b, in
#17   Object "/lib/x86_64-linux-gnu/libruby-3.0.so.3.0", at 0x7f91ab7310b8, in rb_nogvl
#16   Object "/usr/lib/x86_64-linux-gnu/ruby/3.0.0/fiddle.so", at 0x7f91a7310d6b, in
#15   Object "/lib/x86_64-linux-gnu/libffi.so.8", at 0x7f91a7302492, in
#14   Object "/lib/x86_64-linux-gnu/libffi.so.8", at 0x7f91a7305e2d, in
#13   Object "/data/play/robot/workspace/install/lib/libgz-sim8-gz.so.8.6.0", at 0x7f91a6659d7d, in runServer
#12   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4d1356a, in gz::sim::v8::Server::Run(bool, unsigned long, bool)
#11   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4d3efdf, in
#10   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4d6fd84, in gz::sim::v8::SimulationRunner::Run(unsigned long)
#9    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4d70ba2, in gz::sim::v8::SimulationRunner::Step(gz::sim::v8::UpdateInfo const&)
#8    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4d6cf2a, in gz::sim::v8::SimulationRunner::UpdateSystems()
#7    Object "/data/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-lift-drag-system.so", at 0x7f91664a48a1, in gz::sim::v8::systems::LiftDrag::PreUpdate(gz::sim::v8::UpdateInfo const&, gz::sim::v8::EntityComponentManager&)
#6    Object "/data/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-lift-drag-system.so", at 0x7f916649ee5e, in gz::sim::v8::systems::LiftDragPrivate::Load(gz::sim::v8::EntityComponentManager const&, std::shared_ptr<sdf::v14::Element> const&)
#5    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4b94f9c, in std::pair<double, bool> sdf::v14::Element::Get<double>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double const&) const
#4    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f91a4b9f902, in std::pair<double, bool> sdf::v14::Element::Get<double>(std::vector<sdf::v14::Error, std::allocator<sdf::v14::Error> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double const&) const
#3    Object "/home/ren/play/robot/workspace/install/lib/libsdformat14.so.14", at 0x7f91a2a0fda6, in sdf::v14::Element::GetAttribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
#2    Object "/home/ren/play/robot/workspace/install/lib/libsdformat14.so.14", at 0x7f91a295dc43, in
#1    Object "/home/ren/play/robot/workspace/install/lib/libsdformat14.so.14", at 0x7f91a296b99b, in
#0    Object "/home/ren/play/robot/workspace/install/lib/libsdformat14.so.14", at 0x7f91a2973d7e, in
    Segmentation fault (Address not mapped to object [0x18])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant