right list for SIGABRT python binary question ?
Karsten Hilbert
Karsten.Hilbert at gmx.net
Wed Nov 1 05:27:54 EDT 2017
On Wed, Nov 01, 2017 at 09:21:46AM +0100, dieter 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 ?
(the "place" is the memory block you refer to)
Other than that I understand what you are getting at and am
willing to try.
Thanks,
Karsten
> Should your program get stopped too often (because the memory
> block is reused too often), you must find a good point in your
> program to activate the memory access breakpoint in a delayed way.
> You could use the Python debugger for this: execute significant
> parts of your program in the Python debugger; switching to
> GDB, check whether the address is already corrupted - if
> so, restart and refine the checks above in the portion of your program
> which caused the corruption. If the part in your program
> is sufficiently small, you can activate the memory access breakpoint.
> This approach may also be feasible, should you use a CPU
> without memory access breakpoints.
--
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