microsoft / microsoft/onnxruntime
[Bug] C# InferenceSession.RunAsync access violation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### Describe the issue
InferenceSession.RunAsync occasionally crashes with access violation 0xc0000005
```
Faulting module name: onnxruntime.dll, version: 1.26.26.508, time stamp: 0x69fdf731
Exception code: 0xc0000005
Fault offset: 0x0000000000092274
```
The issue must be in incorrect pinning of data on C# side. GC is able to move data during the model inference. The PR with the fix is available https://github.com/microsoft/onnxruntime/pull/29391
### To reproduce
Call InferenceSession.RunAsync continuously, it will crash eventually at random moment.
### Urgency
RunAsync is unusable in production
### Platform
Windows
### OS Version
11
### ONNX Runtime Installation
Released Package
### ONNX Runtime Version or Commit ID
1.26
### ONNX Runtime API
C#
### Architecture
X64
### Execution Provider
TensorRT
### Execution Provider Library Version
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the C# InferenceSession.RunAsync entry point and review the proposed fix in pull request #29391, focusing on the reported data-pinning failure. Reproduce continuous RunAsync calls on Windows 11 with ONNX Runtime 1.26 and TensorRT, and verify that the access violation no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100