-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ignition: Should remove all static storage duration (unless trivially destructible) #15601
Comments
I'd advocate for a slightly different approach. For anything that is actively hurting us (with segfaults, or etc.), then we can have a Drake-local patch file that is upstreamed later. But for all of the other global variable coding-style violations that are not hurting us, I don't see why we'd make Drake-specific patches for those? It seems like PRing those directly to upstream and waiting for a release should be sufficient. I see that ignition & sdformat have adopted the Google Style Guide, which means that statics like this are forbidden by rule. So the other thing to work on is to help remind the code reviewers for those projects of that rule, so that future PRs don't introduce regressions on this front. |
Sounds great! Updated to that effect. |
When I ran the command, I actually get a stack trace that shows the issue is in
This fails because of a missing symbol
I believe the issue is that the code in @SeanCurtis-TRI's branch is instantiating @@ -293,8 +293,8 @@ systems::lcm::LcmPublisherSystem* ConnectContactResultsToDrakeVisualizer(
builder, multibody_plant, nullptr, contact_results_port, lcm);
}
+template class ContactResultsToLcmSystem<double>;
+template class ContactResultsToLcmSystem<AutoDiffXd>;
+
} // namespace multibody
} // namespace drake
-
-DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS(
- class drake::multibody::ContactResultsToLcmSystem)
|
Good find! That sounds very plausible. |
That's not just plausible, that's incredibly compelling. Thanks for the sleuthing, @azeey! It makes perfect sense. I'll have to consider the proper Drake-side resolution. |
Nice indeed! Given discussion, lowering priority, and updating checkboxes to focus solely on upstream. At that point, the symptoms (via stack trace) might have been slightly less confusing. |
I would like to close this issue, in lieu of an upstream ticket in @azeey have you already fixed all of the instances of static initialization and destruction in |
No, I haven't yet. I'll create an issue in ign-math. There's already one for sdformat: gazebosim/sdformat#552 |
If I'm reading it correctly, an issue already exists -- gazebosim/gz-math#269. |
@SeanCurtis-TRI ran into a nasty segfault in pydrake that is most likely due to static storage duration for objects w/ non-trivial destructors:
https://gist.github.com/SeanCurtis-TRI/8122cb2ad2b78f99f91ab35d19ff931c
Slack thread: https://drakedevelopers.slack.com/archives/C3YB3EV5W/p1628696745011100
To observe the phenomenon, the following branch will manifest the problem:
https://github.com/SeanCurtis-TRI/drake/tree/TEMP_showcase_angry_ignition
Simply execute
bazel test //bindings/pydrake:py/math_test
to see the failure.Suggested steps:
Patch how Drake consumes ignition to not use any non-trivially destructible (or constructible) objects with static storage duration - which acutely affect usignition
ecosystem)\cc @jwnimmer-tri
The text was updated successfully, but these errors were encountered: