[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -[NSData initWithContentsOfMappedFile:] crash if MMAP is present
From: |
Richard Frith-Macdonald |
Subject: |
Re: -[NSData initWithContentsOfMappedFile:] crash if MMAP is present |
Date: |
Thu, 6 Mar 2003 13:26:59 +0000 |
On Thursday, March 6, 2003, at 01:03 pm, Roland Schwingel wrote:
Hi...
I discovered a crash in NSData...
Thanks ... I fixed it in the 1.6.0 branch of CVS
Imagine MMAP is defined. I wonder how this could ever have
worked. It crashes for me (of course) self is released before the
zone is taken from it.
It would work because, GSObjCZone() would get the zone from an offset
against the address of self, and generally while deallocating self will
have returned the memory to the memory allocation system, it will not
have been overwritten and will therefore still contain the correct
pointer to the zone.
In general, method calls on a deallocated object will crash because the
deallocation process overwrites the 'isa' pointer in the object, which
is used to locate the method implementation to be used. Direct
accesses into the rest of the memory of a (very) recently deallocated
object will often/usually work.