occasional crash when closing app document: forwardMethod?

  • Dear list,

    I have a document based app which uses ARC. I have occasional crashes when closing a document. I'm guessing it's a memory issue somewhere, but I'm looking for clues as to where to start looking, or how to sensibly debug this. The backtrace looks like this:

    * thread #1: tid = 0x2503, 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16, stop reason = EXC_BAD_ACCESS (code, address=0x0)
        frame #0: 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16
        frame #1: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #2: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #3: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #4: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #5: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #6: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #7: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #8: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #9: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
        frame #10: 0x00007fff86622243 AppKit`-[NSWindow sendEvent:] + 7994
        frame #11: 0x00007fff8661dbec AppKit`-[NSApplication sendEvent:] + 4969
        frame #12: 0x00007fff86533c7a AppKit`-[NSApplication run] + 636
        frame #13: 0x00007fff864d8656 AppKit`NSApplicationMain + 869

    Any hints and tips, gratefully received.

    Best wishes,

    Martin
  • What have you tried? First step with something like this is almost always to turn on NSZombie.

    On 29 Jul 2012, at 11:28, Martin Hewitson wrote:

    > Dear list,
    >
    > I have a document based app which uses ARC. I have occasional crashes when closing a document. I'm guessing it's a memory issue somewhere, but I'm looking for clues as to where to start looking, or how to sensibly debug this. The backtrace looks like this:
    >
    > * thread #1: tid = 0x2503, 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16, stop reason = EXC_BAD_ACCESS (code, address=0x0)
    > frame #0: 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16
    > frame #1: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #2: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #3: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #4: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #5: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #6: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #7: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #8: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #9: 0x00007fff8665a6c7 AppKit`forwardMethod + 125
    > frame #10: 0x00007fff86622243 AppKit`-[NSWindow sendEvent:] + 7994
    > frame #11: 0x00007fff8661dbec AppKit`-[NSApplication sendEvent:] + 4969
    > frame #12: 0x00007fff86533c7a AppKit`-[NSApplication run] + 636
    > frame #13: 0x00007fff864d8656 AppKit`NSApplicationMain + 869
    >
    >
    > Any hints and tips, gratefully received.
    >
    > Best wishes,
    >
    > Martin
  • On Jul 29, 2012, at 3:28 AM, Martin Hewitson <martin.hewitson...> wrote:

    > I have a document based app which uses ARC. I have occasional crashes when closing a document. I'm guessing it's a memory issue somewhere, but I'm looking for clues as to where to start looking, or how to sensibly debug this. The backtrace looks like this:
    >
    > * thread #1: tid = 0x2503, 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16, stop reason = EXC_BAD_ACCESS (code=13, address=0x0)
    > frame #0: 0x00007fff8c7682d0 libobjc.A.dylib`objc_msgSend + 16

    Any time you crash in objc_msgSend, the issue is probably a prematurely-deallocated object (or another way of putting it, a dangling reference), and you should turn on Zombies in the Diagnostics tab of the Run view of the scheme editor. That way, next time it crashes, it will probably tell you the class of the deallocated object it was trying to message.

    —Jens
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