Eryk Sun <[email protected]> added the comment:
A crash with the code STATUS_HEAP_CORRUPTION (0xC0000374) is due to a bug, not
memory exhaustion. The bug may not be the fault of the interpreter or standard
library if you're working with extension modules or ctypes. It's easy to
corrupt the internal structures of a heap. For example:
>>> import ctypes
>>> b = (ctypes.c_char * 100000)()
>>> ctypes.POINTER(ctypes.c_int)(b)[-1] = 0
>>> del b
[crashed]
C:\>echo %errorlevel%
-1073740940
Heap corruption is best examined with a debugger (e.g. windbg or cdb) attached
to the faulting process, with full page heap checking enabled for the
executable in the registry (usually set via gflags). This reserves a page
before and after each heap allocation to ensure that writes that would
otherwise corrupt the heap will instead immediately raise an access violation.
----------
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35750>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com