Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [cdt-dev] Cygwin gdb refuses to be killed

Hey Stuart,
 
my bug is actually a duplicate of 80092.
 
 
Thanks,
 
 
Norbert


Von: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] Im Auftrag von Stuart Fullmer
Gesendet: Mittwoch, 20. Dezember 2006 19:26
An: 'CDT General developers list.'
Betreff: RE: [cdt-dev] Cygwin gdb refuses to be killed

>> 1) Anybody experience similar problems?

> 

 

I’ve seen it and our users have been running into this issue.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=80092

 

>>3) Other suggestions how this can be fixed?

> 

 

I submitted a patch for this and Ken Ryall has been kind enough to submit into one of the upcoming or recent builds. The patch adds a session.terminate to the throw in question that should bring the rouge process down.

 

    -Stu

 


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Ploett, Norbert
Sent: Wednesday, December 20, 2006 12:30 AM
To: CDT General developers list.
Subject: [cdt-dev] Cygwin gdb refuses to be killed

 

Well, nobody likes to be killed, after all.

 

Here is the scenario:

 

- I am setting up a remote debug session. I use org.eclipse.cdt.debug.mi.core.MIPlugin.createCSession(String, String, File, int, String[], File, String, IProgressMonitor) to create the MISession. In cases where the connection to the debug target fails the MITargetSelect.getMIInfo() method throws a MIException which is caught like this:

 

  } catch (MIException e) {
   pgdb.destroy();
   throw e;
  }

pgdb.destroy() ultimately causes the Spawner to send some signals to the gdb process, but gdb does not like those. The gdb process remains in memory and causes 100% system load. I have to kill it off manually with the task manager.

 

Here is a quick hacky workaround:

 

  } catch (MIException e) {
   pgdb.getOutputStream().write("quit\n".getBytes());
   try {
    pgdb.waitFor();
   } catch (InterruptedException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
   }
   throw e;
  }

So if I ask gdb nicely to quit it works fine.

A clean solution needs some polishing and can't just call waitFor() without any precautions, but I'd like to put up two questions:

 

1) Anybody experience similar problems?

 

2) Wouldn't it be good to implement the create*Session() methods in a way so that we first ask gdb to quit nicely before trying to kill it?

 

3) Other suggestions how this can be fixed?

 

 

Thanks for reading this far. I have created https://bugs.eclipse.org/bugs/show_bug.cgi?id=168646 for the discussion.

 

 

Greetings,

 

 

 

Norbert Ploett

 

 

 


Back to the top