onnxruntime/cmake
Changming Sun 3cec88bd12
FIX: memory leak checker is incompatible with std::stacktrace (#17209)
### Description
When I worked on PR #17173, I didn't notice that
onnxruntime\core\platform\windows\debug_alloc.cc also needs to call
dbghelp functions like SymInitialize. So, if we use vc runtime's
stacktrace functionality, vc runtime will initialize/uninitialize the
dbghelp library independently and vc runtime's stacktrace helper DLLs
get unloaded before our memory leak checker starts get work. Then we
call SymSetOptions, it crashes.

More details:
In VC runtime the C++23 stacktrace functions are implemented on top of
dbgeng.dll. In C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\crt\src\stl\stacktrace.cpp,
you can see it has:
```
                dbgeng = LoadLibraryExW(L"dbgeng.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
```
The dbgeng.dll is a wrapper around dbghelp.dll. It calls SymInitialize
and SymCleanup. dbgeng.dll gets unloaded before our memory leak check
starts to run. In theory we should be able to call SymInitialize again
if the previous user who called SymInitialize has also called
SymCleanup. However, users can use
SymRegisterCallback/SymRegisterCallback64/SymRegisterCallbackW64 to
register callback functions to dbghelp.dll. These callback functions
need to be alive when SymSetOptions(and some other dbghelp APIs) get
called.

### Motivation and Context
2023-08-18 17:10:33 -07:00
..
external Fix visualization issues with Attribute/Tensor protos (#17188) 2023-08-16 13:56:51 -07:00
patches update onnx.patch to apply wasm build break fix (#17104) 2023-08-11 15:00:39 -07:00
tensorboard
adjust_global_compile_flags.cmake Cleanup cmake file (#17154) 2023-08-15 10:51:33 -07:00
CMakeLists.txt Add DISABLE_CUSPARSE_DEPRECATED flag to CUDA build (#17207) 2023-08-18 10:25:49 -07:00
CMakeSettings.json
codeconv.runsettings
deps.txt Temporarily enforce "Debug build" TRT EP with trt oss parser on Windows (#17059) 2023-08-17 12:17:25 -07:00
EnableVisualStudioCodeAnalysis.props
gdk_toolchain.cmake
Info.plist.in
libonnxruntime.pc.cmake.in
nuget_helpers.cmake
onnxruntime.cmake [ios] Enable --use_extensions with custom built iOS pod (#16711) 2023-07-14 15:37:16 -07:00
onnxruntime_codegen_tvm.cmake
onnxruntime_common.cmake FIX: memory leak checker is incompatible with std::stacktrace (#17209) 2023-08-18 17:10:33 -07:00
onnxruntime_compile_triton_kernel.cmake [ROCm] Add ROCm Triton TunableOp for GroupNorm (#16196) 2023-07-11 13:55:30 +08:00
onnxruntime_config.h.in Enable -Wshorten-64-to-32 warning if available. (#16524) 2023-07-07 08:11:44 -07:00
onnxruntime_csharp.cmake
onnxruntime_flatbuffers.cmake Rework some external targets to ease building with -DFETCHCONTENT_FULLY_DISCONNECTED=ON (#15323) 2023-04-03 17:45:12 -07:00
onnxruntime_framework.cmake [C#, CPP] Introduce Float16/BFloat16 support and tests for C#, C++ (#16506) 2023-07-14 10:46:52 -07:00
onnxruntime_framework.natvis [C#, CPP] Introduce Float16/BFloat16 support and tests for C#, C++ (#16506) 2023-07-14 10:46:52 -07:00
onnxruntime_fuzz_test.cmake Fix fuzz test (#14385) 2023-01-22 22:17:43 -08:00
onnxruntime_graph.cmake Rework WIL dependency retrieval/usage (#17130) 2023-08-15 09:11:46 -07:00
onnxruntime_ios.toolchain.cmake
onnxruntime_java.cmake Update build option for training in java to enable_training_api (#15638) 2023-04-24 11:53:08 -07:00
onnxruntime_java_unittests.cmake Update build option for training in java to enable_training_api (#15638) 2023-04-24 11:53:08 -07:00
onnxruntime_kernel_explorer.cmake [ROCm] TunableOp: Update rocBLAS get_solutions API (since ROCm5.6) (#16657) 2023-07-13 11:20:26 +08:00
onnxruntime_language_interop_ops.cmake
onnxruntime_mlas.cmake 4b quantization for weights of LLMs (#16833) 2023-08-07 12:23:55 -07:00
onnxruntime_nodejs.cmake [js] upgrade dependencies and enable strict mode (#14930) 2023-03-22 15:05:04 -07:00
onnxruntime_objectivec.cmake Objective C Training API: TrainingSession (#16374) 2023-06-28 09:13:56 -07:00
onnxruntime_opschema_lib.cmake
onnxruntime_optimizer.cmake Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
onnxruntime_providers.cmake Temporarily enforce "Debug build" TRT EP with trt oss parser on Windows (#17059) 2023-08-17 12:17:25 -07:00
onnxruntime_pyop.cmake
onnxruntime_python.cmake Refactor schema extraction and output unflattening (#16894) 2023-08-04 13:58:21 +08:00
onnxruntime_rocm_hipify.cmake [CUDA] Add PackedMultiHeadAttention operator (#16779) 2023-07-28 16:35:38 -07:00
onnxruntime_session.cmake added support for cmake "find_package" (#8919) 2023-06-19 22:20:31 -07:00
onnxruntime_snpe_provider.cmake
onnxruntime_training.cmake Triton Codegen for ORTModule (#15831) 2023-07-13 18:17:58 +08:00
onnxruntime_unittests.cmake EP context for custom op (#16454) 2023-08-16 13:03:40 -07:00
onnxruntime_util.cmake
onnxruntime_webassembly.cmake [WebNN EP] Merge support for segment anything into main branch (#16208) 2023-06-07 09:56:37 -07:00
precompiled_header.cmake
Sdl.ruleset Add a Github workflow for Prefast (#15763) 2023-05-03 11:42:51 -07:00
set_winapi_family_desktop.h
target_delayload.cmake
uwp_stubs.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
wcos_rules_override.cmake
winml.cmake Rework WIL dependency retrieval/usage (#17130) 2023-08-15 09:11:46 -07:00
winml_cppwinrt.cmake
winml_sdk_helpers.cmake
winml_unittests.cmake Rework WIL dependency retrieval/usage (#17130) 2023-08-15 09:11:46 -07:00