Home › Forum › SOFA › Programming with SOFA › SofaPython3 Seg Fault with CVXPY
Tagged: 64_bits, Linux_ubuntu, Plugin_other, SOFA_2006, SofaPython3
- This topic has 3 replies, 2 voices, and was last updated 4 years, 2 months ago by Hugo.
-
AuthorPosts
-
3 September 2020 at 01:41 #17072jlorenzeBlocked
Hello,
I am using SofaPython3 and in my Sofa.Core.Controller object I am using cvxpy to solve a convex optimization problem. I have verified that the optimization problem solves fine when I run cvxpy outside of Sofa in a normal Python script, but when running the same code within the Sofa.Core.Controller object I get a segmentation fault.
I was wondering if you would be able to provide me with any insights into why this might be occurring and perhaps this could be corrected. Please let me know what specific additional information would be helpful in diagnosing this issue.
Thanks!
Joe11 September 2020 at 15:39 #17117HugoKeymasterDear @jlorenze,
Thank you for posting on the forum!
Have you get by any chance any further information about the crash (location, pointer)?
Are you sure that the input given to the cvxpy solver is the exactly the same in both cases ?Best wishes,
Hugo
11 September 2020 at 19:38 #17123jlorenzeBlockedI just wanted to let you know that I also get a similar crash when trying to use ROS2, and that is perhaps a simpler example so I will provide some more info related to that rather than cvxpy.
First, I am using Ubuntu 20.04 and installed ROS2 Foxy via its binary package. As a simple example of the crash, I modified the example ControllerScene.py in the SofaPython3 examples directory to include
import rclpy rclpy.init()
in the __init__ function for the RotationController class. When I try to run this example with
$SOFA_BLD/bin/runSofa -l $SP3_BLD/lib/libSofaPython3.so <path_to_example>
I get a invalid pointer SIG 6 error that looks likePython::__init__::MyController free(): invalid pointer ########## SIG 6 - SIGABRT: usually caused by an abort() or assert() ########## -> /home/jlorenze/sofa/build/lib/libSofaHelper.so.20.06.99(sofa::helper::BackTrace::dump()+0x27) [0x7f9cf8871967] -> /home/jlorenze/sofa/build/lib/libSofaHelper.so.20.06.99(sofa::helper::BackTrace::sig(int)+0x1d6) [0x7f9cf8871d06] -> /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f9cf8331210] -> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7f9cf833118b] -> /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b) [0x7f9cf8310859] -> /lib/x86_64-linux-gnu/libc.so.6(+0x903ee) [0x7f9cf837b3ee] -> /lib/x86_64-linux-gnu/libc.so.6(+0x9847c) [0x7f9cf838347c] -> /lib/x86_64-linux-gnu/libc.so.6(+0x99cac) [0x7f9cf8384cac] -> /opt/ros/foxy/lib/libfastrtps.so.2(std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_Compiler(char const*, char const*, std::locale const&, std::regex_constants::syntax_option_type)+0x712) [0x7f9c6cb7d1a2] -> /opt/ros/foxy/lib/libfastrtps.so.2(std::enable_if<std::__detail::__is_contiguous_iter<char const*>::value, std::shared_ptr<std::__detail::_NFA<std::__cxx11::regex_traits<char> > const> >::type std::__detail::__compile_nfa<std::__cxx11::regex_traits<char>, char const*>(char const*, char const*, std::__cxx11::regex_traits<char>::locale_type const&, std::regex_constants::syntax_option_type)+0x36) [0x7f9c6cb7d2b6] -> /opt/ros/foxy/lib/libfastrtps.so.2(+0x207705) [0x7f9c6caa6705] -> /lib64/ld-linux-x86-64.so.2(+0x11b8a) [0x7f9cfa7dbb8a] -> /lib64/ld-linux-x86-64.so.2(+0x11c91) [0x7f9cfa7dbc91] -> /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0xe5) [0x7f9cf844e785] -> /lib64/ld-linux-x86-64.so.2(+0x160bf) [0x7f9cfa7e00bf] -> /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7f9cf844e728] -> /lib64/ld-linux-x86-64.so.2(+0x155fa) [0x7f9cfa7df5fa] -> /lib/x86_64-linux-gnu/libdl.so.2(+0x134c) [0x7f9cef6e034c] -> /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7f9cf844e728] -> /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x33) [0x7f9cf844e7f3] -> /lib/x86_64-linux-gnu/libdl.so.2(+0x1b59) [0x7f9cef6e0b59] -> /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x4a) [0x7f9cef6e03da] -> /opt/ros/foxy/lib/librcutils.so(rcutils_load_shared_library+0xba) [0x7f9c6d2400fa] -> /opt/ros/foxy/lib/librcpputils.so(rcpputils::SharedLibrary::SharedLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x95) [0x7f9c6d1dfd35] -> /opt/ros/foxy/lib/librmw_implementation.so(+0x3d81) [0x7f9c6d257d81] -> /opt/ros/foxy/lib/librmw_implementation.so(+0x4023) [0x7f9c6d258023] -> /opt/ros/foxy/lib/librmw_implementation.so(rmw_init_options_init+0x2c) [0x7f9c6d25840c] -> /opt/ros/foxy/lib/librcl.so(rcl_init_options_init+0x123) [0x7f9c6d27fb93] -> /opt/ros/foxy/lib/python3.8/site-packages/rclpy/_rclpy.cpython-38-x86_64-linux-gnu.so(+0x12961) [0x7f9c6d2b5961] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a1227) [0x7f9ce2596227] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyObject_MakeTpCall+0xa7) [0x7f9ce2596697] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x73083) [0x7f9ce2368083] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x8067) [0x7f9ce2370467] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb) [0x7f9ce24ba88b] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x90) [0x7f9ce2595cd0] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x72ffd) [0x7f9ce2367ffd] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x19f2) [0x7f9ce2369df2] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb) [0x7f9ce24ba88b] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x90) [0x7f9ce2595cd0] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x72ffd) [0x7f9ce2367ffd] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x8067) [0x7f9ce2370467] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb) [0x7f9ce24ba88b] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x90) [0x7f9ce2595cd0] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyObject_FastCallDict+0x75) [0x7f9ce2597ee5] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyObject_Call_Prepend+0xcd) [0x7f9ce259806d] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x23dc03) [0x7f9ce2532c03] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x242f65) [0x7f9ce2537f65] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyObject_MakeTpCall+0xa7) [0x7f9ce2596697] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x73083) [0x7f9ce2368083] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x4ea2) [0x7f9ce236d2a2] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x7e0db) [0x7f9ce23730db] -> /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(PyVectorcall_Call+0x5c) [0x7f9ce25963cc] -> /home/jlorenze/sofa-plugins/SofaPython3/build/lib/libSofaPython3.so(+0x10edf4) [0x7f9ce2951df4] -> /home/jlorenze/sofa-plugins/SofaPython3/build/lib/libSofaPython3.so(+0x124c62) [0x7f9ce2967c62] -> /home/jlorenze/sofa-plugins/SofaPython3/build/lib/libSofaPython3.so(sofapython3::SceneLoaderPY3::loadSceneWithArguments(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, boost::intrusive_ptr<sofa::simulation::Node>)+0x396) [0x7f9ce2966aae] -> /home/jlorenze/sofa-plugins/SofaPython3/build/lib/libSofaPython3.so(sofapython3::SceneLoaderPY3::doLoad(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0xb0) [0x7f9ce2966684] -> /home/jlorenze/sofa/build/lib/libSofaSimulationGraph.so.20.06.99(sofa::simulation::SceneLoader::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x1cd) [0x7f9cfa7b7bdd] -> /home/jlorenze/sofa/build/lib/libSofaSimulationCore.so.20.06.99(sofa::simulation::Simulation::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x18a) [0x7f9cf96c7f9a] -> /home/jlorenze/sofa/build/bin/runSofa(+0x163f2) [0x55d517b243f2] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f9cf83120b3] -> /home/jlorenze/sofa/build/bin/runSofa(+0x178ee) [0x55d517b258ee] Aborted (core dumped)
30 September 2020 at 22:49 #17240HugoKeymasterThanks a lot for the input @jlorenze,
@damien-marchaluniv-lille1-fr could you help us on this one?Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.