Skip to content

[Mobile] React Native app crash with Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x6f6d9217fc in tid 10411 (mqt_native_modu), pid 10224 (ReactNativeDemo) #17541

Description

@bartproo

Describe the issue

image
I can confirm that this error occurs when I run const "fetches = await session.run(feeds);". As this is native crash, I have no idea how to fix it. Please help! The code works on pixel 4a emulator but not on my samsung note 10 lite.

To reproduce

Code crashed after running const fetches = await session.run(feeds); and upon setting breakpoint, the app crashing point is determined to be at OrtSession.java

OrtSession.java crashing point:

      OnnxValue[] outputValues =
          run(
              OnnxRuntime.ortApiHandle,
              nativeHandle,
              allocator.handle,
              inputNamesArray,
              inputHandles,
              inputNamesArray.length,
              outputNamesArray,
              outputNamesArray.length,
              runOptionsHandle);
      return new Result(outputNamesArray, outputValues);

My code crashing point:

export const predictModelfromUri = async (
  session: ort.InferenceSession,
  imageUri: string
): Promise<number> => {
  const imageFloat32 = await convertImageToFloat32Array(imageUri);
  const feeds: Record<string, ort.Tensor> = {};
  feeds[session.inputNames[0]] = new ort.Tensor(
    "float32",
    imageFloat32!,
    [1, 3, 224, 224]
  );
  const fetches = await session.run(feeds);
  const output: object = fetches[session.outputNames[0]].data;
  return findMaxId(Object.values(output));
};

Urgency

No response

Platform

Android

OS Version

13

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

[email protected]

ONNX Runtime API

Java/Kotlin

Architecture

ARM64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:Javaissues related to the Java APIplatform:mobileissues related to ONNX Runtime mobile; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions