DiskArbitration crash after DADiskMountApprovalCallback exits
DiskArbitration crash after DADiskMountApprovalCallback exits
- Subject: DiskArbitration crash after DADiskMountApprovalCallback exits
- From: Jeff Johnson <email@hidden>
- Date: Fri, 1 Dec 2006 22:26:18 -0600
I'm having trouble with my app crashing after my
DADiskMountApprovalCallback gets called. In this case, the callback
is the result of my app erasing a disk volume. The callback function
successfully exits, so the crash is not happening in my app's code.
Here's the backtrace:
#0 0x90a55387 in objc_msgSend ()
#1 0x0d2358f0 in ?? ()
#2 0x9082205c in __CFDictionaryDeallocate ()
#3 0x9080b1a9 in _CFRelease ()
#4 0x913fc6f2 in _DADiskSetDescription ()
#5 0x913fc0cc in _DADispatchCallback ()
#6 0x913fbc3f in _DASessionCallback ()
#7 0x9083a3c5 in __CFMachPortPerform ()
#8 0x9082a66d in CFRunLoopRunSpecific ()
#9 0x90829b0e in CFRunLoopRunInMode ()
#10 0x92dc9bef in RunCurrentEventLoopInMode ()
#11 0x92dc92fd in ReceiveNextEventCommon ()
#12 0x92dc9154 in BlockUntilNextEventMatchingListInMode ()
#13 0x9326e465 in _DPSNextEvent ()
#14 0x9326e056 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#15 0x93267ddb in -[NSApplication run] ()
#16 0x9325bd2f in NSApplicationMain ()
#17 0x00002cde in main (argc=1, argv=0xbffff9dc)
The essence of my DADiskMountApprovalCallback is the following:
CFDictionaryRef description = DADiskCopyDescription(disk);
if (description) {
// Check kDADiskDescriptionVolumeNameKey and
kDADiskDescriptionVolumeUUIDKey for relevant values.
CFRelease(description);
I suspect that ultimately the problem is connected to the fact that
DADiskCopyDescription() does not necessarily create a new copy of the
description but does a CFRetain(), as one can see in the file
DADisc.c in the source code for DiskArbitration. I also wonder
whether there is an issue with timeouts on the callbacks, because if
I streamline the function by removing all code except the
DADiskCopyDescription() and CFRelease(), the crash doesn't occur.
With the non-streamlined function, I'm seeing log messages from
disarbitrationd that my app is not responding.
It doesn't appear that my code is over-releasing the description,
because I checked that the retain count for the disk description is 2
immediately after DADiskCopyDescription(disk) and immediately before
CFRelease(description). The retain count is 1 immediately before my
function returns. If I comment out the CFRelease line, however, the
crash does not occur, and for some reason the same volume triggers my
callback three times. (Each time I return a DADissenterRef with the
status kDAReturnNotPermitted.)
I would be very grateful for any help on this matter. Thanks!
-Jeff Johnson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden