Openpose: Segmentation fault (core dumped) when json file generation

Created on 16 Jun 2017  ·  10Comments  ·  Source: CMU-Perceptual-Computing-Lab/openpose

Issue summary

Get "Segmentation fault (core dumped)" when trying to output the json file.

Executed command (if any)

./build/examples/openpose/openpose.bin --video 1.avi --no_display true --write_video result.avi --write_keypoint_json a.json --face --keypoint_scale 3

I also tried
sudo ./build/examples/openpose/openpose.bin --video 1.avi --no_display true --write_video result.avi --write_keypoint_json a.json --face --keypoint_scale 3
The error is gone, but it still doesn't work.

But
./build/examples/openpose/openpose.bin --video 1.avi --no_display true --write_video result.avi --write_coco_json a.json --face --keypoint_scale 3
works perfect.

OpenPose output (if any)

libdc1394 error: Failed to initialize libdc1394
Starting pose estimation demo.
examples/openpose/openpose.cpp:gflagsToOpParameters():212
examples/openpose/openpose.cpp:gflagsToProducer():180
examples/openpose/openpose.cpp:gflagsToProducerType():160
examples/openpose/openpose.cpp:gflagToPoseModel():122
examples/openpose/openpose.cpp:gflagToScaleMode():138
Configuring OpenPose wrapper. In examples/openpose/openpose.cpp:opRealTimePoseDemo():263
./include/openpose/wrapper/wrapper.hpp:configure():423
Auto-detecting GPUs... Detected 1 GPU(s), using them all.
./include/openpose/wrapper/wrapper.hpp:configure():581
Segmentation fault (core dumped)

and

Starting pose estimation demo.
examples/openpose/openpose.cpp:gflagsToOpParameters():212
examples/openpose/openpose.cpp:gflagsToProducer():180
examples/openpose/openpose.cpp:gflagsToProducerType():160
examples/openpose/openpose.cpp:gflagToPoseModel():122
examples/openpose/openpose.cpp:gflagToScaleMode():138
Configuring OpenPose wrapper. In examples/openpose/openpose.cpp:opRealTimePoseDemo():263
./include/openpose/wrapper/wrapper.hpp:configure():423
Auto-detecting GPUs... Detected 1 GPU(s), using them all.
./include/openpose/wrapper/wrapper.hpp:configure():581
for the second line.

(gdb) bt
#0  0x00007ffff71a2440 in std::string::assign(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff585e638 in boost::filesystem::filesystem_error::filesystem_error(std::string const&, boost::filesystem::path const&, boost::system::error_code) ()
   from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0
#2  0x00007ffff5859e86 in boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*) ()
   from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0
#3  0x00007ffff78d76e8 in op::mkdir(std::string const&) () from /data/ltl/openpose-master/.build_release/examples/openpose/../../lib/libopenpose.so.1.0.0-rc3
#4  0x00007ffff796eaa3 in op::FileSaver::FileSaver(std::string const&) ()
   from /data/ltl/openpose-master/.build_release/examples/openpose/../../lib/libopenpose.so.1.0.0-rc3
#5  0x00007ffff79bbf87 in std::__shared_ptr<op::KeypointJsonSaver, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<op::KeypointJsonSaver>, std::string const&>(std::_Sp_make_shared_tag, std::allocator<op::KeypointJsonSaver> const&, std::string const&) ()
   from /data/ltl/openpose-master/.build_release/examples/openpose/../../lib/libopenpose.so.1.0.0-rc3
#6  0x00007ffff79c0101 in op::Wrapper<std::vector<op::Datum, std::allocator<op::Datum> >, std::shared_ptr<op::Worker<std::shared_ptr<std::vector<op::Datum, std::allocator<op::Datum> > > > >, op::Queue<std::shared_ptr<std::vector<op::Datum, std::allocator<op::Datum> > >, std::queue<std::shared_ptr<std::vector<op::Datum, std::allocator<op::Datum> > >, std::deque<std::shared_ptr<std::vector<op::Datum, std::allocator<op::Datum> > >, std::allocator<std::shared_ptr<std::vector<op::Datum, std::allocator<op::Datum> > > > > > > >::configure(op::WrapperStructPose const&, op::WrapperStructFace const&, op::WrapperStructHand const&, op::WrapperStructInput const&, op::WrapperStructOutput const&) () from /data/ltl/openpose-master/.build_release/examples/openpose/../../lib/libopenpose.so.1.0.0-rc3
#7  0x000000000040bd86 in opRealTimePoseDemo() ()
#8  0x000000000040309f in main ()

Type of issue

  • Help wanted
help wantequestion

Most helpful comment

for arch distributions, installing py++ from AUR may resolve the seg fault after build issue: pacman -S py++ https://aur.archlinux.org/packages/py%2B%2B/

All 10 comments

I don't know why but when I deleted all codes in op::mkdir(), it works fine...

Hi, I use the boost library for mkdir(). So I think it should be either of these problems:
1) You are trying to create a dir in a protected folder (e.g. /usr/local/), but I tried that and it did not crash, so I do not think this is the problem (just to make sure this is not the problem, you can try running the demo with sudo.
2) Remove boost and re-install it again. After re-installing it, you will have to remove (or re-compile) and re-install OpenPose too.
Let me know whether and which one works!

Running the demo with sudo doesn't help, just hides the error, but re-installing boost works.
Thanks!

I get Segmentation fault again without doing anything, just re-compiled OpenPose, and re-installing boost doesn't work this time...

Is the same function? It is definitively something to do with boost, someone posted in the past that compiling boost from scratch (instead of the apt-get version) worked for him (and re-compiling OpenPose/Caffe)

But didn't work for me...
The same function, and op::getFilesOnDirectory, and op::exist (directoryPath="images/")...

OK thank you for the feed-back, all of those functions use boost... So far I have no more idea how to fix it other than what other people said about re-compiling boost. Please post (you or anyone) if you find a solution for that problem. I will try to look something else but I cannot test it myself since it is working on my devices, so no idea how to debug it from here...

for arch distributions, installing py++ from AUR may resolve the seg fault after build issue: pacman -S py++ https://aur.archlinux.org/packages/py%2B%2B/

Same issue..

Hi @miraikeshiki , how did you solve this problem? I am having the same and I tried everything suggested on the posts (rebuild boost, rebuild opencv etc) multiple times but the outcome is always the same.

Was this page helpful?
0 / 5 - 0 ratings