Skip to content

[C++, Linux] Segmentation fault when run OrtApi::Run #23897

Description

@eason-yi-nio

Describe the issue

I get a Segmentation Fault when I try to run OrtApi::Run from C++ on Linux.

the back trace goes like:
(gdb) bt
#0 0x00007ffff7aadf30 in ?? () from /lib/libonnxruntime.so.1
#1 0x00007ffff711c06d in ?? () from /lib/libonnxruntime.so.1
#2 0x00007ffff7071939 in ?? () from /lib/libonnxruntime.so.1
#3 0x00005555555c5e74 in OrtHandler::ModuleInference<unsigned long, std::vector<unsigned long, std::allocator > > (this=0x7fffffffd170, input=std::vector of length 4, capacity 4 = {...},
output=std::vector of length 0, capacity 0, model_path="../tests/fota_model.ort", model_env_name="onnxruntime") at /home/eason.yi/work_space/ai-demo/FOTAi/include/common/ort_handler.h:246
#4 0x00005555555c2640 in FOTAi::FotaAnalyzer::applyModulePredication (this=0x55555562ad10) at /home/eason.yi/work_space/ai-demo/FOTAi/src/analyzer/analyzer.cpp:370
#5 0x00005555555c0126 in FOTAi::FotaAnalyzer::analyze (this=0x55555562ad10) at /home/eason.yi/work_space/ai-demo/FOTAi/src/analyzer/analyzer.cpp:224
#6 0x000055555556050b in FOTAi::Application::analyze (this=0x7fffffffdc10) at /home/eason.yi/work_space/ai-demo/FOTAi/src/application.cpp:76
#7 0x000055555555fd92 in FOTAi::Application::run (this=0x7fffffffdc10, argc=3, argv=0x7fffffffdd78) at /home/eason.yi/work_space/ai-demo/FOTAi/src/application.cpp:41
#8 0x00005555555b4548 in main (argc=3, argv=0x7fffffffdd78) at /home/eason.yi/work_space/ai-demo/FOTAi/src/main.cpp:7

To reproduce

test_demo.tar.gz
untar this gz
cd FOTAi/build
cmake ..
make -j
./FOTAi -c FOTAi.json

Urgency

No response

Platform

Linux

OS Version

Ubuntu 22.04.5 LTS

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

onnxruntime-linux-x64-1.20.1.tgz

ONNX Runtime API

C

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions