Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: bnilsson on November 08, 2006, 06:45:18 pm

Title: Killing file manager when debugger is stopped
Post by: bnilsson on November 08, 2006, 06:45:18 pm
When the CB debugger is stopped, my file manager is killed, clearing the desktop and all applications.
I thought this was fixed?
My CB rev is 3194.
Title: Re: Killing file manager when debugger is stopped
Post by: afb on November 08, 2006, 08:05:34 pm
I thought this was fixed?

I thought so too, was this with the patched wxWidgets ?
http://www.algonet.se/~afb/wx/wxWidgets-killpoll.patch
Title: Re: Killing file manager when debugger is stopped
Post by: afb on November 08, 2006, 08:08:41 pm
Also, if this is the same as the previous bug, it is not just the file manager (Finder.app) but the entire session manager (Login.app) - which is much more severe, and loses more data. :-(

http://developer.berlios.de/bugs/?func=detailbug&bug_id=8950&group_id=5358
Title: Re: Killing file manager when debugger is stopped
Post by: afb on November 09, 2006, 04:05:09 pm
Hmm, just thought about it and the patch was only for Intel anyway...
We'll need to add some safety checks to the "debugger stop" command!
Title: Re: Killing file manager when debugger is stopped
Post by: afb on November 09, 2006, 07:59:27 pm
Hmm, sending a SIGKILL to PID=-1 will also do that you mention:

Code
     The following pids have special meanings:
     -1      If superuser, broadcast the signal to all processes; otherwise
             broadcast to all processes belonging to the user.

This seems to be a pretty nasty setup, considering what wxMac does:

Code
    // 0 means execution failed. Returning non-zero is a PID, but not
    // on Mac where PIDs are 64 bits and won't fit in a long, so we
    // return a dummy value for now.
    return ( err == noErr ) ? -1 : 0;
Code
    // Semi-macros used for return value of wxMacExecute
const long errorCode = ((flags & wxEXEC_SYNC) ? -1 : 0);
const long successCode = ((flags & wxEXEC_SYNC) ? 0 : -1); // fake PID


Add a Code::Blocks that only checks for PID=0, and you have a problem...
Title: Re: Killing file manager when debugger is stopped
Post by: afb on November 09, 2006, 08:41:22 pm
I can confirm that sending a kill -INT -1 does precisely what bnilsson reports here...
WARNING: do not try this at home, since all programs will quit without saving first!