metadataItem.valueForAttribute() crashing

I am seeing a problem with iOS9 beta2. Didn't have it before.

if let metadataItem = metadataItem 
   { 
           if let value = metadataItem.valueForAttribute(NSMetadataUbiquitousItemIsUploadingKey) as? NSNumber  <- EXC_BAD_ACCESS             
           { 
                 return Bool(value) 
         }
     }

calling valueForAttribute causes EXC_BAD_ACCESS.

Turning on zombies, the same call generates this warning in the log.


-[NSMetadataQuery _allAttributes]: message sent to deallocated instance 0x1370968a0


It's as if the metadataItem was retaining a pointer and making a call to the query which generated it.

At this point in my code, the query has been deallocated.