Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to fix: *** glibc detected ***, NOTE: The error could be erroneous. (Problems when attempting to cross-debug an embedded Linux application. )
How to fix: *** glibc detected ***, NOTE: The error could be erroneous. [message #1803445] Thu, 28 February 2019 18:19 Go to next message
Robert Murch is currently offline Robert MurchFriend
Messages: 13
Registered: August 2018
Junior Member
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?
Re: How to fix: *** glibc detected ***, NOTE: The error could be erroneous. [message #1803480 is a reply to message #1803445] Fri, 01 March 2019 11:16 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
*** glibc detected *** gdbserver: double free or corruption (!prev):
0x000983d8 ****


I belive it is telling you the free space heap has been corrupted possibly with a double free.
Could have happened anywhere.
These are hard to track down.
Re: How to fix: *** glibc detected ***, NOTE: The error could be erroneous. [message #1803510 is a reply to message #1803480] Fri, 01 March 2019 21:59 Go to previous message
Robert Murch is currently offline Robert MurchFriend
Messages: 13
Registered: August 2018
Junior Member
Just to be sure this had nothing to do with my code I decided to download a fresh copy of the rootfs and check out its accompanying CodeBase. I repeated the steps above and got the same behavior despite not altering the application.

This just won't do! I would love to have Eclipse debugger working,

I tried running gdb-multiarch from a terminal instead and ended up with similar output except right at the end it says:

Segmentation fault (core dumped)


So, this doesn't seem to be an Eclipse problem. Maybe it is a gdb-multiarch problem? The actual application runs just fine.


EDIT: I take that back the output is jumping all over I tried again running gdb-multiarch with sudo and ended up with the same output as before, no mention of a seg fault.



[Updated on: Fri, 01 March 2019 22:15]

Report message to a moderator

Previous Topic:Build in container overriding docker image "Entrypoint"
Next Topic:Toolchains not showing (I think)
Goto Forum:
  


Current Time: Tue Apr 16 12:40:22 GMT 2024

Powered by FUDForum. Page generated in 0.74146 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top