[Python-Dev] Fun with numbers

Tim Peters tim.one@comcast.net
Sun, 28 Apr 2002 00:07:10 -0400


[Barry]
> >>> 23000 .__class__ = bool
> Debug memory block at address p=0x814f544:
>     485823496 bytes originally requested
>     the 4 pad bytes at p-4 are not all FORBIDDENBYTE (0xfb):
>         at p-4: 0x7a *** OUCH
>         at p-3: 0x61 *** OUCH
>         at p-2: 0xc8 *** OUCH
>         at p-1: 0x3c *** OUCH
>     the 4 pad bytes at tail=0x250a094c are Segmentation fault

Darn.  Of the 3 memory corruption problems the debug pymalloc has caught so
far, 2 were detected as *under*writes (scribbling before the requested
space, as opposed to overwrites scribbling after it).  More, they're
terrible underwrites, so bad that they corrupt not only the 4 pad bytes
before the start, but also the 4 "number of bytes originally requested"
bytes before those.  That leads to an insane "bytes originally requested"
message, and also to a segfault as the checking routine adds that field to
the start address and tries to look at the trailing pad bytes.

All of this surprises me.  I *expected* most corruption to be via
overwrites, and I asked everyone before to limit their corruption to no more
than 4 bytes <wink>.