Debugger exits with signal 5 (SIGTRAP) after computer crashed.

  • Dear Cocoa Developers,

    I just started programming Objective-C and Cocoa. As a first Project,
    I'm creating an application, that generates thumbnails of files
    dragged to a custom view. Until now, everything worked fine. Then
    while playing around with my app, the computer stopped responding and
    I had to turn the Mac of by pressing the power button for a few seconds.
    After the restart, I tried to recompile and start the Application via
    XCode. The Build itself succeeds every time, but as XCode tries to
    open the App (Build and run), I get this error message in the log
    window:
    -------------------------------------------
    [Session started at ... ]

    The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has
    exited due to signal 5 (SIGTRAP).
    -------------------------------------------

    Since I'm quite new to the world of programming, I tried some easy
    steps to resolve the problem:
    1. Look at the Console:
    ---------------------------
    ... Xcode[1072] *** NSTask: Task create for path '/Users/username/
    myapp/build/Debug/myapp.app' failed: 13, "Permission denied".
    Terminating temporary process.
    ---------------------------
    So I repaired permissions and even tried to set full r+w rights to a
    copy of the whole project directory. Sadly, nothing changed.

    2. Create a new Project, to which I copied all my classes and the
    MainMenu.nib file. The App will build and start, but as soon as I drag
    Images into my view - wich worked absolutely well in the (now)
    corrupted project before - the debugger starts and the app crashes.

    I searched the archive and Google, but unfortunately I weren't able to
    find anything that helped me with this matter.

    Right now, I have no clue what to do and I'd highly appreciate any help.

    Kind regards,
    Johannes Huning
  • On 09/12/2007, at 1:41 PM, Johannes Huning wrote:

    > Dear Cocoa Developers,
    >
    > I just started programming Objective-C and Cocoa. As a first
    > Project, I'm creating an application, that generates thumbnails of
    > files dragged to a custom view. Until now, everything worked fine.
    > Then while playing around with my app, the computer stopped
    > responding and I had to turn the Mac of by pressing the power
    > button for a few seconds.
    > After the restart, I tried to recompile and start the Application
    > via XCode. The Build itself succeeds every time, but as XCode tries
    > to open the App (Build and run), I get this error message in the
    > log window:
    > -------------------------------------------
    > [Session started at ... ]
    >
    > The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has
    > exited due to signal 5 (SIGTRAP).
    > -------------------------------------------
    >
    > Since I'm quite new to the world of programming, I tried some easy
    > steps to resolve the problem:
    > 1. Look at the Console:
    > ---------------------------
    > ... Xcode[1072] *** NSTask: Task create for path '/Users/username/
    > myapp/build/Debug/myapp.app' failed: 13, "Permission denied".
    > Terminating temporary process.
    > ---------------------------
    > So I repaired permissions and even tried to set full r+w rights to
    > a copy of the whole project directory. Sadly, nothing changed.
    >
    > 2. Create a new Project, to which I copied all my classes and the
    > MainMenu.nib file. The App will build and start, but as soon as I
    > drag Images into my view - wich worked absolutely well in the (now)
    > corrupted project before - the debugger starts and the app crashes.
    >
    > I searched the archive and Google, but unfortunately I weren't able
    > to find anything that helped me with this matter.
    >
    > Right now, I have no clue what to do and I'd highly appreciate any
    > help.
    >
    >
    > Kind regards,
    > Johannes Huning

    Johannes,

    until someone more knowledgable chimes in, I think you should set
    breakpoints in the method which is first called when you drag in
    images, then breakpoints along whatever chain of methods you have.
    Build and Debug (Command-Y), then step from breakpoint to
    breakpoint.  Maybe you'll see what's happening there.  Also, use of
    NSLog() is very helpful in these situations.

    HTH,

    Ron
  • Your suggestion fixed my problem : )
    I started playing around with breakpoints and several NSLog messages
    to locate the problem. Even the mistake is found, I'm a little confused:
    To implement a highlight effect, I created a instance variable as a
    trigger ..
    BOOL _highlighted;
    To implement drag and drop, I added the necessary methods:
    - (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender;
    - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender;
    - (void)draggingExited:(id < NSDraggingInfo >)sender;
    - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender;
    - (void)concludeDragOperation:(id < NSDraggingInfo >)sender;
    In these methods I either set highlighted to YES or NO and called
    [self setNeedsDisplay:YES]; to update my view. Then, In the drawRect:
    method I checked for self.highlighted and displayed either a normal or
    a coloured background .. depending on self.highlighted's state.

    Now, in the corrupted project (the one with the signal 5, I described
    before), self.highlighted was _not_ set to NO (or YES) in the
    initialiser (initWithFrame:) - but the app worked just fine. On the
    other hand, in this project, I had to set self.highlighted to NO (or
    YES in the initialiser) to prevent the app from crashing while the
    drag & drop operations.
    What's my mistake? Or is there any logical explanation for this
    behaviour?

    Kinds regards,
    Johannes Huning

    On Dec 9, 2007, at 5:20 AM, Ron Fleckner wrote:

    >
    > On 09/12/2007, at 1:41 PM, Johannes Huning wrote:
    >
    >> Dear Cocoa Developers,
    >>
    >> I just started programming Objective-C and Cocoa. As a first
    >> Project, I'm creating an application, that generates thumbnails of
    >> files dragged to a custom view. Until now, everything worked fine.
    >> Then while playing around with my app, the computer stopped
    >> responding and I had to turn the Mac of by pressing the power
    >> button for a few seconds.
    >> After the restart, I tried to recompile and start the Application
    >> via XCode. The Build itself succeeds every time, but as XCode tries
    >> to open the App (Build and run), I get this error message in the
    >> log window:
    >> -------------------------------------------
    >> [Session started at ... ]
    >>
    >> The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has
    >> exited due to signal 5 (SIGTRAP).
    >> -------------------------------------------
    >>
    >> Since I'm quite new to the world of programming, I tried some easy
    >> steps to resolve the problem:
    >> 1. Look at the Console:
    >> ---------------------------
    >> ... Xcode[1072] *** NSTask: Task create for path '/Users/username/
    >> myapp/build/Debug/myapp.app' failed: 13, "Permission denied".
    >> Terminating temporary process.
    >> ---------------------------
    >> So I repaired permissions and even tried to set full r+w rights to
    >> a copy of the whole project directory. Sadly, nothing changed.
    >>
    >> 2. Create a new Project, to which I copied all my classes and the
    >> MainMenu.nib file. The App will build and start, but as soon as I
    >> drag Images into my view - wich worked absolutely well in the (now)
    >> corrupted project before - the debugger starts and the app crashes.
    >>
    >> I searched the archive and Google, but unfortunately I weren't able
    >> to find anything that helped me with this matter.
    >>
    >> Right now, I have no clue what to do and I'd highly appreciate any
    >> help.
    >>
    >>
    >> Kind regards,
    >> Johannes Huning
    >
    > Johannes,
    >
    > until someone more knowledgable chimes in, I think you should set
    > breakpoints in the method which is first called when you drag in
    > images, then breakpoints along whatever chain of methods you have.
    > Build and Debug (Command-Y), then step from breakpoint to
    > breakpoint.  Maybe you'll see what's happening there.  Also, use of
    > NSLog() is very helpful in these situations.
    >
    > HTH,
    >
    > Ron
  • Hi Johannes,

    On 10/12/2007, at 12:30 AM, Johannes Huning wrote:

    > Your suggestion fixed my problem : )

    Good to know.

    > I started playing around with breakpoints and several NSLog
    > messages to locate the problem. Even the mistake is found, I'm a
    > little confused:
    > To implement a highlight effect, I created a instance variable as a
    > trigger ..
    > BOOL _highlighted;
    > To implement drag and drop, I added the necessary methods:
    > - (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender;
    > - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender;
    > - (void)draggingExited:(id < NSDraggingInfo >)sender;
    > - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender;
    > - (void)concludeDragOperation:(id < NSDraggingInfo >)sender;
    > In these methods I either set highlighted to YES or NO and called
    > [self setNeedsDisplay:YES]; to update my view. Then, In the
    > drawRect: method I checked for self.highlighted and displayed
    > either a normal or a coloured background .. depending on
    > self.highlighted's state.
    >
    > Now, in the corrupted project (the one with the signal 5, I
    > described before), self.highlighted was _not_ set to NO (or YES) in
    > the initialiser (initWithFrame:) - but the app worked just fine. On
    > the other hand, in this project, I had to set self.highlighted to
    > NO (or YES in the initialiser) to prevent the app from crashing
    > while the drag & drop operations.
    > What's my mistake? Or is there any logical explanation for this
    > behaviour?
    >
    > Kinds regards,
    > Johannes Huning

    Sorry, I'm really no expert.  I just thought I would suggest an
    approach I would take.  Your description of highlighting seems fine
    to me.  Your original problem 'seems' like it was related to memory.
    There is ALWAYS a logical explanation.  Sometimes it's just very
    difficult to find it.  I've just been reading Aaron Hillegass on
    writing code to aid in debugging and I think I will begin using his
    suggestions: break the code down into discreet statements, avoiding
    deep nesting.  This way you can, either with the debugger or simply
    using NSLog() or printf() statements, find out more easily what's
    going on.  I think if you closely read your 'corrupted' project's
    code, you'll be able to track down where things have gone awry.

    >
    > On Dec 9, 2007, at 5:20 AM, Ron Fleckner wrote:
    >
    >>
    >> On 09/12/2007, at 1:41 PM, Johannes Huning wrote:
    >>
    >>> Dear Cocoa Developers,
    >>>
    >>> I just started programming Objective-C and Cocoa. As a first
    >>> Project, I'm creating an application, that generates thumbnails
    >>> of files dragged to a custom view. Until now, everything worked
    >>> fine. Then while playing around with my app, the computer stopped
    >>> responding and I had to turn the Mac of by pressing the power
    >>> button for a few seconds.

    It's very unlikely that a memory problem in your application will
    cause the computer to die.  In future, if you get the same effect,
    just force quit the application, either via the Apple menu item Force
    Quit or using the keys Command-Option-Escape.

    Good luck.

    >>> Kind regards,
    >>> Johannes Huning
    >>
    >> Johannes,
    >>
    >> until someone more knowledgable chimes in, I think you should set
    >> breakpoints in the method which is first called when you drag in
    >> images, then breakpoints along whatever chain of methods you
    >> have.  Build and Debug (Command-Y), then step from breakpoint to
    >> breakpoint.  Maybe you'll see what's happening there.  Also, use
    >> of NSLog() is very helpful in these situations.
    >>
    >> HTH,
    >>
    >> Ron

previous month december 2007 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