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

ci: an attempt to run the tests under ASan/UBsan #3787

Merged
merged 9 commits into from Apr 19, 2021
Merged

ci: an attempt to run the tests under ASan/UBsan #3787

merged 9 commits into from Apr 19, 2021

Conversation

evverx
Copy link
Contributor

@evverx evverx commented Apr 15, 2021

The idea is to run the tests under ASan/UBsan on GHActions when PRs are opened to prevent memory leaks, heap-buffer-overflows and the like from making it into the lxc repository.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
init.lxc.static is run in arbitrary containers where the libasan library lxc has been built with
isn't always installed. To make it work let's override GCC's default and link both libasan
and libubsan statically. It should help to fix issues like
```
++ lxc-execute -n c1 -- sudo -u ubuntu /nnptest
lxc-init: error while loading shared libraries: libasan.so.5: cannot open shared object file: No such file or directory
```

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
and show all the commands it runs to make it easier to
debug potential issues.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
@lxc-jenkins
Copy link

This pull request didn't trigger Jenkins as its author isn't in the whitelist.

An organization member must perform one of the following:

  • To have this branch tested by Jenkins, use the "ok to test" command.
  • To have a one time test done, use the "test this please" command.

Those commands are simple Github comments of the format: "jenkins: COMMAND"

@evverx
Copy link
Contributor Author

evverx commented Apr 19, 2021

Now that it's green I think it should be more or less ready for review. @brauner could you take a look?

@evverx evverx marked this pull request as ready for review April 19, 2021 09:19
@brauner
Copy link
Member

brauner commented Apr 19, 2021

jenkins: test this please

mv /usr/bin/{lxc-test-console-log,test-console-log.orig}
cat <<EOF >/usr/bin/lxc-test-console-log
#!/bin/bash
printf "Memory leaks are ignored due to https://github.com/lxc/lxc/issues/3796.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should hopefully be fixed with:
#3790

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried rebasing this PR on top of the master branch (with those commits included) but the test built with clang somehow triggered the same memory leak again. Weirdly, gcc seems to be fine and I can't seem to reproduce it locally with the same version of clang.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like clang was right after all. I fixed it in #3800.

@brauner
Copy link
Member

brauner commented Apr 19, 2021

Looks good to me. I think we want to move all the ASAN options (including compiler dependent ones) into the makefile itself in the future.

@brauner brauner merged commit 77d2bd1 into lxc:master Apr 19, 2021
@lxc-jenkins
Copy link

Build finished.

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

Successfully merging this pull request may close these issues.

None yet

3 participants