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

boost_any test failing #868

Closed
K-ballo opened this issue Sep 22, 2013 · 3 comments
Closed

boost_any test failing #868

K-ballo opened this issue Sep 22, 2013 · 3 comments

Comments

@K-ballo
Copy link
Member

K-ballo commented Sep 22, 2013

boost_any test is failing on all tested platforms but MSVC.

Output:

.../build/tests/unit/util/boost_any.cpp(220): comparing address in swapped against original failed in function 'void any_tests::test_swap()': '0x7fc42cc31638' != '0x7fc42cc31628'
@ghost ghost assigned EverYoung124 Oct 21, 2013
@hkaiser
Copy link
Member

hkaiser commented Oct 21, 2013

This looks like some object slicing problem (see the addresses).

@K-ballo
Copy link
Member Author

K-ballo commented Oct 22, 2013

GCC has a non-conforming COW std::string implementation, with a pointer to the shared representation as the only member. Thus, the small object optimization surprisingly applies for it, resulting in different addresses after swap.

@ghost ghost assigned K-ballo Oct 22, 2013
@hkaiser
Copy link
Member

hkaiser commented Oct 22, 2013

Excellent catch!

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

No branches or pull requests

3 participants