carla icon indicating copy to clipboard operation
carla copied to clipboard

Python script's Segmentation fault (core dumped)

Open DianweiCHEN opened this issue 3 years ago • 5 comments

CARLA version:0.9.10.1 Platform/OS:Linux Problem you have experienced: After run the Python script, it didn't work Hi, I used the ubuntu 20.1 and the Carla 0.9.10.1 and because the former problem which is "No module named 'carla' " So I set in the ./bashrc with export CARLA_ROOT=/home/andy/Desktop/CARLA_0.9.10.1 export CARLA_SERVER=/home/andy/Desktop/CARLA_0.9.10.1/CarlaUE4.sh export PYTHONPATH="$PYTHONPATH:/home/andy/Desktop/CARLA_0.9.10.1/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x86_64.egg"

And after that when I want to run the manual_control.py, it just shows the 'Segmentation fault (core dumped)' in the next line and the carla server is fine. Does anyone know what happend, and thanks!

DianweiCHEN avatar Dec 19 '21 02:12 DianweiCHEN

I encounter the same segmentation fault, mine is when running the line world.get_random_location_from_navigation(). Also, I am using py3.9 and this issue disappear when I switch to py2.7, can anyone help?

The error is:

Thread 1 "python" received signal SIGSEGV, Segmentation fault. _PyObject_GC_Alloc (use_calloc=0, basicsize=88) at /tmp/build/80754af9/python-split_1631797238431/work/Modules/gcmodule.c:2226 2226 /tmp/build/80754af9/python-split_1631797238431/work/Modules/gcmodule.c: No such directory or file.

EnhanceRepo avatar Jan 14 '22 09:01 EnhanceRepo

same here I got segmentation fault with that error

#0 carla::traffic_manager::SimpleWaypoint::GetLocation (this=0x16a6030) at ../../LibCarla/source/carla/trafficmanager/SimpleWaypoint.cpp:48 #1 0x00007ffff583b441 in carla::traffic_manager::InMemoryMap::SetUpSpatialTree (this=) at ../../LibCarla/source/carla/trafficmanager/InMemoryMap.cpp:363 #2 0x00007ffff583ae55 in carla::traffic_manager::InMemoryMap::Load ( this=0x15fc7f0, content=<error reading variable: Cannot access memory at address 0x8>) at ../../LibCarla/source/carla/trafficmanager/InMemoryMap.cpp:161 #3 0x00007ffff585afee in carla::traffic_manager::TrafficManagerLocal::SetupLocalMap (this=0xff4b10) at ../../LibCarla/source/carla/trafficmanager/TrafficManagerLocal.cpp:125 #4 0x00007ffff585a733 in carla::traffic_manager::TrafficManagerLocal::TrafficManagerLocal (this=0xff4b10, longitudinal_PID_parameters=..., longitudinal_highway_PID_parameters=..., lateral_PID_parameters=..., lateral_highway_PID_parameters=..., perc_difference_from_limit=, episode_proxy=..., RPCportTM=) at ../../LibCarla/source/carla/trafficmanager/TrafficManagerLocal.cpp:107 #5 0x00007ffff5858ed7 in carla::traffic_manager::TrafficManager::CreateTrafficManagerServer (this=, episode_proxy=..., port=) at ../../LibCarla/source/carla/trafficmanager/TrafficManager.cpp:148 #6 0x00007ffff5858702 in carla::traffic_manager::TrafficManager::TrafficManager--Type <RET> for more, q to quit, c to continue without paging--c (this=, episode_proxy=..., port=) at ../../LibCarla/source/carla/trafficmanager/TrafficManager.cpp:40 #7 0x00007ffff55fa377 in carla::client::Client::GetInstanceTM (this=, port=41856) at dependencies/include/carla/client/Client.h:95 #8 0x00007ffff55dd5c6 in export_client()::$_43::operator()(carla::client::Client const&, unsigned short) const (this=, self=..., t1=41856) at source/libcarla/Client.cpp:210 #9 export_client()::$_43::_invoke(carla::client::Client const&, unsigned short) (self=..., t1=41856) at source/libcarla/Client.cpp:210 #10 0x00007ffff565204c in boost::python::detail::invoke<boost::python::to_python_value<carla::traffic_manager::TrafficManager const&>, carla::traffic_manager::TrafficManager ()(carla::client::Client const&, unsigned short), boost::python::arg_from_python<carla::client::Client const&>, boost::python::arg_from_python > (rc=..., f=, ac0=..., ac1=...) at dependencies/include/system/boost/python/detail/invoke.hpp:73 #11 boost::python::detail::caller_arity<2u>::impl<carla::traffic_manager::TrafficManager ()(carla::client::Client const&, unsigned short), boost::python::default_call_policies, boost::mpl::vector3<carla::traffic_manager::TrafficManager, carla::client::Client const&, unsigned short> >::operator() (this=, args=0x7fffca51e140) at dependencies/include/system/boost/python/detail/caller.hpp:233 #12 0x00007ffff61e7ea7 in boost::python::objects::function::call(_object*, _object*) const () from /home/oem/.cache/Python-Eggs/carla-0.9.13-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so #13 0x00007ffff61e9895 in boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) () from /home/oem/.cache/Python-Eggs/carla-0.9.13-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so #14 0x00007ffff61ef522 in boost::python::detail::exception_handler::operator()(boost::function0 const&) const () from /home/oem/.cache/Python-Eggs/carla-0.9.13-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so #15 0x00007ffff5680cb3 in boost::python::detail::translate_exception<rpc::rpc_error, void ()(rpc::rpc_error const&)>::operator() (this=, handler=..., f=..., translate=0x7ffff55b63b0 <translator(rpc::rpc_error const&)>) at dependencies/include/system/boost/python/detail/translate_exception.hpp:46 #16 boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(rpc::rpc_error const&)> >::operator()<bool, boost::python::detail::translate_exception<rpc::rpc_error, void ()(rpc::rpc_error const&)>, boost::_bi::rrlist2<boost::python::detail::exception_handler const&, boost::function0 const&> > (this=, f=..., a=...) at dependencies/include/system/boost/bind/bind.hpp:388 #17 boost::_bi::bind_t<bool, boost::python::detail::translate_exception<rpc::rpc_error, void ()(rpc::rpc_error const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(rpc::rpc_error const&)> > >::operator()<boost::python::detail::exception_handler const&, boost::function0 const&> (this=, a1=..., a2=...) at dependencies/include/system/boost/bind/bind.hpp:1318 #18 boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<rpc::rpc_error, void ()(rpc::rpc_error const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void ()(rpc::rpc_error const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0 const&>::invoke (function_obj_ptr=..., a0=..., a1=...) at dependencies/include/system/boost/function/function_template.hpp:137 #19 0x00007ffff61ef2c9 in boost::python::handle_exception_impl(boost::function0) () from /home/oem/.cache/Python-Eggs/carla-0.9.13-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so #20 0x00007ffff61e9516 in boost::python::objects::function_call(_object, _object*, _object*) () from /home/oem/.cache/Python-Eggs/carla-0.9.13-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so #21 0x00000000005f6a46 in _PyObject_MakeTpCall () #22 0x000000000050b4a7 in ?? () #23 0x00000000005703e6 in _PyEval_EvalFrameDefault () #24 0x00000000005f6226 in _PyFunction_Vectorcall () #25 0x000000000056b3fe in _PyEval_EvalFrameDefault () #26 0x00000000005696da in _PyEval_EvalCodeWithName () #27 0x000000000068db17 in PyEval_EvalCode () #28 0x000000000067eeb1 in ?? () #29 0x000000000067ef2f in ?? () #30 0x000000000067efd1 in ?? () #31 0x000000000067f377 in PyRun_SimpleFileExFlags () #32 0x00000000006b7902 in Py_RunMain () #33 0x00000000006b7c8d in Py_BytesMain () #34 0x00007ffff7de40b3 in __libc_start_main (main=0x4eed30

, argc=2, argv=0x7fffffffdf28, init=, fini=, rtld_fini=, stack_end=0x7fffffffdf18) at ../csu/libc-start.c:308 #35 0x00000000005fb12e in _start ()

RehabHsn avatar Feb 03 '22 20:02 RehabHsn

@LucianYuan Hi, I found my problem is caused by Pygame. But after I re-install the Pygame, this problem is still not fixed. I am stuck currently. Have you fixed your problem yet? Thx

DianweiCHEN avatar Feb 08 '22 16:02 DianweiCHEN

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 12:04 stale[bot]

If you are using an imported custom map, you can copy the map folder from /Content to /Content/Carla/Maps. This solves the problem for me.

StephanieMussi avatar Sep 09 '22 02:09 StephanieMussi

If you are using an imported custom map, you can copy the map folder from /Content to /Content/Carla/Maps. This solves the problem for me.

Worked for me. Just to add I am using a custom map on which I ran generate_traffic.py script and was getting Segmentation fault

Here's what I did.

The files/subfiles of the following folder CarlaUE4/Content/<custom_map_folder> should be copied to their respective folders here

CarlaUE4/Content/Carla

For example

  • CarlaUE4/Content/<custom_map_name>/Config/<custom_map_name>.Package.json Goes here ---> CarlaUE4/Content/Carla/Config

Similarly,

  • CarlaUE4/Content/<custom_map_name>/Maps/<custom_map_name>/Nav/<custom_map_name>.bin Goes here----> CarlaUE4/Content/Carla/Maps/Nav

Make sure you do this for all the relevant map files.

MahirGulzar avatar Nov 25 '22 03:11 MahirGulzar

@LucianYuan I switched to python3.8 and the problem was resolved

schmittlema avatar Feb 27 '23 18:02 schmittlema

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 01 '23 18:06 stale[bot]