mars-robot-simulation / mars_core

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Occasional segmentation faults on startup in Subworld::run using libyaml-cpp #5

Open jliersch opened 2 months ago

jliersch commented 2 months ago

Situation

Occasionally mars_app has a segmentation fault on startup. It seems like may happen due to the setup of a sub world based on a yaml file, as this log message and backtrace suggests:

absoluteEntityFilePath: artemis/artemis_sim/./blue_box.yml
robotname: step_l5
pos:    1.1
   0.5
-0.005
rot: 1 0
0
0
[New Thread 0x7fffcf7ee700 (LWP 81814)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 24 "mars_app" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd07f0700 (LWP 81812)]
0x00007ffff2486185 in ?? () from /lib/x86_64-linux-gnu/libyaml-cpp.so.0.6
(gdb) bt
#0  0x00007ffff2486185 in  () at /lib/x86_64-linux-gnu/libyaml-cpp.so.0.6
#1  0x00007ffff24861de in  () at /lib/x86_64-linux-gnu/libyaml-cpp.so.0.6
#2  0x00007fffe3c8b316 in mars::core::SubWorld::run() () at /home/dfki.uni-bremen.de/jliersch/NoStrandAMust/nostrandamust-dev-mars2/install/lib/libmars_core.so
#3  0x00007ffff250c0a4 in mars::utils::Thread::runHelper(void*) () at /home/dfki.uni-bremen.de/jliersch/NoStrandAMust/nostrandamust-dev-mars2/install/lib/libmars_utils.so
#4  0x00007ffff6b28609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#5  0x00007ffff6e01353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Task

Find and resolve the cause of the segmenation fault.

jliersch commented 2 months ago

Hint for reproduction: As the error occurs indeterministically, setting up a scene file with many entities defined through yml files may be helpful in provoking the segfault.

malter commented 2 months ago

SubWorld::run() shouldn't have a connection to libyaml-cpp, so it looks like it's a memory issue somewhere else generating a "random" misbehavior. Probably a uninitialized pointer.