Re: [cgkit-user] segfault help?
Brought to you by:
mbaas
|
From: Alejandro A. M. <fe...@gm...> - 2012-02-20 10:06:19
|
Hello! > Maybe the first thing to try would be to get the latest version from the > git repository and check if the above segfault also happens in that > version (there has been some slight refactoring). Just cloned the repo and compiled and the problem is still there. Doing: from cgkit.all import * gives seg fault, and you can workaround it by importing pygame. > In the beginning of this thread, the problem seemed to be that > _WorldObjectChildIterator::next() method (see the earlier mails). You > could try to check if that is also where it crashes in your case (either > by using a debugger or just adding some prints to that method). > Once the location of the segfault has been determined we can check why > it's crashing there and try to fix it. I tried to write some printf statements in that method to see which one crashed, but after writing them and compiling, the seg fault happened without printing anything. Then I tried to import the pygame library before and ran again the "from cgkit.all import *", then the the prints showed off. I've just learned some gdb basics and tried this: gdb python GNU gdb (GDB) 7.1-ubuntu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". Para las instrucciones de informe de errores, vea: <http://www.gnu.org/software/gdb/bugs/>... Leyendo símbolos desde /usr/bin/python...Leyendo símbolos desde /usr/lib/debug/usr/bin/python2.6...hecho. hecho. (gdb) run Starting program: /usr/bin/python [Depuración de hilo usando libthread_db enabled] Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from cgkit.all import * Program received signal SIGSEGV, Segmentation fault. 0x00b96c17 in __cxa_allocate_exception () from /usr/lib/libstdc++.so.6 (gdb) bt #0 0x00b96c17 in __cxa_allocate_exception () from /usr/lib/libstdc ++.so.6 #1 0x007aaa07 in support3d::mat4<double>::setLookAt(support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&) () from /usr/local/lib/python2.6/dist-packages/cgkit/_core.so #2 0x0079dc8f in lookAt (pos=..., target=..., up=...) at wrappers/py_mat4.cpp:102 #3 0x007aaf27 in lookAt_overloads::non_void_return_type::gen<boost::mpl::vector4<support3d::mat4<double>, support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&> >::func_1(support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&) () from /usr/local/lib/python2.6/dist-packages/cgkit/_core.so #4 0x007a4d0d in invoke<boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = support3d::mat4<double> (*)(const support3d::vec3d&, const support3d::vec3d&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<support3d::mat4<double>, const support3d::vec3d&, const support3d::vec3d&>]::result_converter, support3d::mat4<double> (*)(const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&), boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = support3d::mat4<double> (*)(const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector4<support3d::mat4<double>, const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&>]::c_t0, boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = support3d::mat4<double> (*)(const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector4<support3d::mat4<double>, const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&>]::c_t1, boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = support3d::mat4<double> (*)(const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector4<support3d::mat4<double>, const support3d::vec3d&, const support3d::vec3d&, const support3d::vec3d&>]::c_t2> (this=0x830f260, args=(<vec3 at remote 0x87f84dc>, <vec3 at remote 0x87f8504>, <vec3 at remote 0x87f852c>), kw=0x0) at /usr/include/boost/python/detail/invoke.hpp:75 #5 boost::python::detail::caller_arity<3u>::impl<support3d::mat4<double> (*)(support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&), boost::python::default_call_policies, boost::mpl::vector4<support3d::mat4<double>, support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&> >::operator() (this=0x830f260, args=(<vec3 at remote 0x87f84dc>, <vec3 at remote 0x87f8504>, <vec3 at remote 0x87f852c>), kw=0x0) at /usr/include/boost/python/detail/caller.hpp:223 #6 boost::python::objects::caller_py_function_impl<boost::python::detail::caller<support3d::mat4<double> (*)(support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&), boost::python::default_call_policies, boost::mpl::vector4<support3d::mat4<double>, support3d::vec3<double> const&, support3d::vec3<double> const&, support3d::vec3<double> const&> > >::operator() (this=0x830f260, args=(<vec3 at remote 0x87f84dc>, <vec3 at remote 0x87f8504>, <vec3 at remote 0x87f852c>), kw=0x0) at /usr/include/boost/python/object/py_function.hpp:38 #7 0x009e4edf in boost::python::objects::function::call(_object*, _object*) const () from /usr/lib/libboost_python-py26.so.1.40.0 ---Type <return> to continue, or q <return> to quit---q Quit (gdb) It seems the seg fault has "moved". I tried the same prinf approach in LookAt method in py_math4.cpp:99, but there are no prints. Am I in the wrong method? What can I do now? Thanks, Alejandro |