onnxruntime/tools/ci_build/github/azure-pipelines/templates
Changming Sun 0e8d4c3d21
Enable Address Sanitizer in CI (#19073)
### Description
1. Add two build jobs for enabling Address Sanitizer in CI. One for
Windows CPU, One for Linux CPU.
2. Set default compiler flags/linker flags in build.py for normal
Windows/Linux/MacOS build. This can help control compiler flags in a
more centralized way.
3. All Windows binaries in our official packages will be built with
"/PROFILE" flag. Symbols of onnxruntime.dll can be found at [Microsoft
public symbol
server](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/microsoft-public-symbols).

Limitations:
1. On Linux Address Sanitizer ignores RPATH settings in ELF binaries.
Therefore once Address Sanitizer is enabled, before running tests we
need to manually set LD_LIBRARY_PATH properly otherwise
libonnxruntime.so may not be able to find custom ops and shared EPs.
4. On Linux we also need to set LD_PRELOAD before running some tests(if
the main executable, like python, is not built with address sanitizer.
On Windows we do not need to.
5. On Windows before running python tests we should manually copy
address sanitizer DLL to the onnxruntime/capi directory, because python
3.8 and above has enabled "Safe DLL Search Mode" that wouldn't use the
information provided by PATH env.
6. On Linux Address Sanitizer found a lot of memory leaks from our
python binding code. Therefore right now we cannot enable Address
Sanitizer when building ONNX Runtime with python binding.
7. Address Sanitizer itself uses a lot of memory address space and
delays memory deallocations, which is easy to cause OOM issues in 32-bit
applications. We cannot run all the tests in onnxruntime_test_all in
32-bit mode with Address Sanitizer due to this reason. However, we still
can run individual tests in such a way. We just cannot run all of them
in one process.

### Motivation and Context
To catch memory issues.
2024-01-12 07:24:40 -08:00
..
jobs Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
stages Enable MacOS build in ORT Objc Pod (#18786) 2023-12-13 13:50:42 -08:00
android-binary-size-check-stage.yml
android-dump-logs-from-steps.yml
android-java-api-aar-test.yml Attempt to make the usage of the Android emulator in CIs more robust (#17903) 2023-10-15 08:42:36 +10:00
android-java-api-aar.yml
build-linux-wasm-step.yml Always run emsdk_env.sh before build.py, even when ccache is disabled (#18477) 2023-11-16 21:37:29 -08:00
c-api-artifacts-package-and-publish-steps-posix.yml
c-api-artifacts-package-and-publish-steps-windows.yml Add cuda context headers to zip (#18330) 2023-11-09 14:53:58 -08:00
c-api-cpu.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
c-api-linux-cpu.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
check-cache-stats.yml
clean-agent-build-directory-step.yml
common-variables.yml
compliance.yml
component-governance-component-detection-steps.yml
download-deps.yml Update absl and googletest (#18827) 2023-12-14 16:15:07 -08:00
esrp_nuget.yml
explicitly-defined-final-tasks.yml
final-jar-testing.yml Reduce downloads in Nuget-Java pipeline to reduce connection exception (#18635) 2023-12-01 07:44:44 +08:00
flex-downloadPipelineArtifact.yml
get-docker-image-steps.yml
install-appcenter.yml
java-api-artifacts-package-and-publish-steps-posix.yml
linux-build-step-with-cache.yml
linux-ci.yml
linux-cpu-packaging-pipeline.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
linux-gpu-tensorrt-packaging-pipeline.yml Create a new Nuget Package pipeline for CUDA 12 (#18135) 2023-11-28 09:03:46 -08:00
linux-wasm-ci.yml Remove EnvSetupScript parameter from win-ci.yml (#18662) 2023-12-01 15:30:16 -08:00
linux-web-init-and-check.yml [js/web] fix typescript type check (#18343) 2023-11-10 16:03:38 -08:00
mac-build-step-with-cache.yml
mac-cpu-packaging-pipeline.yml
mac-cpu-packaging-steps.yml
mac-cpu-packing-jobs.yml Update min macos version (#18251) 2023-11-10 11:08:17 -08:00
mac-esrp-dylib.yml
nodejs-artifacts-package-and-publish-steps-posix.yml
nodejs-artifacts-package-and-publish-steps-windows.yml
ondevice-training-cpu-packaging-pipeline.yml Remove EnvSetupScript parameter from win-ci.yml (#18662) 2023-12-01 15:30:16 -08:00
orttraining-linux-gpu-test-ci-pipeline.yml
py-linux-gpu.yml Create a new Python Package pipeline for CUDA 12 (#18348) 2023-11-20 09:48:28 -08:00
py-linux.yml Remove Windows ARM32 from nuget packaging pipelines (#19049) 2024-01-09 07:45:03 -08:00
py-package-smoking-test.yml Adding python3.12 support to ORT (#18814) 2024-01-11 08:34:28 -08:00
py-packaging-linux-test-cpu.yml
py-packaging-linux-test-cuda.yml Change cuda image for tensorRT to the one with cudnn8 (#18102) 2023-10-26 16:28:57 -07:00
py-packaging-selectable-stage.yml fix the Olive CI pipeline failure on Windows (#18464) 2023-11-28 11:42:39 -08:00
py-packaging-stage.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
py-packaging-training-cuda-stage.yml Adding python3.12 support to ORT (#18814) 2024-01-11 08:34:28 -08:00
py-win-gpu.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
react-native-ci.yml Add MacOS build to ORT C Pod (#18550) 2023-11-28 10:11:53 -08:00
rocm.yml [ROCm] add migraphx into onnxruntime-training-rocm package (#18339) 2023-11-14 11:54:22 +08:00
run-docker-build-steps.yml
set-nightly-build-option-variable-step.yml
set-python-manylinux-variables-step.yml Set pythonInterpreter in set-python-manylinux-variables-step.yml (#19105) 2024-01-12 07:22:02 -08:00
set-version-number-variables-step.yml
telemetry-steps.yml
upload-code-coverage-data.yml
use-android-emulator.yml Attempt to make the usage of the Android emulator in CIs more robust (#17903) 2023-10-15 08:42:36 +10:00
use-android-ndk.yml Update NDK version to 26.1.10909125 (#18493) 2023-11-17 14:14:01 -08:00
use-xcode-version.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
validate-package.yml
web-browserstack-ci.yml
web-ci.yml Update web-ci.yml: remove depth=1 (#18500) 2023-11-17 22:49:03 -08:00
win-ci.yml Enable Address Sanitizer in CI (#19073) 2024-01-12 07:24:40 -08:00
win-esrp-dll.yml
win-wasm-ci.yml Remove XNNPack from web pipelines (#18419) 2023-11-13 22:43:53 -08:00
win-web-ci.yml [js/web] use Chrome in CI for npm tests (#18522) 2023-11-21 18:03:57 -08:00
win-web-multi-browsers.yml
with-container-registry-steps.yml