Find the answer to your Linux question:
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 *** ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56

    Unhappy 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

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,695
    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!

  3. #3
    Just 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

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,695
    Quote Originally Posted by sumitv View Post
    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
    What distribution+version+kernel+gcc version are you running? I am running Debian Etch w/ 2.6.21 kernel on an ARM9 and it has gdb - I use it all the time.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •