Forums - C++ Tutorial snpe-sample Segmentation fault (core dumped)

4 posts / 0 new
Last post
C++ Tutorial snpe-sample Segmentation fault (core dumped)
Join Date: 29 May 18
Posts: 3
Posted: Thu, 2018-05-31 03:19
I follow the C++ Tutorial to make the snpe-sample then run, but got the "Segmentation fault (core dumped)".
Belows are my cmds:
cd $SNPE_ROOT/examples/NativeCpp/SampleCode
export CXX=g++
make -f Makefile.x86_64-linux-clang
cd $SNPE_ROOT/models/alexnet/data
$SNPE_ROOT/examples/NativeCpp/SampleCode/obj/local/x86_64-linux-clang/snpe-sample -b ITENSOR -d ../dlc/bvlc_alexnet.dlc -i target_raw_list.txt -o output
->got the "Segmentation fault (core dumped)".
Howerver, using the snpe-net-run cmd as below is work.
snpe-net-run --container ../dlc/bvlc_alexnet.dlc --input_list target_raw_list.txt
So I add some process log and figure out the crash may be happened in:
auto logger_opt = snpe->getDiagLogInterface();
if (!logger_opt) throw std::runtime_error("SNPE failed to obtain logging interface");
auto logger = *logger_opt;
auto opts = logger->getOptions();
Could someone help me fix this issue?
Ubuntu: 16.04
SNPE: 1.14.1
  • Up2
  • Down0
Join Date: 15 Nov 18
Posts: 1
Posted: Tue, 2018-11-27 19:05

I have got the same error.
Did you get the solution?
Does this has to do with Ubuntu version?

  • Up0
  • Down0
Join Date: 24 Jul 18
Posts: 3
Posted: Mon, 2018-12-24 00:39

check your gcc version, if its gcc5.4. then using gcc4.9 may solve your problem.

  • Up0
  • Down0
Join Date: 4 Nov 18
Posts: 34
Posted: Tue, 2019-01-29 01:22
Hi Hsiaoyuh_wang,
The vesion of gcc is mattered, so you please use gcc 4.9. Below you can find the steps to use multiple gcc versions,
#sudo apt-get update
#sudo apt-get install g++-4.9
#sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5
#sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
Remember to choose gcc-4.9 before running the snpe application/command:
#sudo update-alternatives --config gcc
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.