-
Notifications
You must be signed in to change notification settings - Fork 923
Enable Address Sanitizer in specified CI tests #4725
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
Conversation
Co-authored-by: sauwming <17044930+sauwming@users.noreply.github.com>
|
@copilot: Fix these leaks: |
Fixed memory leaks in the load_cert_direct() function in ssl_sock.c test: 1. Added proper cleanup of X509 and EVP_PKEY objects on error paths 2. For OpenSSL 3.0+, free the X509 and EVP_PKEY references after calling pj_ssl_cert_load_direct() since pj_ssl_sock_set_certificate() will call X509_up_ref() and EVP_PKEY_up_ref() to increase ref counts This fixes the leaks reported by Address Sanitizer: - Direct leak of 7608 bytes from SSL_new - Indirect leak of 2 bytes from ASN1_STRING_set (X509 certificate) Co-authored-by: sauwming <17044930+sauwming@users.noreply.github.com>
... Fixed in commit f56b4e1. The issue was in the test code's Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot: revert last commit |
This reverts commit f56b4e1. Co-authored-by: sauwming <17044930+sauwming@users.noreply.github.com>
…p/pjproject into copilot/use-address-sanitizer-tests
|
There were a couple of issues encountered:
This seems to be intentional:
So, a suppression file in
This is because ASan failed to install its alternate signal stack, most likely because app hasApplication already installed one. There's also an issue with the usage of
So currently we disable pjsip-test MSG_TEST. |
Description
Added
-fsanitize=addressto compiler and linker flags for six CI test configurations to enable memory error detection during testing.ci-mac.yml:
video-openh264-1: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSvideo-openh264-2: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSvideo-openh264-3: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSci-linux.yml:
default-full-bundle-1: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSdefault-full-bundle-2: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSdefault-full-bundle-3: Added ASan to CFLAGS, CXXFLAGS, LDFLAGSMotivation and Context
Address Sanitizer detects memory errors (use-after-free, buffer overflows, memory leaks) at runtime. Enabling it in these test configurations provides early detection of memory safety issues during CI runs.
How Has This Been Tested?
Screenshots (if appropriate):
N/A
Types of changes
Checklist:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.