Issue Summary
The vcpkg-built ONNX Runtime 1.23.2 (onnxruntime:x64-windows) crashes with heap corruption (exit code 0xc0000374) during basic inference operations on Windows. The same code works correctly with official Microsoft ONNX Runtime 1.23.2 binaries downloaded from GitHub releases.
Environment
- OS: Windows 11 (build 26200)
- Compiler: MSVC 19.38.33145.0 (Visual Studio 2022)
- vcpkg baseline:
a48bbf436be0867d0eadc42077f280f3123e3698
- onnxruntime version: 1.23.2 (from vcpkg)
- Architecture: x64
Reproduction Steps
-
Create a vcpkg.json:
```json
{
"name": "test",
"dependencies": ["onnxruntime"],
"builtin-baseline": "a48bbf436be0867d0eadc42077f280f3123e3698"
}
```
-
Create a minimal C++ test that loads an ONNX model and runs inference
-
Build with vcpkg toolchain
-
Run - crashes with exit code 0xc0000374 (STATUS_HEAP_CORRUPTION)
Verification with Official Binaries
Using the exact same compiled test executable but replacing vcpkg DLLs with official Microsoft binaries from https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-win-x64-1.23.2.zip:
| Binary Source |
Version |
Result |
| vcpkg |
1.23.2 |
CRASH (0xc0000374) |
| Official Microsoft |
1.23.2 |
SUCCESS (200 iterations) |
Analysis
This indicates the issue is specific to the vcpkg build configuration, not the ONNX Runtime source code. Possible causes:
- Incorrect compiler flags in vcpkg port
- Missing or incorrect debug/release runtime library linkage
- Heap allocator mismatch between vcpkg build and consuming application
The crash occurs during DLL initialization or very early in main(), before any application output.
Issue Summary
The vcpkg-built ONNX Runtime 1.23.2 (
onnxruntime:x64-windows) crashes with heap corruption (exit code 0xc0000374) during basic inference operations on Windows. The same code works correctly with official Microsoft ONNX Runtime 1.23.2 binaries downloaded from GitHub releases.Environment
a48bbf436be0867d0eadc42077f280f3123e3698Reproduction Steps
Create a vcpkg.json:
```json
{
"name": "test",
"dependencies": ["onnxruntime"],
"builtin-baseline": "a48bbf436be0867d0eadc42077f280f3123e3698"
}
```
Create a minimal C++ test that loads an ONNX model and runs inference
Build with vcpkg toolchain
Run - crashes with exit code 0xc0000374 (STATUS_HEAP_CORRUPTION)
Verification with Official Binaries
Using the exact same compiled test executable but replacing vcpkg DLLs with official Microsoft binaries from https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-win-x64-1.23.2.zip:
Analysis
This indicates the issue is specific to the vcpkg build configuration, not the ONNX Runtime source code. Possible causes:
The crash occurs during DLL initialization or very early in main(), before any application output.