MNN icon indicating copy to clipboard operation
MNN copied to clipboard

ModuleBasic.out崩溃

Open lucaslv404 opened this issue 8 months ago • 4 comments

在使用ModuleBasic.out推理出现崩溃

MNN 版本:3.0.0 Commit ID: 707b8a41b25e3d0b7c4a39cd81109d7074ca3c28 设备:Redmi K60 Pro SoC:骁龙8Gen2 OS: MIUI 14.0.25

运行命令: ModuleBasic.out /data/local/tmp/nn/model/convert_cache.mnn /data/local/tmp/nn/model/onnx 0 0 100 1 0

错误日志:

04-14 19:36:33.047 24570 24570 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
04-14 19:36:33.048  1157  1157 I tombstoned: received crash request for pid 24566
04-14 19:36:33.051 24570 24570 I crash_dump64: performing dump of process 24566 (target tid = 24566)
04-14 19:36:33.077 24570 24570 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-14 19:36:33.077 24570 24570 F DEBUG   : Build fingerprint: 'Redmi/socrates/socrates:13/TKQ1.220905.001/V14.0.25.0.TMKCNXM:user/release-keys'
04-14 19:36:33.077 24570 24570 F DEBUG   : Revision: '0'
04-14 19:36:33.078 24570 24570 F DEBUG   : ABI: 'arm64'
04-14 19:36:33.078 24570 24570 F DEBUG   : Timestamp: 2025-04-14 19:36:33.054194570+0800
04-14 19:36:33.078 24570 24570 F DEBUG   : Process uptime: 1s
04-14 19:36:33.078 24570 24570 F DEBUG   : ZygotePid: 963525719
04-14 19:36:33.078 24570 24570 F DEBUG   : Cmdline: bin/ModuleBasic.out /data/local/tmp/nn/model/convert_cache.mnn /data/local/tmp/nn/model/onnx 0 0 100 1 0
04-14 19:36:33.078 24570 24570 F DEBUG   : pid: 24566, tid: 24566, name: ModuleBasic.out  >>> bin/ModuleBasic.out <<<
04-14 19:36:33.078 24570 24570 F DEBUG   : uid: 2000
04-14 19:36:33.078 24570 24570 F DEBUG   : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
04-14 19:36:33.078 24570 24570 F DEBUG   : pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
04-14 19:36:33.079 24570 24570 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000
04-14 19:36:33.079 24570 24570 F DEBUG   : Cause: null pointer dereference
04-14 19:36:33.079 24570 24570 F DEBUG   :     x0  b400007570035280  x1  0000007fffaedb80  x2  0000000000000006  x3  0000000000000a65
04-14 19:36:33.079 24570 24570 F DEBUG   :     x4  00000075700000a0  x5  00000075700000c0  x6  b40000757000e48f  x7  0000007570023420
04-14 19:36:33.079 24570 24570 F DEBUG   :     x8  0000007fffaeda58  x9  0000000000000001  x10 0000000000000000  x11 0000000000000001
04-14 19:36:33.079 24570 24570 F DEBUG   :     x12 0000000000000000  x13 0000000000000002  x14 0000000000000000  x15 0000007574900982
04-14 19:36:33.079 24570 24570 F DEBUG   :     x16 00000075749dca98  x17 00000075749cb25c  x18 00000075769c8000  x19 b4000075700234e0
04-14 19:36:33.079 24570 24570 F DEBUG   :     x20 0000000000000000  x21 b4000075700234e8  x22 0000007fffaedf20  x23 0000007fffaedeb8
04-14 19:36:33.079 24570 24570 F DEBUG   :     x24 b4000075700078f0  x25 0000007fffaedfd0  x26 0000000000000018  x27 0000005584ad571d
04-14 19:36:33.080 24570 24570 F DEBUG   :     x28 0000000000000000  x29 aaaaaaaaaaaaaaab
04-14 19:36:33.080 24570 24570 F DEBUG   :     lr  0000005584ae35e0  sp  0000007fffaed930  pc  000000757099e9d0  pst 0000000060001000
04-14 19:36:33.080 24570 24570 F DEBUG   : backtrace:
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE: Function names and BuildId information is missing for some frames due
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE: found under the lib/ directory are readable.
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE: On this device, run setenforce 0 to make the libraries readable.
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE: Unreadable libraries:
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE:   /data/local/tmp/nn/bin/ModuleBasic.out
04-14 19:36:33.080 24570 24570 F DEBUG   :   NOTE:   /data/local/tmp/nn/lib/libMNN.so
04-14 19:36:33.080 24570 24570 F DEBUG   :       #00 pc 00000000003829d0  /data/local/tmp/nn/lib/libMNN.so
04-14 19:36:33.080 24570 24570 F DEBUG   :       #01 pc 00000000000175dc  /data/local/tmp/nn/bin/ModuleBasic.out
04-14 19:36:33.080 24570 24570 F DEBUG   :       #02 pc 00000000000859b8  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100) (BuildId: 449f781894033dce6346794a1ee593e0)

解析崩溃栈

addr2line -f -e /code/out/ANDROID/lib/libMNN.so 00000000003829d0
_ZN3MNN7Express9NetModule9onForwardERKNSt6__ndk16vectorINS0_4VARPENS2_9allocatorIS4_EEEE
/code/nn/mnn/mnn/express/module/Module.cpp:217

addr2line -f -e /code/out/ANDROID/bin/ModuleBasic.out 00000000000175dc
main
/code/nn/mnn/mnn/tools/cpp/ModuleBasic.cpp:370

lucaslv404 avatar Apr 14 '25 11:04 lucaslv404

崩溃指向:https://github.com/alibaba/MNN/blob/707b8a41b25e3d0b7c4a39cd81109d7074ca3c28/express/module/Module.cpp#L217

lucaslv404 avatar Apr 14 '25 11:04 lucaslv404

  1. 更新到 3.1.2 试试?
  2. 这个看上去是 shape 计算失败,中间应该有其他 log ,命令行下面的日志也看一下?
  3. 相关模型和测试文件夹麻烦提交一下

jxt1234 avatar Apr 14 '25 11:04 jxt1234

使用最新3.1.2版本同样会崩在mModule->onForward处

lucaslv404 avatar Apr 17 '25 10:04 lucaslv404

这个看着应该是 输入输出名 和模型不匹配,用 GetMNNInfo 看下模型信息,对比 input.json

jxt1234 avatar May 09 '25 02:05 jxt1234

Marking as stale. No activity in 60 days.

github-actions[bot] avatar Jul 08 '25 10:07 github-actions[bot]