Can anyone figure out what is wrong?

Every minute or so of teleop, my code crashes and spews this out in the debugger:

0xb6fd7d40 in ?? () from f:\frc/lib/ld-linux.so.3
warning: Could not load shared library symbols for 20 libraries, e.g. /usr/local/frc/lib/libFRC_NetworkCommunication.so.16.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for /usr/local/natinst/lib/libniu3v.so.
Do you need "set solib-search-path" or "set sysroot"?
[New Thread 3312]
warning: Could not load shared library symbols for /usr/local/natinst/lib/libnimdnsResponder.so.
Do you need "set solib-search-path" or "set sysroot"?
[New Thread 3323]
warning: Could not load shared library symbols for /lib/libnss_mdns4_minimal.so.2.
Do you need "set solib-search-path" or "set sysroot"?
[New Thread 3308]
[New Thread 3309]
[New Thread 3310]
[New Thread 3311]
[New Thread 3313]
[New Thread 3314]
[New Thread 3318]
[New Thread 3319]
[New Thread 3320]
[New Thread 3321]
[New Thread 3322]
[New Thread 3326]
[New Thread 3327]
[New Thread 3328]
[New Thread 3329]
[New Thread 3330]
[New Thread 3331]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3323]
0xb59e2e10 in strstr () from f:\frc/lib/libc.so.6

Does anyone know what is wrong? Thanks!

It looks like it’s having trouble accessing your libraries. Have you tried reformatting the roboRIO?

Can you check if you have a memory leak? Monitoring the free RAM display on the driver station will work. If you want more insight, you can try running FRCUserProgram using valgrind, which diagnoses common memory leaks and errors. However, I’m not sure if this has been attempted on a roboRIO before, so you might have some trouble setting it up. If you could post your code, that would be great.

I’ve attempted to compile valgrind using the frc toolchain with little success. Kudos to anyone who pulls it off :slight_smile:

Have you tried running in debug to get a more complete stack trace?

It looks like your program or some other function (perhaps on your behalf) is calling strstr() to find a substring in a larger string. Are your processing strings in your code?

If you are, I would guess that some assumption you’ve made about the string always having that value is not true, or your code is not finding the ending condition and is continuing past the end of the string searching for the value.

Are you able to get a full traceback of the stack when the failure occurs?

I would try and find out what the last thing you are doing in your code before it crashes.
Using printf() or logging to narrow the location down might help.