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

Sanitize #55

Closed
fmang opened this issue Feb 3, 2018 · 1 comment
Closed

Sanitize #55

fmang opened this issue Feb 3, 2018 · 1 comment

Comments

@fmang
Copy link
Owner

fmang commented Feb 3, 2018

clang provides several useful tools for detecting potential errors at runtime, including ASan and UBSan.

So far I've mostly used valgrind to discover memory leaks and unitialized memory.

A few issues may arise:

oshu! is a game, and while performance is not a top priority issue here, some paths may become hard to trigger if the game is unplayable.

oshu! has a lot of complex dependencies, like pango or ffmpeg. If something somewhere in that big stack runs some barely legal instructions, it may pollute the sanitizer's output. In fact, I suspect pango leaks some memory for a reason I cannot grasp.

Related to #53.

@fmang
Copy link
Owner Author

fmang commented Mar 10, 2018

Here are the results:

  • ASAN is pretty much like valgrind. It found leaks related to libX11 and fontconfig, the former indirectly caused by SDL and the latter by pango, without a doubt.

  • MSAN stops the program on the first use of uninitialized memory, and that happens to be caused by SDL_Init. Not much we can do 😢

  • UBSAN didn't report anything. This is good news.

With a complete test suite, we could run all these sanitizers to ensure the modules behave well, and avoid as much as possible the dependencies. The independent beatmap module can be tested thoroughly #44. To be continued!

@fmang fmang closed this as completed Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant