copperhead icon indicating copy to clipboard operation
copperhead copied to clipboard

Sementation Violation on Samples

Open arcfide opened this issue 11 years ago • 2 comments

I am having some trouble with getting copperhead up and running. I don't see a mailing list or some other method, so I am submitting the issue here. Here is the output of a backtrace on the python process that gives me the segmentation violation:

(gdb) run black_scholes.py
Starting program: /usr/bin/python black_scholes.py
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5ec1074 in backend::type_t::ptr() const ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/runtime/libcopperhead.so
(gdb) bt
#0  0x00007ffff5ec1074 in backend::type_t::ptr() const ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/runtime/libcopperhead.so
#1  0x00007ffff5e8da81 in backend::functorize::functorize(std::string const&, backend::registry const&) ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/runtime/libcopperhead.so
#2  0x00007ffff5e57950 in backend::compiler::operator()(backend::suite const&) ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/runtime/libcopperhead.so
#3  0x00007fffefcc703b in backend::compile(backend::compiler&, backend::suite const&) ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/compiler/backendcompiler.so
#4  0x00007fffefccb789 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<std::string (*)(backend::compiler&, backend::suite const&), boost::python::default_call_policies, boost::mpl::vector3<std::string, backend::compiler&, backend::suite const&> > >::operator()(_object*, _object*) ()
   from /usr/lib64/python2.7/site-packages/copperhead-0.2a2-py2.7.egg/copperhead/compiler/backendcompiler.so
#5  0x00007ffff68f5ceb in boost::python::objects::function::call(_object*, _object*) const ()
   from /usr/lib64/libboost_python.so.1.49.0
#6  0x00007ffff68f5f08 in ?? () from /usr/lib64/libboost_python.so.1.49.0
#7  0x00007ffff68fef2b in boost::python::handle_exception_impl(boost::function0<void>) ()
   from /usr/lib64/libboost_python.so.1.49.0
#8  0x00007ffff68f41c5 in ?? () from /usr/lib64/libboost_python.so.1.49.0
#9  0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#10 0x00007ffff7a56e80 in ?? () from /usr/lib64/libpython2.7.so.1.0
#11 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#12 0x00007ffff7aac9fc in ?? () from /usr/lib64/libpython2.7.so.1.0
#13 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#14 0x00007ffff7aebde9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#15 0x00007ffff7aeffe9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#16 0x00007ffff7aeffe9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#17 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#18 0x00007ffff7a73916 in ?? () from /usr/lib64/libpython2.7.so.1.0
#19 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#20 0x00007ffff7a56e80 in ?? () from /usr/lib64/libpython2.7.so.1.0
#21 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#22 0x00007ffff7aac9fc in ?? () from /usr/lib64/libpython2.7.so.1.0
#23 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#24 0x00007ffff7aebde9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#25 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#26 0x00007ffff7a73916 in ?? () from /usr/lib64/libpython2.7.so.1.0
#27 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#28 0x00007ffff7a56e80 in ?? () from /usr/lib64/libpython2.7.so.1.0
#29 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#30 0x00007ffff7aac9fc in ?? () from /usr/lib64/libpython2.7.so.1.0
#31 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#32 0x00007ffff7aebde9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#33 0x00007ffff7aeffe9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#34 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#35 0x00007ffff7a73a27 in ?? () from /usr/lib64/libpython2.7.so.1.0
#36 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#37 0x00007ffff7aeb481 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#38 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#39 0x00007ffff7a73a27 in ?? () from /usr/lib64/libpython2.7.so.1.0
#40 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#41 0x00007ffff7aeb481 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#42 0x00007ffff7aeffe9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
---Type <return> to continue, or q <return> to quit---
#43 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#44 0x00007ffff7a73916 in ?? () from /usr/lib64/libpython2.7.so.1.0
#45 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#46 0x00007ffff7a56e80 in ?? () from /usr/lib64/libpython2.7.so.1.0
#47 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#48 0x00007ffff7a550d6 in ?? () from /usr/lib64/libpython2.7.so.1.0
#49 0x00007ffff7a48a3e in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#50 0x00007ffff7aebde9 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#51 0x00007ffff7af0b48 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#52 0x00007ffff7af0c82 in PyEval_EvalCode () from /usr/lib64/libpython2.7.so.1.0
#53 0x00007ffff7b1238a in PyRun_FileExFlags () from /usr/lib64/libpython2.7.so.1.0
#54 0x00007ffff7b12dbb in PyRun_SimpleFileExFlags () from /usr/lib64/libpython2.7.so.1.0
#55 0x00007ffff7b284c2 in Py_Main () from /usr/lib64/libpython2.7.so.1.0
#56 0x00007ffff6d40a95 in __libc_start_main () from /lib64/libc.so.6
#57 0x0000000000400721 in _start ()

This is on a Slackware64 14.0 box running on a Geforce GTX 675m card with Cuda 5.0. I have been able to run the Cuda examples and samples without problems so far. My installation of copperhead went as follows:

  1. Install Thrust over Cuda 5.0 headers.
  2. Install Scons.
  3. Install numpy
  4. Enable GCC 4.6.3 (Slackware64 14.0 uses GCC 4.7 by default)
  5. Enable Cuda.
  6. Run python setup.py install

This all seemed to go through without too many problems once I installed the Thrust, numpy, and Scons dependencies. Running python setup.py test seems to run and no errors are reported, but the last line of output is 'running tests'.

After doing this, I note that the example given on the homepage, the sample programs (I ran black_scholes.py), and any of the tests give me the same segmentation violation. I have tried running the homepage sample, the black_scholes.py example, and the test_all.py program inside of tests/. Each of these gives the same sort of backtrace as above, but the black_scholes.py program is given above. I assume that I am correct in trying to run them by running python black_scholes.py and so on.

I am not a Python programmer, so I could be really messing something up here, but I would appreciate whatever assistance you could provide in setting this up.

arcfide avatar Mar 12 '13 21:03 arcfide

I should also note that the Boost library is installed by default in Slackware and presumably is compiled using the GCC 4.7 compiler family.

arcfide avatar Mar 12 '13 21:03 arcfide

Hello,

I cannot tell for sure what is going on in your environment, despite I already saw some similar problems. It's clear to me that you are aware of several tricks involved in the build process. So, I will point out a blog entry I've written which, I hope, eventually will provide some detail you may be missing.

http://rgomes-info.blogspot.co.uk/2013/01/python-stack-for-gpu-programming.html

I hope it helps.

Cheers

Richard Gomes http://rgomes.info

On 12/03/13 21:02, Aaron W. Hsu wrote:

I should also note that the Boost library is installed by default in Slackware and presumably is compiled using the GCC 4.7 compiler family.

— Reply to this email directly or view it on GitHub https://github.com/copperhead/copperhead/issues/10#issuecomment-14803165.

frgomes avatar Mar 12 '13 22:03 frgomes