Author Topic: Killing file manager when debugger is stopped  (Read 4483 times)

bnilsson

  • Guest
Killing file manager when debugger is stopped
« 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.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Killing file manager when debugger is stopped
« Reply #1 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
« Last Edit: November 08, 2006, 08:09:22 pm by afb »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Killing file manager when debugger is stopped
« Reply #2 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
« Last Edit: November 08, 2006, 08:11:03 pm by afb »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Killing file manager when debugger is stopped
« Reply #3 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!

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Killing file manager when debugger is stopped
« Reply #4 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...

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Killing file manager when debugger is stopped
« Reply #5 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!