• 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
Crash and dispatch queue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash and dispatch queue


  • Subject: Crash and dispatch queue
  • From: James Maxwell <email@hidden>
  • Date: Thu, 17 Nov 2011 10:49:58 -0800

I have a method that's crashing with EXC_BAD_ACCESS. I'm running a fairly lengthy, iterative process in a distpatch_async block and at the end of it saving a file. Originally, I had included the file save in the block...

dispatch_async(queue,^{
       [myObject doSomeHorrificCrunching];
       [myObject saveDataToFile];
    });


...and was getting a crash in certain situations -- it seemed to be related to the size of the file (which also indicates the length/complexity of the iterative process). So, I tried pulling the file save out of the block:

dispatch_async(queue,^{
       [myObject doSomeHorrificCrunching];
    });

[myObject saveDataToFile];

This also crashed (which is not surprising). So, just to check my theory that perhaps the data was still being modified when the file save method was run, I used dispatch_sync:

dispatch_sync(queue,^{
       [myObject doSomeHorrificCrunching];
    });

[myObject saveDataToFile];

This didn't crash, but of course I had to enjoy the glorious beach ball.

So, finally, I tried using a group (and going back to dispatch_async)...

dispatch_group_async(group, queue,^{
       [myObject doSomeHorrificCrunching];
    });

dispatch_group_notify(group, queue, ^{
    [myObject saveDataToFile];
    });

...but to my dismay, the crash came back.
I'm wondering: does this last step actually prove that my crash is _not_ being caused by trying to save while the data is being modified?
Unfortunately, I haven't been able to get any info on the state of the object when the crash happens. I have Zombies enabled, but I don't get any zombie action in the console.
Confused...

J.

------------------------------------------------------
James B. Maxwell
Composer/Researcher/PhD Candidate






_______________________________________________

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: Crash and dispatch queue
      • From: Wade Tregaskis <email@hidden>
    • Re: Crash and dispatch queue
      • From: "Zajkowski, James" <email@hidden>
    • Re: Crash and dispatch queue
      • From: Dave Zarzycki <email@hidden>
  • Prev by Date: Re: Resizable borderless windows in Lion
  • Next by Date: Re: Resizable borderless windows in Lion
  • Previous by thread: Re: Resizable borderless windows in Lion
  • Next by thread: Re: Crash and dispatch queue
  • Index(es):
    • Date
    • Thread