-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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 ASan and UBSan options #6825
Conversation
shouldn't it be ARG_WITH() instead of ARG_ENABLE()? ASan requires additional libraries to be linked. |
enable is preferred here. More generally, we'd like them to be interchangeable (php/php-tasks#2). |
3e2b30e
to
407f086
Compare
Windows build system already have a "--enable-sanitizer" option, but only for MSVC clang toolchain. Shall we use "--enable-sanitizer" as option name, or use something like "--enable-sanitizer=yes,a,b,c“ ? The command to configure it may be like: REM at windows
configure.bat --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer
REM or
configure.bat --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer=address,undefined
REM or
configure.bat --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer=yes,address,undefined
REM note: from VS 2019 16.9, MSVC native CL.exe starts supporting ASan natively : at unix-like
./configure --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer
: or
./configure --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer=address,undefined
: or
./configure --enable-zts --enable-debug --disable-all --enable-cli --enable-sanitizer=yes,address,undefined |
Is there any advantage to combining all the options? It seems like same result for more parsing/diagnostic effort. A blanket |
|
When we need to enable ASan/UBSan in PHP extension, we also need to enable it in PHP kernel. Providing these options makes it easier for us to enable ASan when compiling PHP. And we use --enable-address-sanitizer and --enable-undefined-sanitizer in azure-pipelines.yml instead of changing CFLAGS. We also add compile flag check to MSan.
Does enabling sanitizers here automatically add sanitizer settings to extensions built with a sanitizer-enabled PHP? A quick glance at the patch suggests no, but I didn't check it out to find out. I am asking because if it does then I am quite happy -- this makes it a lot easier to build whole PHP ecosystems with sanitizers. If it does not, I would prefer that we revert these changes. Recommendations for options to use with sanitizers change, and new sanitizer types are added. I don't think special casing these ones is worth any sort of maintenance unless these propagate out into the extension ecosystem. |
When we need to enable ASan/UBSan in PHP extension, we also need to enable it in PHP kernel. Providing these options makes it easier for us to enable ASan/UBSan when compiling PHP.
And we use --enable-address-sanitizer and --enable-undefined-sanitizer in azure-pipelines.yml instead of changing CFLAGS.
We also add compile flag check to MSan.