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 caused by service "/world/default/enable_collision" #2458

Closed
gzfuzz opened this issue Jul 1, 2024 · 2 comments · Fixed by #2509
Closed

Crash caused by service "/world/default/enable_collision" #2458

gzfuzz opened this issue Jul 1, 2024 · 2 comments · Fixed by #2509
Labels
bug Something isn't working good first issue Good for newcomers help wanted We accept pull requests!

Comments

@gzfuzz
Copy link

gzfuzz commented Jul 1, 2024

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build?
    source build
    gz-sim version: 5641ef2
    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. run gz sim with an empty world
  2. gz service --timeout 10000 -s /world/default/enable_collision --reptype gz.msgs.Boolean --reqtype gz.msgs.Entity --req 'type: COLLISION'

Output

a.log

@gzfuzz gzfuzz added the bug Something isn't working label Jul 1, 2024
@azeey
Copy link
Contributor

azeey commented Jul 22, 2024

Thanks for reporting this. It looks like the code doesn't check if the provided entity is valid

auto *linkEntity = ecm->Component<components::ParentEntity>(_collision);
auto allLinkSensors =
ecm->EntitiesByComponents(components::Sensor(),
components::ParentEntity(*linkEntity));

i.e., we need to check if linkEntity is nullptr there. Would you be able to create a PR with that change?

@azeey azeey added good first issue Good for newcomers help wanted We accept pull requests! labels Jul 22, 2024
@azeey azeey moved this from Inbox to To do in Core development Jul 22, 2024
akky20 added a commit to akky20/gz-sim that referenced this issue Aug 4, 2024
@akky20
Copy link
Contributor

akky20 commented Aug 4, 2024

@azeey I have reaised a PR for this issue , please have a look into it..

@arjo129 arjo129 linked a pull request Aug 5, 2024 that will close this issue
8 tasks
@arjo129 arjo129 closed this as completed in 5f03199 Aug 6, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Core development Aug 6, 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 good first issue Good for newcomers help wanted We accept pull requests!
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants