-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccessViolationException occurs during multiple calls #23713
Comments
And I tried set
crash log: [Embedding] Invalid session |
Sorry, It's my problem, I |
AccessViolationException occurs during multiple calls (the crash happens after Profiler::EndProfiling while writing profiler data to a file).
It's not because of the issue with EnableProfiling. I enabled EnableProfiling because the existing logs were crashing when I tried to view them.
When I call
InferenceSession.Run
in a multi-threaded environment, this function crashes after running several times.If I create a new
InferenceSession
instance every time, it does not crash and works well.I have tried adding a lock to prevent concurrent calls, but that did not solve the issue. I understand that
InferenceSession.Run
is thread-safe.Here is the log.
Crash log1:
lfOwnBufferHelper] For ort_value with index: 266, block in memory pattern size is: 194560 but the actual size is: 27904, fall back to default allocation behavior
......
2025-02-15 17:57:52.0556390 [V:onnxruntime:, execution_frame.cc:563 onnxruntime::ExecutionFrame::AllocateMLValueTensorSelfOwnBufferHelper] For ort_value with index: 339, block in memory pattern size is: 276480 but the actual size is: 104448, fall back to default allocation behavior
2025-02-15 17:57:52.0618346 [V:onnxruntime:, execution_frame.cc:563 onnxruntime::ExecutionFrame::AllocateMLValueTensorSelfOwnBufferHelper] For ort_value with index: 340, block in memory pattern size is: 276480 but the actual size is: 104448, fall back to default allocation behavior
2025-02-15 17:57:52.1096720 [I:onnxruntime:, profiler.cc:115 onnxruntime::profiling::Profiler::EndProfiling] Writing profiler data to file onnxruntime_profile__2025-02-15_17-55-37.json
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Crash log2:
2025-02-15 18:06:59.7739997 [V:onnxruntime:, execution_frame.cc:563 onnxruntime::ExecutionFrame::AllocateMLValueTensorSelfOwnBufferHelper] For ort_value with index: 339, block in memory pattern size is: 122880 but the actual size is: 251904, fall back to default allocation behavior
2025-02-15 18:06:59.7802401 [V:onnxruntime:, execution_frame.cc:563 onnxruntime::ExecutionFrame::AllocateMLValueTensorSelfOwnBufferHelper] For ort_value with index: 340, block in memory pattern size is: 122880 but the actual size is: 251904, fall back to default allocation behavior
2025-02-15 18:07:00.4918686 [I:onnxruntime:, profiler.cc:115 onnxruntime::profiling::Profiler::EndProfiling] Writing profiler data to file onnxruntime_profile__2025-02-15_18-04-46.json
2025-02-15 18:07:00.8677663 [V:onnxruntime:, inference_session.cc:2904 onnxruntime::InferenceSession::EndProfiling] Profiler is disabled.
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
code
The text was updated successfully, but these errors were encountered: