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 MecanumDrive to non-existing entity #2513

Closed
gzfuzz opened this issue Aug 5, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@gzfuzz
Copy link

gzfuzz commented Aug 5, 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 # empty world with name world_0
  2. add plugin MecanumDrive 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: 100
}
plugins {
  name: "gz::sim::systems::MecanumDrive"
  filename: "gz-sim-mecanum-drive-system"
  innerxml: "<front_left_joint xmlns:gz=\"http://gazebosim.org/schema\">front_left_wheel_joint</front_left_joint>\n        \n<front_right_joint xmlns:gz=\"http://gazebosim.org/schema\">front_right_wheel_joint</front_right_joint>\n        \n<back_left_joint xmlns:gz=\"http://gazebosim.org/schema\">rear_left_wheel_joint</back_left_joint>\n        \n<back_right_joint xmlns:gz=\"http://gazebosim.org/schema\">rear_right_wheel_joint</back_right_joint>\n        \n<wheel_separation xmlns:gz=\"http://gazebosim.org/schema\">1.25</wheel_separation>\n        \n<wheelbase xmlns:gz=\"http://gazebosim.org/schema\">1.511</wheelbase>\n        \n<wheel_radius xmlns:gz=\"http://gazebosim.org/schema\">0.3</wheel_radius>\n        \n<min_acceleration xmlns:gz=\"http://gazebosim.org/schema\">-5</min_acceleration>\n        \n<max_acceleration xmlns:gz=\"http://gazebosim.org/schema\">5</max_acceleration>\n      "
}'

Also similar to #2508 , seems to be caused here?

void MecanumDrivePrivate::UpdateVelocity(

Output

[Err] [EntityComponentManager.cc:1083] Trying to create a component of type [9904571861011273795] attached to entity [100], but this entity does not exist. This create component request will be ignored.
[Err] [MecanumDrive.cc:192] MecanumDrive plugin should be attached to a model entity. Failed to initialize.

Stack trace (most recent call last) in thread 235815:
#16   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#15   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f3ebbbcd84f, in
#14   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f3ebbb3bac2, in
#13   Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f3eb7878252, in
#12   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5517c8f, in
#11   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5517ccf, in
#10   Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5517d43, in
#9    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5517e15, in
#8    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5517ead, in
#7    Object "/home/ren/play/robot/workspace/install/lib/libgz-sim8.so.8", at 0x7f3eb5507fb1, in
#6    Object "/data/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-mecanum-drive-system.so", at 0x7f3e7844ac0b, in gz::sim::v8::systems::MecanumDrive::PostUpdate(gz::sim::v8::UpdateInfo const&, gz::sim::v8::EntityComponentManager const&)
#5    Object "/data/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-mecanum-drive-system.so", at 0x7f3e7844adfb, in gz::sim::v8::systems::MecanumDrivePrivate::UpdateVelocity(gz::sim::v8::UpdateInfo const&, gz::sim::v8::EntityComponentManager const&)
#4    Object "/home/ren/play/robot/workspace/install/lib/libgz-math7.so.7", at 0x7f3eb03318e9, in gz::math::v7::SpeedLimiter::Limit(double&, double, double, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) const
#3    Object "/home/ren/play/robot/workspace/install/lib/libgz-math7.so.7", at 0x7f3eb0331e0e, in gz::math::v7::SpeedLimiter::LimitJerk(double&, double, double, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) const
#2    Object "/home/ren/play/robot/workspace/install/lib/libgz-math7.so.7", at 0x7f3eb0332341, in std::unique_ptr<gz::math::v7::SpeedLimiterPrivate, std::default_delete<gz::math::v7::SpeedLimiterPrivate> >::operator->() const
#1    Object "/home/ren/play/robot/workspace/install/lib/libgz-math7.so.7", at 0x7f3eb0332531, in std::unique_ptr<gz::math::v7::SpeedLimiterPrivate, std::default_delete<gz::math::v7::SpeedLimiterPrivate> >::get() const
#0    Object "/home/ren/play/robot/workspace/install/lib/libgz-math7.so.7", at 0x7f3eb0332680, in std::__uniq_ptr_impl<gz::math::v7::SpeedLimiterPrivate, std::default_delete<gz::math::v7::SpeedLimiterPrivate> >::_M_ptr() const
Segmentation fault (Address not mapped to object [(nil)])
@gzfuzz gzfuzz added the bug Something isn't working label Aug 5, 2024
@iche033
Copy link
Contributor

iche033 commented Aug 7, 2024

#2516

@iche033 iche033 closed this as completed Aug 7, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Core development Aug 7, 2024
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

No branches or pull requests

2 participants