I really don't know how to locate the line that causes the the segmentation fault (core dumped). I have tried to used valgrind to find it. And I get the results as follows:
Code: Select all
chris@chris-virtual-machine:~/argos_ws/swarm_physarum$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./libfootbot_physarum_2.so
==7418== Memcheck, a memory error detector
==7418== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7418== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7418== Command: ./libfootbot_physarum_2.so
==7418==
==7418==
==7418== Process terminating with default action of signal 11 (SIGSEGV)
==7418== Access not within mapped region at address 0x0
==7418== at 0x1: ???
==7418== by 0x1FFF000006: ???
==7418== If you believe this happened as a result of a stack
==7418== overflow in your program's main thread (unlikely but
==7418== possible), you can try to increase the size of the
==7418== main thread stack using the --main-stacksize= flag.
==7418== The main thread stack size used in this run was 8388608.
==7418==
==7418== HEAP SUMMARY:
==7418== in use at exit: 0 bytes in 0 blocks
==7418== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==7418==
==7418== All heap blocks were freed -- no leaks are possible
==7418==
==7418== For counts of detected and suppressed errors, rerun with: -v
==7418== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)