develooper Front page | perl.perl5.porters | Postings from June 2003

Re: your malloc patches

Thread Previous | Thread Next
Jarkko Hietaniemi
June 20, 2003 03:20
Re: your malloc patches
Message ID:
> Well, you said you tested it on other 64bit stuff; and you said that

That was a false result: the IRIX explicitly always disables mymalloc.

> If it is really bugs in malloc.c, then it is the pair of
> fill()/check() which is failing.  The test above would give some info
> *which* one of these two steps fails.  The target is to have memory
> 0xDEADBEEF-filled (4-byte-aligned).  And if any malloc() was done with
> this memory, it should have 4 0x55 bytes before the region, and >=4
> 0x55 bytes after the region (up to 4-byte aligned boundary; actually,
> on 64-bit machines it may have been 0x55 0x55 0x55 0x55 0x00 0x00 0x00
> 0x00 or 0x00 0x00 0x00 0x00 0x55 0x55 0x55 0x55 instead of 4 0x55
> bytes).

It seems that the cmp_pat_4bytes() is being called with

s = 0x140012040 = "^D\377\r", nbytes = 18446744073709551604, ...

which sounds highly like garbage.  Well, the nbytes looks highly
like an unintentional negative number being wrapped into a positive
one by the virtue of the size_t in the prototype.  In the caller
nbytes is 16.  Digging more...

Jarkko Hietaniemi <> "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About