right list for SIGABRT python binary question ?

Karsten Hilbert Karsten.Hilbert at gmx.net
Wed Nov 1 06:14:08 EDT 2017


On Wed, Nov 01, 2017 at 10:27:54AM +0100, Karsten Hilbert wrote:

> > >> It points to a memory corruption.
> > 
> > The i386/x64 architecture supports memory access breakpoints
> > and GDB, too, has support for this. You know the address which
> > gets corrupted. Thus, the following apporach could have a chance
> > to succeed:
> > 
> >    Put a "memory write" breakpoint on the address which gets corrupted.
> >    this should stop the program each time this address is written;
> >    Check then the backtrace. As the address forms part of the
> >    address block prologue, it should only be accessed from
> >    Python's "malloc" (and "free") implementation. Any other access
> >    indicates bad behaviour.
> 
> I understand. Thank you for the explanation. This may seem
> like a dumb question: the actual address that gets corrupted
> varies from run to run (it may be the same "place" in the
> code but that place gets put at a different address each
> run). Since I don't know the address of a given run, how do I
> set a break point on that address ?  It seems to me I first
> need to map the "place" to its address before the SIGABRT
> happens. How do I find out out which "place" needs to be
> mapped from the output I already have ?

Or rather: I need to find out which "place" a given address
refers to, check whether the changing addresses always belong
to the same "place" between runs and _then_ map a "place" to
its address and breakpoint that address on yet another run.

It might seem

	gdb> info symbol <the address>

should give me the "place".

Then

	gdb> info address <the symbol>

on another run. Or even just "watch <the symbol". I'll try.

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



More information about the Python-list mailing list