Re: Object Allocations
Re: Object Allocations
- Subject: Re: Object Allocations
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 20 Sep 2001 19:08:10 -0300
>
Date: Mon, 17 Sep 2001 20:03:59 -0700
>
From: Rosyna <email@hidden>
>
Subject: Re: Object Allocations
>
>
This is the EXACT same situation I have, the same error messages and
>
everything (NSCalibratedRGBColor and NSCFString)
>
>
Ack, at 9/17/01, Rainer Brockerhoff said:
>
>
>As I said, it's intermittent. This may not be pertinent to the
>
>problem, but the error message (NSAutoReleaseNoPool IIRC) always
>
>refers to a NSCFString and an NSCalibratedRGBColor, it happens only
>
>for the first opened document, and most - perhaps all - instances I
>
>remember seeing happened when the document was opened from within a
>
>drag&drop receiver.
Well, I succeeded in getting a stack trace of one of those #$%^& ocurrences. It was NOT after a drag, though.
#0 0x708c4a5c in _NSAutoreleaseNoPool ()
#1 0x708111d0 in NSAutoreleaseObject ()
#2 0x7081cb04 in -[NSObject autorelease] ()
#3 0x70849b18 in +[NSString stringWithFormat:] ()
#4 0x70bd01c0 in -[NSTextView(NSSharing) updateInsertionPointStateAndRestartTimer:] ()
#5 0x70bc4368 in +[NSColorList _findColorListNamed:forDeviceType:] ()
#6 0x70c70ed8 in -[NSCatalogColor colorUsingColorSpaceName:device:] ()
#7 0x70c8d834 in -[NSColor colorUsingColorSpaceName:] ()
#8 0x70cdf91c in -[NSColor hash] ()
#9 0x70c3f3cc in -[NSCoreDragManager unregisterDragTypesForWindow:] ()
#10 0x701cfcc4 in __CFRangeMake ()
#11 0x7018fcf0 in CFSetRemoveValue ()
#12 0x70bf1730 in -[NSAttributeDictionary release] ()
#13 0x70811b2c in -[NSRLEArray dealloc] ()
#14 0x70811be4 in -[NSObject release] ()
#15 0x7081bfcc in -[NSConcreteMutableAttributedString dealloc] ()
#16 0x70811be4 in -[NSObject release] ()
#17 0x70e33840 in -[NSStringDrawingTextStorage dealloc] ()
#18 0x70811be4 in -[NSObject release] ()
#19 0x70dcd810 in _NXstringxyshow ()
#20 0x7002654c in _pthread_tsd_cleanup ()
#21 0x700263cc in pthread_exit ()
#22 0x7084c250 in -[NSThread _exit] ()
#23 0x7084a724 in forkThreadForFunction ()
#24 0x7002033c in _pthread_body ()
If I'm interpreting this correctly, this is happening during thread cleanup (frame#20) - meaning the thread's NSAutoreleasePool has already been released.
The NSThread's NSAttributeDictionary is being released (frame#12), so all the dictionary's items are being released one by one. One is an attributed string with a color (??).
Somewhere in there my window's drag types are unregistered (frame#9). One of those is an NSColor and for some reason this searches a cache of NSColors by name (frame#5).
This calls +[NSString stringWithFormat:] which creates an autoreleased NSString. Since there is no pool in place, we get the error message.
I suppose this is a bug somewhere in the frameworks, and not in our code...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)