Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
19.69k stars 4.1k forks source link

occational error when running sample #2171

Open wangjia184 opened 3 years ago

wangjia184 commented 3 years ago

Amlogic s912 SoC

$ uname -a
Linux aml 5.5.0-rc6-aml-s9xxx #rc1.037 SMP PREEMPT Wed Feb 5 16:55:20 MSK 2020 aarch64 GNU/Linux

Application example is from https://github.com/Tencent/ncnn/blob/master/examples/yolov3.cpp, and it is simplied without drawing the object.

Same application, same input. run it for multiple times, and receive different error occationally.

jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
Illegal instruction
jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
Segmentation fault
jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
126ms
jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
112ms
jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
174ms
jerry@aml:~/housekeeper/bin$ ./housekeeper  ./4.jpg
125ms
baryluk commented 3 years ago

Try running under gdb to figure details.

gdb --args ./housekeeper ./4.jpg, then run in gdb. When it crashes do bt full, and quit.

If not try run again.

Also it might be good to know what compiler, version of compiler and compiler flags you used.

wangjia184 commented 3 years ago
$ cmake ..
-- CMAKE_INSTALL_PREFIX = /home/jerry/housekeeper/ncnn/build/install
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Target arch: arm
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- OpenCV library: /usr
--     version: 3.2.0
--     libraries: opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_videoio
--     include path: /usr/include;/usr/include/opencv
-- Found Protobuf: /usr/lib/aarch64-linux-gnu/libprotobuf.so;-lpthread (found version "3.6.1")
-- Configuring done
-- Generating done

$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux aml 5.5.0-rc6-aml-s9xxx #rc1.037 SMP PREEMPT Wed Feb 5 16:55:20 MSK 2020 aarch64 GNU/Linux
$ cat /etc/issue
Armbian 20.02.0-rc1.037 Buster \l

$ lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           2
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1512.0000
CPU min MHz:         100.0000
BogoMIPS:            48.00
L1d cache:           unknown size
L1i cache:           unknown size
L2 cache:            unknown size
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
(gdb) run
Starting program: /home/jerry/housekeeper/bin/housekeeper ./4.jpg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0xffffe76bef90 (LWP 5519)]
[New Thread 0xffffe6c4cf90 (LWP 5520)]
[New Thread 0xffffe644bf90 (LWP 5521)]
[New Thread 0xffffe5c4af90 (LWP 5522)]
[New Thread 0xffffe5449f90 (LWP 5523)]
[New Thread 0xffffe4c48f90 (LWP 5524)]
[New Thread 0xffffe4447f90 (LWP 5525)]
[New Thread 0xffffe3c46f90 (LWP 5526)]
108ms
[Thread 0xffffe76bef90 (LWP 5519) exited]
[Thread 0xffffe76c8010 (LWP 5516) exited]
[Thread 0xffffe3c46f90 (LWP 5526) exited]
[Thread 0xffffe4c48f90 (LWP 5524) exited]
[Thread 0xffffe5449f90 (LWP 5523) exited]
[Thread 0xffffe5c4af90 (LWP 5522) exited]
[Thread 0xffffe644bf90 (LWP 5521) exited]
[Thread 0xffffe6c4cf90 (LWP 5520) exited]
[Inferior 1 (process 5516) exited normally]
(gdb) run
Starting program: /home/jerry/housekeeper/bin/housekeeper ./4.jpg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0xffffe76bef90 (LWP 5528)]
[New Thread 0xffffe6c4cf90 (LWP 5529)]
[New Thread 0xffffe644bf90 (LWP 5530)]
[New Thread 0xffffe5c4af90 (LWP 5531)]
[New Thread 0xffffe5449f90 (LWP 5532)]
[New Thread 0xffffe4c48f90 (LWP 5533)]
[New Thread 0xffffe4447f90 (LWP 5534)]
[New Thread 0xffffe3c46f90 (LWP 5535)]

Thread 3 "housekeeper" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xffffe6c4cf90 (LWP 5529)]
0x0000aaaaaab1fbd8 in ncnn::conv1x1s1_sgemm_pack4_neon(ncnn::Mat const&, ncnn::Mat&, ncnn::Mat const&, ncnn::Mat const&, ncnn::Option const&) [clone ._omp_fn.12] ()
(gdb) bt full
#0  0x0000aaaaaab1fbd8 in ncnn::conv1x1s1_sgemm_pack4_neon(ncnn::Mat const&, ncnn::Mat&, ncnn::Mat const&, ncnn::Mat const&, ncnn::Option const&) [clone ._omp_fn.12] ()
No symbol table info available.
#1  0x0000fffff69f2cd4 in ?? () from /usr/lib/aarch64-linux-gnu/libgomp.so.1
No symbol table info available.
#2  0x0000fffff69927e4 in start_thread () from /lib/aarch64-linux-gnu/libpthread.so.0
No symbol table info available.
#3  0x0000fffff68e8adc in ?? () from /lib/aarch64-linux-gnu/libc.so.6
No symbol table info available.