-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add Valgrind CI action #2921
Add Valgrind CI action #2921
Conversation
Install valgrind
Rename valgrind action
.github/workflows/valgrind.yml
Outdated
|
||
- name: Run valgrind | ||
run: | | ||
valgrind ./testrunner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to pass --error-exitcode=1
so it will actually fail on any finding.
I also suggest adding the following options for better and more complete reporting --error-limit=no --leak-check=full --num-callers=50 --show-reachable=yes --track-fds=yes --track-origins=yes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@firewave Yes, but then all CI build would suddenly break which is not desired IMHO.
We should fix those issues (outside this PR) and afterwards enable the check.
Thanks for the suggested command line flags!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me. We should hurry though so we don't introduce even more while we are waiting :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also reduce the runtime by using -O1
. That's what usually is suggested and won't mess too much with the stack traces in case of an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that produces code which valgrind cannot handle
vex amd64->IR: unhandled instruction bytes: 0x62 0xF1 0x5D 0x48 0xEF 0xE4 0xC5 0xFB 0x11 0xA5
vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
==7492== valgrind: Unrecognised instruction at address 0x7995ee.
The version is pretty old though so this might be expected. Will check with the latest version and open a ticket upstream if this persists.
So back to -Og
...
|
As suggested in #2921 (comment)
.github/workflows/valgrind.yml
Outdated
@@ -38,4 +38,4 @@ jobs: | |||
|
|||
- name: Run valgrind | |||
run: | | |||
valgrind ./testrunner | |||
valgrind --error-limit=no --leak-check=full --num-callers=50 --show-reachable=yes --track-fds=yes --track-origins=yes ./testrunner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot --error-exitcode=1
Aim: reduce the build duration
We should probably disable the glibcxx debug containers as well by passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this
It seems the memory leaks are caused by threads that are spawned and not properly cleaned up. I saw something similar while running ASAN which leads to the system being swamped with threads and then it runs out of memory because of the sanitizer overhead. Will have a look at that. |
and also limit valgrind output
Remove --track-fds=yes Add --track-origins=yes Add TestExprEngine inst
Try |
Thanks, I'll try |
Debug symbols are now available.
|
|
I found some issues with the forked processes which leads to zombies and too many processes being spawned. Will prepare a PR. |
You could also use |
A run with all tests seems to generate too much output for now |
Will take a look tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Are there any improvements left? Otherwise i suggest to merge it. |
and one more test
Currently only a small subset of testrunner testsuites are being run.
I've enabled the build breaker for now and will merge now. |
Add valgrind CI action.
Inspired by #2920