Skip to content

Conversation

shadygm
Copy link
Contributor

@shadygm shadygm commented Apr 2, 2025

🦟 Bug fix

Fixes gazebosim/gz-sim#2616

Summary

This PR introduces a fix for Gazebo crashing whenever an sdf element with negative size parameter was loaded. This is done by by simply adding a check in the load function of each element to identify whether the parameter that is being loaded is negative or not.

You can test it by running:
gz sim -v 3 c5.xml

c5.txt

From there, you should be seeing some warnings and all of the shapes.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

shadygm added 3 commits April 2, 2025 21:40
Signed-off-by: Shady Gmira <shady.gmira@gmail.com>
Signed-off-by: Shady Gmira <shady.gmira@gmail.com>
Signed-off-by: Shady Gmira <shady.gmira@gmail.com>
@shadygm shadygm requested review from azeey and scpeters as code owners April 2, 2025 22:38
@github-actions github-actions bot added 🏛️ ionic Gazebo Ionic 🪵 jetty Gazebo Jetty labels Apr 2, 2025
@arjo129 arjo129 self-requested a review April 3, 2025 02:57
Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for being super thorough.

Some minor style issues were highlighted by the CI:

/usr/share/gz/gz-cmake4/codecheck/cpplint.py:55: DeprecationWarning: module 'sre_compile' is deprecated
    import sre_compile
  /github/workspace/src/Box_TEST.cc:156:  At least two spaces is best between code and comments  [whitespace/comments] [2]
  /github/workspace/src/Cone_TEST.cc:190:  At least two spaces is best between code and comments  [whitespace/comments] [2]
  /github/workspace/src/Cone_TEST.cc:198:  At least two spaces is best between code and comments  [whitespace/comments] [2]
  /github/workspace/src/Cylinder_TEST.cc:186:  At least two spaces is best between code and comments  [whitespace/comments] [2]
  /github/workspace/src/Cylinder_TEST.cc:194:  At least two spaces is best between code and comments  [whitespace/comments] [2]
  /github/workspace/src/Plane.cc:104:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]

Otherwise LGTM

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Apr 3, 2025
@shadygm shadygm requested a review from arjo129 April 4, 2025 11:17
@arjo129
Copy link
Contributor

arjo129 commented Apr 7, 2025

I think you forgot to sign-off on the last two commits. You may have to force push. Instructions are here: https://github.com/gazebosim/sdformat/pull/1553/checks?check_run_id=39982138989

@ahcorde ahcorde merged commit 35a8619 into gazebosim:sdf15 Apr 7, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Apr 7, 2025
@shadygm
Copy link
Contributor Author

shadygm commented Apr 7, 2025

I think you forgot to sign-off on the last two commits.

Yes you're right, still not used to it 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏛️ ionic Gazebo Ionic 🪵 jetty Gazebo Jetty

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Crash after loading sdf with negative size parameter

3 participants