dividiti / ck-caffe

Collective Knowledge workflow for Caffe to automate installation across diverse platforms and to collaboratively evaluate and optimize Caffe-based workloads across diverse hardware, software and data sets (compilers, libraries, tools, models, inputs):
http://cKnowledge.org
BSD 3-Clause "New" or "Revised" License
193 stars 40 forks source link

Segmentation fault when using "caffe time" #100

Closed kindloaf closed 7 years ago

kindloaf commented 7 years ago

Hi, I'm trying to run caffe time on an android device. I used the following command:

~/platform-tools/adb shell 'cd /data/local/tmp/tmp; LD_LIBRARY_PATH=.:.. ./caffe time --model=a.prototxt'
invalid address or address of corrupt block 0x55955c39d0 passed to dlfree
Segmentation fault 

Here is the call stack, although the real error could have happened in a different place:

#00 pc 0000000000047138  /system/lib64/libc.so (dlfree+408)
#01 pc 00000000000194ec  /system/lib64/libc.so (free+20)
#02 pc 0000000000d35dac  /data/local/tmp/tmp/libcaffe.so (std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+136)
#03 pc 00000000006c1518  /data/local/tmp/tmp/libcaffe.so (google::(anonymous namespace)::FlagValue::CopyFrom(google::(anonymous namespace)::FlagValue const&)+304)  
#04 pc 00000000006c252c  /data/local/tmp/tmp/libcaffe.so (google::(anonymous namespace)::TryParseLocked(google::(anonymous namespace)::CommandLineFlag const*, google::(anonymous namespace)::FlagValue*, char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)+340)
#05 pc 00000000006c2630  /data/local/tmp/tmp/libcaffe.so (google::(anonymous namespace)::FlagRegistry::SetFlagLocked(google::(anonymous namespace)::CommandLineFlag*, char const*, google::FlagSettingMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)+88)
#06 pc 00000000006c3b7c  /data/local/tmp/tmp/libcaffe.so (google::(anonymous namespace)::CommandLineFlagParser::ProcessSingleOptionLocked(google::(anonymous namespace)::CommandLineFlag*, char const*, google::FlagSettingMode)+80)
#07 pc 00000000006c3150  /data/local/tmp/tmp/libcaffe.so (google::(anonymous namespace)::CommandLineFlagParser::ParseNewCommandLineFlags(int*, char***, bool)+1400)   
#08 pc 00000000006c5dd0  /data/local/tmp/tmp/libcaffe.so (google::ParseCommandLineFlagsInternal(int*, char***, bool, bool)+232)
#09 pc 00000000006c5e70  /data/local/tmp/tmp/libcaffe.so (google::ParseCommandLineFlags(int*, char***, bool)+36)
#10 pc 000000000048a5a8  /data/local/tmp/tmp/libcaffe.so (caffe::GlobalInit(int*, char***)+20)
#11 pc 000000000001ad48  /data/local/tmp/tmp/caffe (main+168)
#12 pc 00000000000196b0  /system/lib64/libc.so (__libc_init+100)
#13 pc 000000000001bb00  /data/local/tmp/tmp/caffe (do_arm64_start+60)

Any advice?

gfursin commented 7 years ago

Does it work if you try to compile and run caffe time via CK?

I.e. $ ck compile program:caffe-time --target_os=android21-arm64 $ ck run program:caffe-time --target_os=android21-arm64

kindloaf commented 7 years ago

It worked! Thanks a lot.

kindloaf commented 7 years ago

By the way, the command I used was against "program:caffe-time-opencl".

gfursin commented 7 years ago

Sure, we had to separate CPU/OpenCL/CUDA versions due to linking of different libraries (it was just simpler at this stage since Caffe has different branches for OpenCL and non-OpenCL versions) ...