-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ASAN test failure on FreeBSD #10714
Comments
Where does it say it's because of asan? Have you tried without it? |
This seems pretty clear it's asan. |
I don't see anything suspicious in the code either. But tests still fails without asan: https://gist.github.com/AMDmi3/f4e15d40834d30dee2c02a4c6dbd3671. Maybe it's something clang specific. |
That's v0.10.10 tag |
The only BSD ifdef we have works also for Linux. Lines 116 to 126 in a7f23d4
So it may be some library difference (I don't have FreeBSD installed, so I can't check). Does just running the game return the same error? |
Unfortunately I can't check right now as most OpenGL apps no longer work with my ancient nvidia. |
looks like its using libc++ instead of libstdc++.... let me see if that triggers the difference. |
@AMDmi3 do you know what version of libc++ you are running? |
Should be the same as clang/llvm which is 18.1.5 |
I think I am reproducing this (or a similar bug) on linux using libc++. I'll try to track down. |
@AMDmi3 If you set the environment variable |
The asan failure I am hitting is the container overflow check, which in theory is supposed to monitor for accesses in between the end of a container and its capacity. In practice, it is known to be broken in mixed asan/non asan builds. This only works for containers that have been correctly annotated. I reproduced a container overflow failure in the very first string access from the unit test, specifically in a string::size() call that in theory should only access the very first byte of SSO-optimized string structure. It never would have accessed any heap allocated memory at all, given the string was only 6 bytes long. I recommend that we disable container overflow checking, since it only works for annotated types anyways (I strongly suspect that only libc++ has these annotations), and is broken if the program links with any other libraries that happen to also use libc++ strings or vectors. This can be done by setting the |
That doesn't explain why the test fails without sanitizers, though. |
I'm really sorry for misleading, the cause of test failure was that a patch I've used to debug asan failure accidentally got committed.
Yes, this fixes asan failure. After these fixed there's a single failure left:
This check is already under #ifndef APPLE endless-sky/tests/unit/src/test_weightedList.cpp Lines 351 to 353 in e24ae69
Why's that? A quick check shows that CHECK_THROWS_WITH + Catch::Matchers::ContainsSubstring + std::runtime_error combination work fine. |
It doesn't work on older Apple systems due to missing library support. The same may be true under *BSD. |
Heh... I had to remove |
I'm not using vcpkg and it works just fine. I'm not on debian, though. |
No, it compiles fine, but as it can be seen in the log, for some reason it sees exception message as |
Yeah, it seems exception messages aren't supported in whatever standard library version you are using. |
They are.
This passes:
|
Is there an existing issue for this?
Describe the bug
I've just added support for running tests in FreeBSD port of ES, and there was test failure, seemingly caused by ASAN. Not sure if test failed on earlier versions. I haven't tested the game itself.
Full log: https://gist.github.com/AMDmi3/e31a6af6d78956e90393cff580e459eb
Steps to Reproduce
Build on FreeBSD 14.1 and run tests.
Expected Behavior
Tests passing
Screenshots
No response
Link to save file
No response
Operating System
FreeBSD 14.1
Game Source
Built from source
Game Version
0.10.10
Additional Information
No response
The text was updated successfully, but these errors were encountered: