-
Notifications
You must be signed in to change notification settings - Fork 286
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
Windows test failures with c++ exception: "Access violation - no RTTI data!" #1522
Comments
Thank you for the report! Yeah, the tests were disabled mostly due to this issue. One example is this line: dart/unittests/unit/test_Aspect.cpp Lines 820 to 824 in 7476d16
It seems the access violation happens when a composite is being dynamic-cased to the concrete type (e.g., dart/dart/common/detail/Aspect.hpp Line 82 in 7476d16
I'm not sure if this is a bug of MSVC or the implementation doesn't comply with the standard. Will keep investigating this. |
yes, I just collected a backtrace that implicates |
Hm, I wasn't able to figure out the solution to this problem. Maybe @mxgrey could shed some light here. Until then let me find a workaround to avoid the |
If en.cppreference.com's explanation of The Standard can be trusted, I think this is an error in MSVC:
As far as I can tell, the problematic cases are being called from the constructors of classes that the But supposing this is an MSVC problem that we need to accommodate, the only solution I can think of is to refactor every constructor (or at least the constructors that are problematic) to make them private/protected and replace them with an equivalent |
if we want to report it as a compiler bug, we should try to create a minimal reproduction example |
If the problem is indeed due to MSVC, a possible workaround could be to just build on Windows dartsim and any library that uses dartsim's headers using clang-cl . This would still give us MSVC-compatible binaries, and will permit to use MSVC again for any downstream project that does not directly include dartsim's headers. For example, we would need to compile dartsim and ignition-physics with clang-cl, but then a MSVC program could link without problems to ign-physics and execute by running the clang-cl compiled ign-physics plugin. |
However, this needs to be tested, because it is possible to be linked to how MSVC handles RTTI data, and so it is possible that also clang-cl is affected by it. |
It was worth giving it a try, but apparently with clang-cl 10 the
|
Hopefully this could be fixed by #1540 . Actually the fix was already proposed in #1431, but personally I did not read that issue in detail. Indeed, the effect of the
So this indeed could be related. |
Bug Report
Environment
Expected Behavior
All tests that pass on Linux and macOS should pass on windows.
Current Behavior
Certain tests fail on Windows with the following console message:
Steps to Reproduce
Code to Reproduce
I've enabled some tests in scpeters@685e00c (branch scpeters:windows_ci_debug) that were previously disabled in #1513 (dc4056a), and the failures can be seen in the GitHub actions CI output.
The text was updated successfully, but these errors were encountered: