Perplexing crash in iOS app, on observing an NSOperation

  • I added some new operation-handling in my app, and it's now crashing quite
    frequently in background threads with EXC_BAD_ACCESS and this:

    1  Foundation                    0x306cdd46
    -[NSObject(NSKeyValueObservingPrivate)
    _changeValueForKey:key:key:usingBlock:] + 438

    2  Foundation                    0x306cdb84
    -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:usingBlock:] + 24

    3  Foundation                    0x30752260
    ____NSOQDelayedFinishOperations_block_invoke_0 + 84

    4  Foundation                    0x306cdd46
    -[NSObject(NSKeyValueObservingPrivate)
    _changeValueForKey:key:key:usingBlock:] + 438

    5  Foundation                    0x306cdb84
    -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:usingBlock:] + 24

    6  Foundation                    0x307521d4 __NSOQDelayedFinishOperations
    + 128

    7  libdispatch.dylib            0x377df9a2 _dispatch_after_timer_callback
    + 6

    8  libdispatch.dylib            0x377e2252 _dispatch_source_invoke + 510

    9  libdispatch.dylib            0x377dfb1e
    _dispatch_queue_invoke$VARIANT$up + 42

    10  libdispatch.dylib            0x377e0784 _dispatch_worker_thread2 + 208

    11  libsystem_c.dylib            0x346afdf4 _pthread_wqthread + 288

    12  libsystem_c.dylib            0x346afcc8 start_wqthread + 0

    The thing is, I'm not updating the UI from this background thread, and I
    don't see any difference between the new code and essentially identical
    code that has been running crash-free for months.

    Is there some other common pitfall here (aside from updating the UI in a
    background thread) that could be responsible?

    Thanks for any ideas.

    Gavin
  • Never mind.  I was double-releasing an operation.

    Thanks anyway!
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today