Some background:
The application normally runs on an embedded platform. Currently, for development purposes, I have the rootfs located @ /exports and the target is communicating over NFS. That way I can make a change on my local system, save the application @ /exports, and run the altered version to see if it will work without having to do a full install on the target itself.
Following this guide I was able to get GDB debugging working or at least I thought I was. However, as soon as I altered my code, built my project and copied/replaced the application with the altered application I received the following errors:
Truncated/partial Eclipse Debugger Console output:
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) 0x400007b0 in ?? () from target:/lib/ld-linux.so.3
Reading /usr/lib/libasound.so.2 from remote target...
...
Reading /usr/lib/libgcc_s.so.1 from remote target...
Error while mapping shared library sections:
Remote communication error. Target disconnected.: Connection reset by peer.
warning: Could not load shared library symbols for 4 libraries, e.g. /usr/lib/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Error while reading shared library symbols for target:/usr/lib/libasound.so.2:
Can't read symbols from target:/usr/lib/libasound.so.2: Input/output error
...
Error while reading shared library symbols for target:/usr/lib/libm.so.6:
Can't read symbols from target:/usr/lib/libm.so.6: Input/output error
Output from my serial port terminal:
*** glibc detected *** gdbserver: double free or corruption (!prev):
0x000983d8 ****
As I mentioned I believe this gdbserver error may be erroneous and explaining why might be tricky so here goes. As I mentioned GDB seemed to be working. For instance, here is the GDB output I was getting:
Truncated/partial Eclipse Debugger Console output (before compiling and copying application):
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) 0x400007b0 in ?? () from target:/lib/ld-linux.so.3
Cannot access memory at address 0x7ffd8614
...
Cannot access memory at address 0x7ffd8610
Temporary breakpoint 1, main (argc=0, argv=0x0) at main.cpp:413
413 TimeStuff::CStopWatch dtorDuration;
Cannot access memory at address 0x7ffd8614
...
Cannot access memory at address 0x7ffd8610
So, like expected, the application runs and pauses at main. I can then resume the application and debug whatever I need. In fact, I used it to debug a problem then made a change and tested it. It worked, great! However, as soon as I went to debug the application for a different problem I received the errors you read earlier. So why do I think the gdbserver error is erroneous? Well because both applications are using the same exact version of glibc. In fact, the only differences between the two applications is the changes I made to the code and that code works, I know because I tested it.
That being said I am chooseing, XD, to ignore the error reported in the serial terminal and am concentrating on the errors reported by Eclipse, specifically this jumped out at me:
Remote communication error. Target disconnected.: Connection reset by peer.
Not sure why there would be a remote communications error, any ideas what might be happening here? Are these glibc errors actually red herrings?