Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 204711 - NetBeans does not terminate GDB after debugging is complete
NetBeans does not terminate GDB after debugging is complete
Product: cnd
Classification: Unclassified
Component: Debugger
PC Windows 7 x64
: P3 with 1 vote (vote)
: 7.1.1
Assigned To: Egor Ushakov
Depends on:
  Show dependency treegraph
Reported: 2011-11-05 17:43 UTC by nessup
Modified: 2013-08-26 12:23 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT

gdb log (38.49 KB, application/octet-stream)
2013-08-02 19:04 UTC, jsprenkle

Note You need to log in before you can comment on or make changes to this bug.
Description nessup 2011-11-05 17:43:04 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_01
Runtime = Java HotSpot(TM) 64-Bit Server VM 21.1-b02

It seems that, after my program exists gracefully (or not), an instance of gdb is left running in memory. Unless I terminate this rogue instance of GDB, NB debugging refuses to work entirely. Although I can get around the issue by manually SIGTERMing GDB after each program exit, it gets annoying after a while. Any solutions here? I am running GDB with the  -J-Dgdb.breakpoints.shortpaths=true flag. I would provide a NB log if I knew how.

Comment 1 Egor Ushakov 2011-11-07 10:40:31 UTC
are you using cygwin or mingw?
Comment 2 nessup 2011-11-08 17:11:21 UTC
Cygwin. Thanks, --Dany.
Comment 3 Egor Ushakov 2011-12-07 15:04:03 UTC
could you please:
1. attach gdb log from such session (
2. try NB7.1rc2

Comment 4 dimstef 2011-12-23 11:37:55 UTC
I have the same problem too. I also tried NetBeans 7.1rc2, but there is no difference. My configuration is Win7 x64 NetBeans 7.0.1 CygWin.
Please Help!!!

Comment 5 Egor Ushakov 2011-12-23 11:40:43 UTC
(In reply to comment #4)
> I have the same problem too. I also tried NetBeans 7.1rc2, but there is no
> difference. My configuration is Win7 x64 NetBeans 7.0.1 CygWin.
> Please Help!!!
> dimstef

could you please attach gdb log?
Comment 6 dimstef 2011-12-28 09:16:43 UTC
First of all let me thank you for your immediate apply.
The gdb log I take from the Debugger Console is the following:

~"GNU gdb (GDB) (cygwin-special)\n"
~"Copyright (C) 2011 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-cygwin\".\nFor bug reporting instructions, please see:\n"
&"C:\\\\Users\\\\dimstef/.gdbinit: No such file or directory.\n"
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-file-symbol-file "D:/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/acotcop.exe"
7-file-exec-and-symbols  "D:\\Users\\dimitris\\My Documents\\EAP\\Enotites\\PLSDE\\Project\\acotcop\\acotcop.exe"
9cd D:\Users\dimitris\My Documents\EAP\Enotites\PLSDE\Project\acotcop
8^done,line="310",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",macro-info="0"
11-break-insert -f "main.c:340"
12-break-insert -t _start
&"cd D:\\Users\\dimitris\\My Documents\\EAP\\Enotites\\PLSDE\\Project\\acotcop\n"
~"Working directory /cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop.\n"
11^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004020b5",func="main",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="340",times="0",original-location="main.c:340"}
12^error,msg="Function \"_start\" not defined."
No command for record 1^done
13-break-insert -t main
13^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00402018",func="main",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="319",times="0",original-location="main"}
~"[New Thread 1920.0xf34]\n"
~"[New Thread 1920.0xc7c]\n"
=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00402018",func="main",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="319",times="1",original-location="main"}
*stopped,reason="breakpoint-hit",disp="del",bkptno="2",frame={addr="0x00402018",func="main",args=[{name="argc",value="1"},{name="argv",value="0xf99eb0"}],file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="319"},thread-id="1",stopped-threads="all"
15info threads
&"info threads\n"
~"  Id   Target Id         Frame \n"
~"  2    Thread 1920.0xc7c 0x77a9f8f5 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/system32/ntdll.dll\n"
~"* 1    Thread 1920.0xf34 main (argc=1, argv=0xf99eb0) at main.c:319\n"
No answer for: 14-exec-run
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004020b5",func="main",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="340",times="1",original-location="main.c:340"}
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x004020b5",func="main",args=[{name="argc",value="1"},{name="argv",value="0xf99eb0"}],file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="341"},thread-id="1",stopped-threads="all"
17^done,stack=[frame={level="0",addr="0x004020b5",func="main",file="main.c",fullname="/cygdrive/d/Users/dimitris/My Documents/EAP/Enotites/PLSDE/Project/acotcop/main.c",line="341"}]
No answer for: 16-exec-continue
18-stack-list-arguments 1
19-var-update --all-values * 
20-stack-list-locals --simple-values
21-var-create - @ error
22-var-create - @ argc
23-var-create - @ argv
24-var-update --all-values * 
23^done,name="var3",numchild="1",value="0xf99eb0",type="char **",thread-id="1",has_more="0"
25-var-show-attributes "var1"
26-var-show-attributes "var2"
27-var-show-attributes "var3"
28-var-evaluate-expression var1
29-var-evaluate-expression var2
30-var-evaluate-expression var3
Let me note here that the above is what I take when I create a breakpoint at the very last command line of the program (at the "return" of the main function), since, if I let it finish, everything disappears in the debugging console, so there is nothing to copy from. Is there any other method for debugging messages copying?

I would appreciate your answer.
Thanks in advance
Comment 7 Egor Ushakov 2011-12-28 10:24:08 UTC
(In reply to comment #6)
> Let me note here that the above is what I take when I create a breakpoint at
> the very last command line of the program (at the "return" of the main
> function), since, if I let it finish, everything disappears in the debugging
> console, so there is nothing to copy from. Is there any other method for
> debugging messages copying?

Thanks for the log, investigating it at the moment!
The full log is saved in a temporary files folder and is not deleted until you close the IDE, see more information on how to find it here:
Comment 8 Egor Ushakov 2011-12-28 14:03:04 UTC
should be fixed in:
Comment 9 Quality Engineering 2011-12-29 13:59:03 UTC
Integrated into 'main-golden', will be available in build *201112290601* on (upload may still be in progress)
User: Egor Ushakov <>
Log: fixed #204711 (NetBeans does not terminate GDB after debugging is complete)
Comment 10 Egor Ushakov 2012-01-16 13:36:37 UTC
this fix is causing NPE in bug 207277
Comment 11 Egor Ushakov 2012-01-16 13:36:48 UTC
*** Bug 207277 has been marked as a duplicate of this bug. ***
Comment 12 Egor Ushakov 2012-01-16 15:09:16 UTC
this bug is fixed
Comment 13 soldatov 2012-01-17 14:23:43 UTC
verified in latest build. -1 in Sessions tab before fix and valid PID now
Comment 14 Egor Ushakov 2012-01-17 14:31:58 UTC
integrated into release71_fixes:
Comment 15 soldatov 2012-02-17 08:47:11 UTC
verified in NetBeans IDE 7.1 (Build 201112071828)
Comment 16 soldatov 2012-02-17 09:47:24 UTC
Verified in NetBeans 7.1 with updates from 201202141941
Comment 17 jsprenkle 2013-07-29 18:50:18 UTC
This bug appears to have resurfaced in version 7.3.1

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Comment 18 Egor Ushakov 2013-08-02 13:17:21 UTC
Please specify what cygwin or mingw version you're using and attach gdblog file (
Comment 19 jsprenkle 2013-08-02 16:56:28 UTC
g++.exe version 4.8.0 rev2 built by MinGW-builds project.

After hitting stop button in netbeans the program 'gdborig.exe' is still found running in the task list.

I can't capture any gdb output after the program is stopped. The gdb console is cleared when the stop button is pressed.
Comment 20 Egor Ushakov 2013-08-02 17:50:36 UTC
thanks for the info, please attach gdb console content right before you press stop, that should be enough
Comment 21 jsprenkle 2013-08-02 19:04:40 UTC
Created attachment 138210 [details]
gdb log

gdb does not exit when debugger is stopped
Comment 22 Egor Ushakov 2013-08-26 12:23:13 UTC
(In reply to jsprenkle from comment #21)
Last described situation seems to be the same as in the bug 186336, to confirm that please verify that pause does not work. We use the same technique for pause and kill. If pause does not work, then add comments to the bug 186336, otherwise reopen this bug. Thanks.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo