CreateTensor with tensor size of bigger than 65536 causes BAD_ACCESS in Run on macOS #17884
Labels
platform:windows
issues related to the Windows platform
stale
issues that have not been addressed in a while; categorized by a bot
Describe the issue
When the size of Output Tensor is bigger than 65536 (e.g. 131024), the BAD_ACCESS exception will be raised in Run(), this only happens on macOS. Windows does not have such problem.
To reproduce
auto memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
auto input_tensor = Ort::Value::CreateTensor(memory_info, input.data(), input.size(), input_shape.data(), input_shape.size());
auto output_tensor = Ort::Value::CreateTensor(memory_info, output.data(), output.size(), //bigger than 65536
output_shape.data(), output_shape.size());
Ort::AllocatorWithDefaultOptions ort_alloc;
std::optionalOrt::AllocatedStringPtr input_name;
std::optionalOrt::AllocatedStringPtr output_name;
input_name.emplace(sessions[index]->GetInputNameAllocated(0, ort_alloc));
output_name.emplace(sessions[index]->GetOutputNameAllocated(0, ort_alloc));
const char* input_names[] = {input_name->get()};
char* output_names[] = {output_name->get()};
session->Run(Ort::RunOptions{nullptr}, input_names, &input_tensor, 1, output_names, &output_tensor, 1);
Urgency
No response
Platform
Mac
OS Version
14.0
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.14.0
ONNX Runtime API
C++
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: