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

Resolve asan testsuite issues #5100

Closed
matthiakl opened this issue Oct 27, 2021 · 2 comments · Fixed by #5176
Closed

Resolve asan testsuite issues #5100

matthiakl opened this issue Oct 27, 2021 · 2 comments · Fixed by #5176
Assignees
Labels
bug Something isn't working memory & performance Fix bottlenecks, memory leaks, ASan, ...
Milestone

Comments

@matthiakl
Copy link
Member

Re #5090
The testsuite reports some asan issues which should be addressed. See this log

Since leaks are suppressed all together in the CI, the testsuite should be run on a local machine to see, whether some leaks can be resolved as well.

@matthiakl matthiakl added bug Something isn't working memory & performance Fix bottlenecks, memory leaks, ASan, ... labels Oct 27, 2021
@Noordfrees Noordfrees added this to the v1.1 milestone Oct 28, 2021
@Noordfrees
Copy link
Member

Noordfrees commented Oct 28, 2021

Interestingly the failure always seems to happen on just three configurations: g++ 5 and 6 under Bionic; both release builds plus the g++6 debug build.
I'm compiling Widelands in a Bionic container now to look at it…


It's reproducible with g++5 under bionic in the Casern test. Will investigate.

@Noordfrees Noordfrees self-assigned this Oct 28, 2021
@Noordfrees
Copy link
Member

Noordfrees commented Oct 28, 2021

The bug seems to be in boost::format (specifically I'm using version 1.65.1.0ubuntu1 there).

Rewriting this function:

std::string StyleManager::color_tag(const std::string& text, const RGBColor& color) {
boost::format f("<font color=%s>%s</font>");
f % color.hex_value();
f % text;
return f.str();
}

to use plain string concatenation instead of boost::format fixes this crash, only to get a new crash a second later elsewhere (in as_mapobject_message) as we use boost::format a lot. Gotta love this library, we never have any sort of problems with it whatsoever, oh no…

#5081 gathers 99% of our boost::format calls in a single bformat interface function. From there it's only a small(ish) step to ripping it out completely, which I would consider the most desirable approach to fixing this bug.


Edit: To clarify, the testsuite with ASan shows multiple bugs, of which several but not all are boost-related. They should best be addressed one by one until all checks are green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working memory & performance Fix bottlenecks, memory leaks, ASan, ...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants