This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220325 - C/C++ gdb IDE interface hangs and thread non-deletable after a fault
Summary: C/C++ gdb IDE interface hangs and thread non-deletable after a fault
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Egor Ushakov
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2012-10-17 20:13 UTC by aschwarz1309
Modified: 2012-10-26 01:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aschwarz1309 2012-10-17 20:13:12 UTC
Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_03
Runtime = Java HotSpot(TM) Client VM 22.1-b02
Cygwin gcc 4.5.3
            gdb 4.5.3

After an exception, and attempt to continue will have no effect (no further action). On a 'finish debug session, 'shiift-F5', will allow a new session to be started. The previous stays active and can can not be deleted (Sessions->Finish or Sessions->Finish All has no effect). the only way to delete a stale session is to restart the IDE.

This is a non-critical bug since there is a work-around. But it would be nice to fix it.
Comment 1 aschwarz1309 2012-10-19 21:54:49 UTC
The following code generates a fault on the second ptr->fnc(). Any attempt to continue in the same thread after the failure will fail; Netbeans does not continue. At this point the executing thread (in which the fault occurred) and not be deleted without restarting Netbeans.

art

[code]
# include <iostream>
# include <cstdlib>

using namespace std;

class base { 
public:
   base() { }
   ~base() { }
   void * operator new(size_t size) {
      static int freespace;
      return (void*)&freespace;
   }
   void   operator delete(void * ptr) { }
   virtual void fnc() = 0;
};

class derived : public base {
public:
   void fnc() { cout << "derived" << endl; }
};
int main(int argc, char** argv) {
   derived* ptr = new derived();
   ptr->fnc();
   delete ptr;
   ptr->fnc();

   return 0;
}
[/code]
Comment 2 Egor Ushakov 2012-10-25 15:09:09 UTC
It works almost the same from the command line:
gdb process hangs and you can only kill it.
I think on Windows we should kill gdb process on debugger stop.
Comment 3 Egor Ushakov 2012-10-25 15:22:54 UTC
fixed in:
http://hg.netbeans.org/cnd-main/rev/e45d432915b8

now debug session stop kills gdb hung process no matter what.
Comment 4 Quality Engineering 2012-10-26 01:28:11 UTC
Integrated into 'main-golden', will be available in build *201210260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e45d432915b8
User: Egor Ushakov <gorrus@netbeans.org>
Log: fixed #220325 - C/C++ gdb IDE interface hangs and thread non-deletable after a fault