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

Attempts to print a stacktrace on segfault in our integration tests (backport #2776) #2814

Open
wants to merge 1 commit into
base: ign-gazebo6
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 7, 2025

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎉 New feature

Closes #

Depends on: gazebo-tooling/action-gz-ci#81

Summary

Our integration tests often segfault in CI leaving us clueless as to whats happening. This commit is an attempt to vendor backward-cpp and at the same time allows us to get a stacktrace of our segfaulting tests in CI. The current status of this PR is draft.

Other options considered:

We vendor backward-cpp in gz-launch and in gz-utils. Sadly the ubuntu package is not very useful as no cmake targets are provided. I could try to vendor it in gz-cmake or write a bespoke FindBackward package. However, our goal is to use it in tests. This is a very specific use case and I feel maybe the simplest option is to vendor it here and link it against the tests. That way we do not introduce more dependencies via 3rd party package managers and the user has no need to have anything else installed.

Test it

This commit has an example of a test I purposely introduced a segfault in. You can take a look at the github runners and see the stacktrace, Unfortunately, for Jenkins, there may need to be some minor changes on the buildfarm side. In particular we need to install libdwarf-dev, libdw-dev and binutils-dev. We will also need to build with RelWithDebInfo.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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.


This is an automatic backport of pull request #2776 done by [Mergify](https://mergify.com).

…2776)

* Attempts to print a stacktrace on segfault in our integration tests

Our integration tests often segfault in CI leaving us clueless as to
whats happening. This commit is an attempt to vendor backward-cpp and
at the same time allows us to get a stacktrace of our code. The current
status of this PR is draft.

Other options considered:

We vendor backward-cpp in `gz-launch` and in `gz-utils`. Sadly the
ubuntu package is not very useful as no cmake targets are provided. I
could try to vendor it in gz-cmake or write a besopoke `FindBackward`
package. However, our goal is to use it in tests. This is a very
specific use case and I feel maybe the simplest option is to vendor it
here and link it against the tests. That way we do not introduce more
dependencies via 3rd party package managers and the user has no need to
have anything else installed.

---------

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Co-authored-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Co-authored-by: Carlos Agüero <caguero@openrobotics.org>
Co-authored-by: Jose Luis Rivero <jrivero@openrobotics.com>
(cherry picked from commit 7608ed9)

# Conflicts:
#	.github/workflows/ci.yml
#	test/CMakeLists.txt
@mergify mergify bot requested a review from mjcarroll as a code owner March 7, 2025 04:06
@mergify mergify bot added the conflicts label Mar 7, 2025
Copy link
Contributor Author

mergify bot commented Mar 7, 2025

Cherry-pick of 7608ed9 has failed:

On branch mergify/bp/ign-gazebo6/pr-2776
Your branch is up to date with 'origin/ign-gazebo6'.

You are currently cherry-picking commit 7608ed9d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CMakeLists.txt
	new file:   test/backward_vendor/backward-cpp/BackwardConfig.cmake
	new file:   test/backward_vendor/backward-cpp/CMakeLists.txt
	new file:   test/backward_vendor/backward-cpp/LICENSE.txt
	new file:   test/backward_vendor/backward-cpp/backward.cpp
	new file:   test/backward_vendor/backward-cpp/backward.hpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   .github/workflows/ci.yml
	both modified:   test/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@j-rivero j-rivero self-requested a review March 7, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants