Skip to content

[onnxruntime] v1.23.2 causes heap corruption (0xc0000374) on Windows - official binaries work #49349

@tripsitter-psy

Description

@tripsitter-psy

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

  1. Create a vcpkg.json:
    ```json
    {
    "name": "test",
    "dependencies": ["onnxruntime"],
    "builtin-baseline": "a48bbf436be0867d0eadc42077f280f3123e3698"
    }
    ```

  2. Create a minimal C++ test that loads an ONNX model and runs inference

  3. Build with vcpkg toolchain

  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions