Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 15.10 /16.04 runtest : Segmentation fault (core dumped)—— Be sure to link with compatible libraries #4499

Closed
Solomon1588 opened this issue Jul 22, 2016 · 4 comments

Comments

@Solomon1588
Copy link

Solomon1588 commented Jul 22, 2016

I got a segmentation fault when I make runtest in Ubuntu 15.10, this problem is similar to the following issue:
ubuntu16.04 runtest failed
[----------] 9 tests from AdaGradSolverTest/2, where TypeParam = caffe::GPUDevice<float> [ RUN ] AdaGradSolverTest/2.TestAdaGradLeastSquaresUpdateWithWeightDecay *** Aborted at 1464576931 (unix time) try "date -d @1464576931" if you are using GNU date *** PC: @ 0x7f99aa977143 (unknown) *** SIGSEGV (@0x706d742f) received by PID 12752 (TID 0x7f99b1f20740) from PID 1886221359; stack trace: *** @ 0x7f99a8de43d0 (unknown) @ 0x7f99aa977143 (unknown) @ 0x480463 caffe::MakeTempDir() @ 0x49444a caffe::GradientBasedSolverTest<>::RunLeastSquaresSolver() @ 0x4a533d caffe::GradientBasedSolverTest<>::TestLeastSquaresUpdate() @ 0x893d13 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0x88a9f7 testing::Test::Run() @ 0x88aa9e testing::TestInfo::Run() @ 0x88aba5 testing::TestCase::Run() @ 0x88dee8 testing::internal::UnitTestImpl::RunAllTests() @ 0x88e177 testing::UnitTest::Run() @ 0x46215f main @ 0x7f99a8a2a830 (unknown) @ 0x469649 _start Makefile:523: recipe for target 'runtest' failed make: *** [runtest] Segmentation fault (core dumped)

My environment is:
Ubuntu 15.10 64bit mate intel MKL
Cuda 7.5 g++/gcc 4.9.3
I've searched many information and I find this is a common problem.In order to make compile successful,I compiled protobuf, glog,gflags manually with GCC4.9. But I got a runtime error: Segmentation fault.
With the @seanbell 's suggestion in #4235 ,I read the source code of caffe/include/caffe/util/io.hpp

inline void MakeTempDir(string* temp_dirname) {

I guess the boost may be the error's reason, so I autoremove libboost-all-dev and compile the boost 1.58 manually with GCC 4.9 .Fortunately , I make runtest successfully !


_The truth:_


@ferrouswheel's post in #4417 inspired me:" I had previously tryed to make CUDA work by changing to gcc 4.9. Unfortunately the c++ ABI changed so compiling stuff with 4.9 and trying to link to system libraries built with gcc 5 won't work."
On thegoogle mailing list Darren Garvey's mail
https://groups.google.com/d/msg/caffe-users/a6TDx89IByY/fvsWbwqzCwAJ
clarified the core reason: The issue with linking to protobu, boostf is down to c++ ABI changes between GCC 4.9 and GCC 5.x. The ABI for std::string has changed so you need to be sure to link with compatible libraries.
Since CUDA doesn't officially support GCC >= 4.9, I had set CUDA_HOST_COMPILER to get CUDA stuff compiled. The issue with doing just that is that caffe will build with the default GCC which is 5.2.
If you go ahead and build caffe with GCC 4.9 as well then you'll have link problems against the libprotobuf-dev package which is built with GCC 5.x as with all other Ubuntu packages in 15.10.
You can recompile CUDA and Caffe with GCC 5.2 to make sure the library links between the caffe and libraries in the repository is campatible.You should change the file /usr/local/cuda/include/host_config.h and follow the Ubuntu 16.04 or 15.10 Installation Guide.
Moreover,you may want to build everything with GCC 4.9 but you'll also have to build protobuf and possibly also all other system packages that export c++ functions containing std::string, std::vector, etc.with GCC 4.9 (eg. glog, gflags, boost .etc).

That‘s why compile the boost manually can solve the problem :D

@flx42
Copy link
Contributor

flx42 commented Jul 22, 2016

Since CUDA doesn't officially support GCC >= 4.9, I had set CUDA_HOST_COMPILER to get CUDA stuff compiled.

Just use CUDA 8.0 and it will work fine.
Anyway, your message probably belongs to the caffe-users group

@pythonanonuser
Copy link

Same problem but I'm running it in CPU_ONLY mode. Any thoughts?

@shelhamer
Copy link
Member

Please ask installation questions on the mailing list. If you're having trouble, you might want to try the Caffe Dockerfile to take care of installation for you.

From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:

Please do not post usage, installation, or modeling questions, or other requests for help to Issues.
Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

@antran89
Copy link
Contributor

Switch to gcc-5 works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants