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

Clean up functions that trigger GCC9 warnings #261

Merged
merged 1 commit into from
Jul 10, 2021
Merged

Conversation

mjcarroll
Copy link
Contributor

Removes unnecessary copy constructors and insures that all destructors are marked virtual where appropriate.

Signed-off-by: Michael Carroll michael@openrobotics.org

Signed-off-by: Michael Carroll <michael@openrobotics.org>
@mjcarroll mjcarroll requested a review from mxgrey as a code owner June 8, 2021 16:15
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Jun 8, 2021
@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #261 (e159361) into main (2bab469) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #261      +/-   ##
==========================================
- Coverage   82.22%   82.15%   -0.08%     
==========================================
  Files         109      111       +2     
  Lines        4558     4539      -19     
==========================================
- Hits         3748     3729      -19     
  Misses        810      810              
Impacted Files Coverage Δ
tpe/lib/src/AABBTree.cc 91.04% <ø> (-0.26%) ⬇️
tpe/lib/src/CollisionDetector.cc 98.01% <ø> (-0.04%) ⬇️
tpe/lib/src/Entity.hh 0.00% <ø> (ø)
tpe/lib/src/Shape.cc 78.35% <ø> (-3.39%) ⬇️
tpe/lib/src/Link.hh 100.00% <100.00%> (ø)
tpe/lib/src/Shape.hh 100.00% <100.00%> (ø)
tpe/lib/src/AABBTree.hh 100.00% <0.00%> (ø)
tpe/lib/src/CollisionDetector.hh 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bab469...e159361. Read the comment docs.

@chapulina
Copy link
Contributor

The LinkFeatures test failure seems to be introduced by this PR?

@mjcarroll
Copy link
Contributor Author

@osrf-jenkins retest this please

@mjcarroll mjcarroll mentioned this pull request Jun 24, 2021
@scpeters
Copy link
Member

scpeters commented Jul 9, 2021

I think the test failure will be resolved by #275

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

No new warnings or failures are introduced by this, let's get it in.

@chapulina chapulina merged commit 9d5cc9a into main Jul 10, 2021
@chapulina chapulina deleted the gcc9_cleanup branch July 10, 2021 01:50
@scpeters
Copy link
Member

No new warnings or failures are introduced by this, let's get it in.

I disagree; the LinkFeatures test had a pre-existing problem but it was passing, while this PR turns it into a failure.

Build Status https://build.osrfoundation.org/view/ign-fortress/job/ignition_physics-ci-main-bionic-amd64/31/testReport/junit/(root)/UNIT_LinkFeatures_TEST/test_ran/

I think we should either:

@chapulina
Copy link
Contributor

the LinkFeatures test had a pre-existing problem but it was passing, while this PR turns it into a failure.

Humm I'm still not sure this PR is the one introducing the failure. LinkFeatures also fails with a segfault in #272, which didn't include this PR yet.

I can't reproduce the failure locally, but I suspect it's not because of this PR. Something may have changed upstream (on SDF?) and affected main.

@scpeters
Copy link
Member

the LinkFeatures test had a pre-existing problem but it was passing, while this PR turns it into a failure.

Humm I'm still not sure this PR is the one introducing the failure. LinkFeatures also fails with a segfault in #272, which didn't include this PR yet.

I can't reproduce the failure locally, but I suspect it's not because of this PR. Something may have changed upstream (on SDF?) and affected main.

the most recent GitHub action for this PR merged into main passes on focal but fails on bionic:

@scpeters
Copy link
Member

the LinkFeatures test had a pre-existing problem but it was passing, while this PR turns it into a failure.

Humm I'm still not sure this PR is the one introducing the failure. LinkFeatures also fails with a segfault in #272, which didn't include this PR yet.
I can't reproduce the failure locally, but I suspect it's not because of this PR. Something may have changed upstream (on SDF?) and affected main.

the most recent GitHub action for this PR merged into main passes on focal but fails on bionic:

I'm also having trouble reproducing it locally

@chapulina
Copy link
Contributor

passes on focal but fails on bionic:

I can't reproduce on Bionic locally though

@azeey
Copy link
Contributor

azeey commented Jul 12, 2021

I was able to reproduce it locally inside docker with dependencies installed from nightlies.

@azeey
Copy link
Contributor

azeey commented Jul 12, 2021

Here's my hypothesis. The test has been somewhat broken because sdf::World::Load is called instead of sdf::Root::Load. A consequence of that is the error message:

[Err] [SDFFeatures.cc:511] The link of the parent frame [base_link] of joint [upper_joint] in model [double_pendulum_with_base] could not be resolved. The joint will not be constructed
[Err] [SDFFeatures.cc:517] Error Code 9: [:L530708400]: Msg: Frame has invalid pointer to FrameAttachedToGraph.

that indicates that the parent link of the joint could not be resolved, which is because a frame graph is not available when sdf::World::Load is called. But when printing the error message, it segfaults because of gazebosim/sdformat#590. The issue is fixed by gazebosim/sdformat#610, but that hasn't made it to main yet.

@scpeters
Copy link
Member

Here's my hypothesis. The test has been somewhat broken because sdf::World::Load is called instead of sdf::Root::Load. A consequence of that is the error message:

[Err] [SDFFeatures.cc:511] The link of the parent frame [base_link] of joint [upper_joint] in model [double_pendulum_with_base] could not be resolved. The joint will not be constructed
[Err] [SDFFeatures.cc:517] Error Code 9: [:L530708400]: Msg: Frame has invalid pointer to FrameAttachedToGraph.

that indicates that the parent link of the joint could not be resolved, which is because a frame graph is not available when sdf::World::Load is called. But when printing the error message, it segfaults because of ignitionrobotics/sdformat#590. The issue is fixed by ignitionrobotics/sdformat#610, but that hasn't made it to main yet.

gazebosim/sdformat#610 was merged forward to main in gazebosim/sdformat#613 on June 30th

@azeey
Copy link
Contributor

azeey commented Jul 13, 2021

ignitionrobotics/sdformat#610 was merged forward to main in ignitionrobotics/sdformat#613 on June 30th

Ah, you're right. So I dug a little deeper and I can now reproduce it with sdformat build from source. The trick is to build it with g++ 7.5 as it's done by the nightly debbuilder. My new hypothesis is that sdf::operator<<(std::ostream, const std::Error&) is inlined in ign-physics code because it's defined in sdf/Error.hh. And since ign-physics is compiled with g++ 8, there might be some weird ABI issues between symbols accessed by the inlined code and the ones available in libsdformat.so.

I see two options:

  1. Move sdf::operator<<(std::ostream, const std::Error&) to Error.cc so it won't get inlined.
  2. Use g++8 in the sdformat nightly debbuilder job.

I have tested locally that both would work.

@scpeters
Copy link
Member

ignitionrobotics/sdformat#610 was merged forward to main in ignitionrobotics/sdformat#613 on June 30th

Ah, you're right. So I dug a little deeper and I can now reproduce it with sdformat build from source. The trick is to build it with g++ 7.5 as it's done by the nightly debbuilder. My new hypothesis is that sdf::operator<<(std::ostream, const std::Error&) is inlined in ign-physics code because it's defined in sdf/Error.hh. And since ign-physics is compiled with g++ 8, there might be some weird ABI issues between symbols accessed by the inlined code and the ones available in libsdformat.so.

I see two options:

  1. Move sdf::operator<<(std::ostream, const std::Error&) to Error.cc so it won't get inlined.
  2. Use g++8 in the sdformat nightly debbuilder job.

I have tested locally that both would work.

I prefer moving it to Error.cc

@scpeters
Copy link
Member

ignitionrobotics/sdformat#610 was merged forward to main in ignitionrobotics/sdformat#613 on June 30th

Ah, you're right. So I dug a little deeper and I can now reproduce it with sdformat build from source. The trick is to build it with g++ 7.5 as it's done by the nightly debbuilder. My new hypothesis is that sdf::operator<<(std::ostream, const std::Error&) is inlined in ign-physics code because it's defined in sdf/Error.hh. And since ign-physics is compiled with g++ 8, there might be some weird ABI issues between symbols accessed by the inlined code and the ones available in libsdformat.so.
I see two options:

  1. Move sdf::operator<<(std::ostream, const std::Error&) to Error.cc so it won't get inlined.
  2. Use g++8 in the sdformat nightly debbuilder job.

I have tested locally that both would work.

I prefer moving it to Error.cc

trying it out in gazebosim/sdformat#623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants