Results 1 to 5 of 5
Hi,
I have written an application for PXA270 ARM platform in Linux C. Its a multithreaded application.
At some point in execution it throws an error:
"*** glibc detected *** ...
- 05-05-2010 #1Just Joined!
- Join Date
- Nov 2006
- Location
- Harrisburg, PA, USA
- Posts
- 56
Memory Corruption (glibc errors) problems in Linux C
Hi,
I have written an application for PXA270 ARM platform in Linux C. Its a multithreaded application.
At some point in execution it throws an error:
"*** glibc detected *** double free or corruption (out): 0x00120408 ***"
or
"*** glibc detected *** double free or corruption (!prev): 0x0011ab38 ***"
I think these errors are related to memory leaks or corruption. I wanted to debug these errors using valgrind. But valgrind is not portable to ARM platform. I cannot run my application on x86 linux pc to find out the leaks using valgrind.
How should I resolve these errors? Is there any tool available on ARM platform?
I can see memory address printed in glibc error. How should I use it to debug?
Regards,
Sumit
- 05-06-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,943
Well, the problem is obvious. Finding where it is occuring is not so simple. Myself, I use gdb to find these errors. Assuming you can run a shell UI on the ARM platform (either via rs-232 port, or ethernet telnet/ssh), then you can run the application in gdb and find out exactly where the problem manifests. You will need to build the executable (and possibly any non-system libraries) with the -g option and avoid stripping them in order to debug them, but this has always worked well for me. In fact, I've been doing some ARM9 development work lately and had to do that in order to find some gnarly little bugs as well.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 05-11-2010 #3Just Joined!
- Join Date
- Nov 2006
- Location
- Harrisburg, PA, USA
- Posts
- 56
Re:
Thanks for the reply.
Yes, I built my executable with -g option. I have access to ARM platform through RS232 and ethernet port. But gdb is not ported to ARM.
Is there a way to debug it throgh x86?
Regards,
Sumit
- 05-11-2010 #4
- 05-12-2010 #5Just Joined!
- Join Date
- Nov 2006
- Location
- Harrisburg, PA, USA
- Posts
- 56
I am running linux kernel 2.6.19 on target platform.
Gcc: arm-xscale-linux-gnu-gcc
I see a memory address in glibc error message. I need to figure out if I can find out the function at this address which is causing a problem of memory corruption.
At this time, I am completely lost. I don't have an idea where to start debugging and what tools to use. I was thinking of using any tool on x86 that will allow me to debug memory leaks on application running on ARM platform.
Regards,
Sumit


Reply With Quote

