• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/


  • Subject: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • From: Jean Suisse <email@hidden>
  • Date: Sat, 22 Oct 2016 20:37:31 +0200

Well, I was afraid of that.
Unfortunately, below is the smallest sample of code possible… still crashes. Looks like I may have to check the directory rights before even attempting to enumerate it.
Expected result in the present case is: “the while loop doesn’t run because the directory isn’t accessible to the current user”.


let directoryURL = URL(fileURLWithPath: "/.DocumentRevisions-V100/")
let manager		 = FileManager.default

let keys = [URLResourceKey.nameKey, URLResourceKey.isDirectoryKey]

let enumerator = manager.enumerator(at: directoryURL, includingPropertiesForKeys: keys, options: [.skipsSubdirectoryDescendants])
{
	url, error -> Bool in
	return true
}

// this will
while let file = enumerator?.nextObject() as? URL
{
	// ...
}



> On 22 Oct 2016, at 20:32, Jens Alfke <email@hidden> wrote:
>
> Smells like an OS bug, or a bug in the ObjC-to-Swift bindings. Try to build a minimal test to reproduce it, i.e. narrow down which of the URLResourceKeys triggers the crash, and which specific file being returned by the enumerator. Then see what if anything is unusual about that file. Then probably file a bug report with Apple…
>
> As for working around it, perhaps the resource key causing the crash is one you don’t need and can omit? (It’s hard to imagine needing all of those attributes…)
>
> —Jens

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
      • From: Jean Suisse <email@hidden>
References: 
 >EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/ (From: Jean Suisse <email@hidden>)
 >Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/ (From: Quincey Morris <email@hidden>)
 >Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/ (From: Jean Suisse <email@hidden>)
 >Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/ (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Next by Date: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Previous by thread: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Next by thread: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Index(es):
    • Date
    • Thread