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

bad_any_cast after Element::GetAny with gz11 on homebrew #202

Open
osrf-migration opened this issue Sep 14, 2018 · 5 comments
Open

bad_any_cast after Element::GetAny with gz11 on homebrew #202

osrf-migration opened this issue Sep 14, 2018 · 5 comments
Assignees
Labels
bug Something isn't working macOS macOS support major

Comments

@osrf-migration
Copy link

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


There are two failing tests for the gz11 branch on macOS mojave.

I started by investigating the GetAny test failure from UNIT_SDF_TEST, which failed at line 418, which occurs when a std::bad_any_cast is thrown after calling std::any_cast<ignition::math::Pose3d>(anyValue). I added some print statements to confirm that anyValue should have the right type:

diff -r 3826e3878b15598634df332d0c93f7186a506f49 src/SDF_TEST.cc
--- a/src/SDF_TEST.cc	Fri Sep 14 00:49:58 2018 +0000
+++ b/src/SDF_TEST.cc	Thu Sep 13 17:59:35 2018 -0700
@@ -410,6 +410,13 @@
     std::any anyValue = poseElem->GetAny();
     try
     {
+      using Pose = ignition::math::Pose3d;
+      std::cerr << typeid(Pose).name()
+                << ", " << typeid(Pose).hash_code()
+                << std::endl;
+      std::cerr << anyValue.type().name()
+                << ", " << anyValue.type().hash_code()
+                << std::endl;
       EXPECT_EQ(std::any_cast<ignition::math::Pose3d>(anyValue),
           ignition::math::Pose3d(0, 1, 2, 0, 0, 0));
     }

which gives the following output, showing that the types have matching names, but different hash_codes.

[ RUN      ] SDF.GetAny
N8ignition4math2v65Pose3IdEE, 4381304960
N8ignition4math2v65Pose3IdEE, 4382335968
/Users/jenkins/workspace/sdformat-ci-pr_any-homebrew-amd64-mojave/sdformat/src/SDF_TEST.cc:425: Failure
Failed
[  FAILED  ] SDF.GetAny (57 ms)

After some googling, I found an issue with clang with a reproducible test case (that was originally reported on stackoverflow). I think it's an issue with std::any in clang, because the reproducible test case works with gcc or if you switch from std::any to boost::any.

I think we see the issue because ignition::math::Pose3d is a template type, and it may be seeing different versions of of that type from different shared libraries and not recognizing that they are the same. I have requested a llvm.org account so that I can comment on that issue.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


disabling failed tests in pull request #511

@osrf-migration osrf-migration added major bug Something isn't working labels Apr 11, 2020
@scpeters
Copy link
Member

scpeters commented Oct 7, 2020

it looks like this is fixed in macOS catalina?

@scpeters scpeters self-assigned this Oct 9, 2020
@scpeters scpeters added the macOS macOS support label Oct 9, 2020
scpeters added a commit to scpeters/sdformat that referenced this issue Nov 7, 2020
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member

scpeters commented Nov 7, 2020

This has been fixed in Xcode 12+ available on macOS 10.15 Catalina

scpeters added a commit that referenced this issue Nov 8, 2020
…414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Nov 8, 2020
…workflow (gazebosim#414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Nov 8, 2020
…workflow (gazebosim#414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member

scpeters commented Nov 8, 2020

tests enabled for Xcode 12+ in #414

@scpeters scpeters closed this as completed Nov 8, 2020
scpeters added a commit that referenced this issue Nov 10, 2020
…414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 14, 2020
…workflow (gazebosim#414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
@scpeters
Copy link
Member

this was passing CI and now it's failing; I don't know why, but I'm disabling the tests again

@scpeters scpeters reopened this Dec 15, 2020
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit that referenced this issue Dec 15, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
)

This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
…workflow (gazebosim#414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/sdformat that referenced this issue Dec 15, 2020
)

This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit that referenced this issue Dec 15, 2020
…414)

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit that referenced this issue Dec 15, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
chapulina pushed a commit that referenced this issue Dec 24, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
azeey pushed a commit that referenced this issue Dec 24, 2020
This reverts part of commit
0e77816.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS macOS support major
Projects
None yet
Development

No branches or pull requests

2 participants