Re: Hi, Needs suggestions for finding and fixing stack/memory corruption when calling a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Fawad Lateef wrote:

> For now I added two more temporary arguments between 1st and 2nd
> arguments and the required arguments getting correct values thats
> why I am assuming that by adding temporary variables we moved the
> memory corruption from real arguments into temporary arguments. 
> After adding these arguments my function is behaving correctly so
> for now this is a work-around _but_ I want to figure-out its proper
> fix (as the same sort of issue we faced in our cgi based web-pages
> code some weeks earlier).
> Hence I needs suggestion that is this really a memory corruption or
> some compiler issues ? If its a compiler issue then its not a big
> problem but if its memory corruption issue then we have to _fix_ it
> asap.

Check the assembler output ("gcc -S ...").

Personally, I'd be more inclined to suspect register corruption. Are
you calling a library function which use a different ABI? E.g. if your
code is compiled for an ABI where certain registers are preserved but
calling a function using an ABI which doesn't preserver those
registers, then you'll have problems.

Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux