Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I have removed the incorrect code in master and 3.6, this unblocks testing 
debug build on OpenBSD. I don't think it is worth to backport this change to 
3.5 and 3.4, since the bug affects only debug build.

Here is a patch which perhaps is an alternative to PR 4119, but without 
disturbing the heap allocator. It erases just few bytes at the begin and at the 
end of the allocated block (including the header and the trailer), and saves 
erased bytes in small local buffer. It does this even if the block is not 
reallocated in-place. Hence calling free() on reallocated block will be 
detected. Reading from the reallocated block will get erased bytes at the start 
and the end, this is likely will cause to loud failure too. I have tested in on 
OpenBSD.

But I'm not sure that it is worth to apply this patch. Left it on to you Victor.

----------
versions:  -Python 3.4, Python 3.5
Added file: https://bugs.python.org/file47249/debug-realloc.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31626>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to