Forum Replies Created
-
AuthorPosts
-
jlorenzeBlocked
Thanks!
jlorenzeBlockedI 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)
jlorenzeBlockedThis thread’s issue is no longer an issue now that I have upgraded, but the other issues are still present (but this discussion can be continued on that thread).
Thanks!
jlorenzeBlockedJust as a follow up, the reason I am trying to use Python 3.6 is that it is the version compatible with ROS2 Eloquent (running on Ubuntu 18.04). However I actually decided it would be better to just upgrade to Ubuntu 20.04 and use ROS2 Foxy (which will use Python 3.8). So I suppose this thread can be closed out since I no longer need an answer. Thanks for your support with it!
I tried running a simple example with an existing scene that I know works and just include the initialization of a ROS node (i.e. import rclpy and rclpy.init()) in the createScene to check if it was working and I get a SIG 6 SIGABRT error. This seems to be very similar to a crash I also see when trying to use cvxpy in a Sofa.Core.Controller (and for which I have also recently posted to the forum about in post #17072).
Would you advise I create a new post to discuss this issue separately from #17072 or should I just add to that post?
jlorenzeBlockedSo that allowed me to successfully run cmake, but now when I try to actually run “make” in the build directory I get the following errors
jlorenze@jlorenze:~/sofa-plugins/SofaPython3/build$ make -j4 [ 3%] Built target Bindings.Sofa.Simulation [ 4%] Building CXX object Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/PythonEnvironment.cpp.o [ 6%] Building CXX object Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/DataHelper.cpp.o [ 7%] Building CXX object Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/PythonFactory.cpp.o [ 9%] Building CXX object Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/Prefab.cpp.o /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp: In member function ‘void sofapython3::PythonEnvironmentData::add(const string&)’: /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp:108:27: error: ‘Py_DecodeLocale’ was not declared in this scope m_argv.push_back( Py_DecodeLocale(data.c_str(), nullptr) ); ^~~~~~~~~~~~~~~ /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp:108:27: note: suggested alternative: ‘PyEval_GetLocals’ m_argv.push_back( Py_DecodeLocale(data.c_str(), nullptr) ); ^~~~~~~~~~~~~~~ PyEval_GetLocals /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp: In static member function ‘static void sofapython3::PythonEnvironment::setArguments(const string&, const std::vector<std::__cxx11::basic_string<char> >&)’: /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp:506:60: error: cannot convert ‘wchar_t**’ to ‘char**’ for argument ‘2’ to ‘void PySys_SetArgvEx(int, char**, int)’ PySys_SetArgvEx( data->size(), data->getDataBuffer(), 0); ^ /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp: In function ‘PyGILState_STATE sofapython3::lock(const char*)’: /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp:534:52: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘id’ auto id = PyGILState_GetThisThreadState()->id; ^~ /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp: In destructor ‘sofapython3::PythonEnvironment::gil::~gil()’: /home/jlorenze/sofa-plugins/SofaPython3/Plugin/src/SofaPython3/PythonEnvironment.cpp:552:48: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘id’ auto id = PyGILState_GetThisThreadState()->id; ^~ Plugin/CMakeFiles/Plugin.dir/build.make:78: recipe for target 'Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/PythonEnvironment.cpp.o' failed make[2]: *** [Plugin/CMakeFiles/Plugin.dir/src/SofaPython3/PythonEnvironment.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:442: recipe for target 'Plugin/CMakeFiles/Plugin.dir/all' failed make[1]: *** [Plugin/CMakeFiles/Plugin.dir/all] Error 2 Makefile:132: recipe for target 'all' failed make: *** [all] Error 2
jlorenzeBlockedjlorenzeBlockedDo you have any documentation that discusses how to change specify the Python version when you build SofaPython3?
jlorenzeBlockedThank you for the help, using SOFTROBOTS_IGNORE_ERRORS seems to have done the trick!
jlorenzeBlockedOkay great thank you for the information! I’ll stay tuned for more info from the Defrost team.
jlorenzeBlockedHey @jnbrunet thanks for the quick response!
Sorry for the confusion! I don’t care about running SofaPython(2) alongside SofaPython3. All I want to do is run SofaPython3 with SoftRobots. The trouble is that I don’t know how to get this set up since STLIB requires SofaPython to build? Is there a way to install STLIB and SoftRobots without enabling SofaPython(2)?
-
AuthorPosts