-
Notifications
You must be signed in to change notification settings - Fork 3k
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
CoreDump bad_alloc while GetShape #19991
Comments
It is hard to tell what the problem might be without the onnx models. Are you able to share the onnx model? Also, is my understanding correct that the execution on CentOS was ok, but as soon as you moved to Ubuntu, you started noticing this failure? |
thanks! |
I solved this problem using gdb single-step debugging. The cause of the problem was that I didn't notice that GetOutputTypeInfo returned a temporary variable instead of a reference. So later GetShape() actually accessed the memory that had already been released.
|
Describe the issue
I migrated the code and model from CentOS to Ubuntu and noticed a strange thing:
under Ubuntu, reading the output information in the graph would cause a core dump. After debugging, I found that when GetShape was called, the output (dynamic batch) dimension became a very large number (94768101806096), whereas it should have been 2 ([-1, 1]).
And I can load the model on the same mache by python onnx, model outputs:
[name: "score"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_param: "Gemmscore_dim_0"
}
dim {
dim_value: 1
}
}
}
}
]
I can even run the model normally with c++ if I skip checking output shape.
Anyone can help?
To reproduce
model:
model_onnx.zip
cmake CMakeLists.txt
test.cpp
I solved this problem using gdb single-step debugging. The cause of the problem was that I didn't notice that GetOutputTypeInfo returned a temporary variable instead of a reference. So later GetShape() actually accessed the memory that had already been released.
Running successfully on CentOS is just a coincidence.
right way:
Urgency
No response
Platform
Linux
OS Version
20.04
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.16.3
ONNX Runtime API
C++
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: