[issue35750] process finished with exit code -1073740940 (0xc0000374)

Eryk Sun report at bugs.python.org
Wed Jan 16 06:40:01 EST 2019


Eryk Sun <eryksun at gmail.com> 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 <report at bugs.python.org>
<https://bugs.python.org/issue35750>
_______________________________________


More information about the Python-bugs-list mailing list