Skip to content

[Mobile] [urgent] iOS application crash at CreateEnv (pointer being freed was not allocated) #23759

Description

@Consulting4J

Describe the issue

with bridge iOS application would call the following c code

OrtEnv *env;
OrtSession *session;
OrtSessionOptions *session_options;
const OrtApi* g_ort = OrtGetApiBase()->GetApi(ORT_API_VERSION);
g_ort->CreateEnv(ORT_LOGGING_LEVEL_FATAL, "", &env);
g_ort->CreateSessionOptions(&session_options);

while try to run this application on device got the following error:

malloc: *** error for object 0x3293902a: pointer being freed was not allocated

this onnxruntime libs were build by the following steps:
https://onnxruntime.ai/docs/build/ios.html

./build.sh --config MinSizeRel --use_xcode
--ios --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 15.0

device : iPhone pro max 13

any idea to solve such simple problem?
many thanks !

To reproduce

run the following code in any ios application:

OrtEnv *env;
OrtSession *session;
OrtSessionOptions *session_options;
const OrtApi* g_ort = OrtGetApiBase()->GetApi(ORT_API_VERSION);
g_ort->CreateEnv(ORT_LOGGING_LEVEL_FATAL, "", &env);
g_ort->CreateSessionOptions(&session_options);

Urgency

yes this is urgent

Platform

iOS

OS Version

18.1

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

apple clang 16.1

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

v1.20.2

ONNX Runtime API

C++/C

Architecture

ARM64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:mobileissues related to ONNX Runtime mobile; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions