-
Notifications
You must be signed in to change notification settings - Fork 706
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: add open fds valgrind check #4851
Conversation
* handle if the first FILE DESCRIPTORS string come on the same line as the Running test string
f40388a
to
a021724
Compare
9aa3ef7
to
d8d4871
Compare
3d59c1c
to
add4c13
Compare
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.
For regex use, I'd really like to see a couple tests showing the parsing working/failing.
* fix two regexes to make them capture the correct portion of the tests * add banner to valgrind buildspec file
* Add tests for regex usages * Add __init__.py to make directories python module * Import regexes directly from the python script * Modify valgrind yml file
* add license, and explanations for the file * add banner to the python script
* We can't simply check if there are more than 4 open file descriptors * There are tests who intentionally close a std, and that will lead the total counts to 2. * One way is to check if open fds are one more than n std, but that information is not in older valgrind. * If there is no fd leaks, then the FILE DESCRIPTORS: will always be followed by the fd pointing to LastDynamicAnalysis log file * The test will check for this to determine if there are any leaking fds * Change testing for regexes * We only have one regex now, so delete those tests for previous regexes
b7c0429
to
5158969
Compare
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.
With James' document comments addressed...
* remove all regexes usages and use in to do string matching
df34f43
to
9bb5d57
Compare
* fix pedantic check and make every valgrind test runnable in Ubuntu 22+ * simplify the testing logic by checking if there is one more open fds than open std fds * only print the next 5 lines once a problem is detected for informational purpose only
* make comments more concise * add error handling for file not found or other file related problems
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.
Without the regex, lgtm
* reduce the abstraction of main function
This PR needs to update the Ubuntu version from 18 to 24 for pedantic Valgrind test. Such update can only be done after PR#4852 is merged. Such update is done. This test will success in Codebuild now. The result is attached. |
Resolved issues:
Partially solve #4005
Description of changes:
--track-fds=yes
options toVALGRIND_DEFAULT
option.s2n_open_fds_test.py
script to test for any unexpected open file descriptors at exit.buildspec_valgrind.yml
.Call-outs:
test_exec_leak.sh
. We are also storing open fd error information in a log file and then query from there.s2n-tls/codebuild/bin/test_exec_leak.sh
Lines 83 to 97 in 2587f74
LastDynamicAnalysis
log file generated directly by CTest memcheck.s2n_open_fds_test.py
script to test for open fds.s2n-tls/tests/unit/s2n_examples_test.c
Line 238 in 9cd117f
Testing:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.