Skip to content

[onnxruntime_perf_test] Fix custom_allocator_ destruction order. #24136

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

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

edgchen1
Copy link
Contributor

Description

Fix custom_allocator_ destruction order.

Move the allocator data member declaration before the Ort::Value container data members that might use the allocator so that the Ort::Value containers will be destroyed first.

custom_allocator_ may be used as the allocator for the Ort::Values in test_inputs_ and outputs_. The allocator shouldn't be destroyed before Ort::Values allocated with it are freed.

Motivation and Context

Fix segfault on Android.

@edgchen1 edgchen1 merged commit 1ef3044 into main Mar 25, 2025
90 of 92 checks passed
@edgchen1 edgchen1 deleted the edgchen1/fix_perf_test_custom_allocator_issue branch March 25, 2025 19:42
quic-zhaoxul pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Apr 17, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…rosoft#24136)

Move the allocator data member declaration before the `Ort::Value`
container data members that might use the allocator so that the
`Ort::Value` containers will be destroyed first.

`custom_allocator_` may be used as the allocator for the `Ort::Value`s
in `test_inputs_` and `outputs_`. The allocator shouldn't be destroyed
before `Ort::Value`s allocated with it are freed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants