-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix segmentation fault on exit for macOS tests #510
Fix segmentation fault on exit for macOS tests #510
Conversation
- Add dartsim_plugin to test target link libraries and dependencies. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Codecov Report
@@ Coverage Diff @@
## gz-physics6 #510 +/- ##
============================================
Coverage 75.71% 75.71%
============================================
Files 142 142
Lines 7199 7199
============================================
Hits 5451 5451
Misses 1748 1748 |
Looks like CI runs on Bigsur macOS machines, but we don't have a PR CI job for Monterey. Is there a way to test this on Monterey? /cc @Crola1702 |
ignition_physics-ci-pr_any-homebrew-amd64 job runs on AFAIK The only way to test in on monterey right now is:
WDYT? @j-rivero |
I've tested it locally on my macOS Monterey laptop, and this fixes I'd rather not link the common tests against dartsim, so perhaps we can add a helper function to call |
Thought that might be the case, and I think both approaches prevent the plugin from unloading. I'm not able to reproduce the seg faults on the |
Interesting; can you check which version of dartsim you currently have installed? I have 6.13.0, which is the current version in homebrew-core |
I'm using |
The from-source installation instructions may be out of date, since fortress and garden both use the homebrew-core version of dartsim:
Can you try with |
Using |
As another data point, I had to remove |
Alternative fix #529 |
Closing since #529 was merged. |
🦟 Bug fix
Fixes #442
Summary
See #442 for details on how to reproduce.
Add a link dependency to
dartsim_plugin
in the failing test(s). The dependency is present in the tests contained ingz-physics/dart
but not for those ingz-physics/src
.This prevent the segmentation fault on exit, but does not really address the root cause of why the
SingletonFactory
for theCollisionDetector
has a segmentation faulting without the explicit link.As mentioned in the comment, the error occurs in the destruction of the static
Registrar
variable for theDARTCollisionDetector
. Thestd::function
associated with the lambda in the registration entry below is invalid at the point theFactory
destructor is called.It's possible the explicit link prevents the shared library from being unloaded and so the process exits cleanly (the same result occurs if the plugin
LoadLib
call is made withnodelete=true
).Checklist
codecheck
passed (See contributing)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.