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

Glynn Clements <[email protected]> Wed, 25 May 2011 12:07:14 +0100
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
Fawad Lateef wrote:

> > 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.
> 
> humm, Can you give some suggestion about how to verify this ? Using
> readelf or objdump on different libraries and executables can give
> some clue ? As we are using some pre-compiled  libraries provided by
> some stack we are using.

The files themselves may not contain sufficient information. E.g. if
someone builds a library using e.g. -mregparm=3, that isn't going to
show up in the objdump (etc) output. First, check the documentation
for the libraries; if that doesn't help, try disassembling them.

-- 
Glynn Clements <[email protected]>