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.
Build: NetBeans IDE Dev (Build 201510060002) VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16 OS: Linux User Comments: vkvashin: I tried to do mixed (java and C/C++) debugging Unfortunately I don't remember exact details Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.makeThreadCurrent(GdbDebuggerImpl.java:1860) at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$21.onDone(GdbDebuggerImpl.java:2320) at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194) at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188) at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697) at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
Created attachment 156593 [details] stacktrace
I also noiticed the following messages in console - I don't know whether they are related with the issue or not: WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 53-stack-list-arguments 1 --thread 27 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 54-stack-list-arguments 1 --thread 26 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 55-stack-list-arguments 1 --thread 25 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 56-stack-list-arguments 1 --thread 24 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 57-stack-list-arguments 1 --thread 23 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 58-stack-list-arguments 1 --thread 22 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 59-stack-list-arguments 1 --thread 21 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 60-stack-list-arguments 1 --thread 20 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 61-stack-list-arguments 1 --thread 19 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 62-stack-list-arguments 1 --thread 18 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 63-stack-list-arguments 1 --thread 17 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 64-stack-list-arguments 1 --thread 16 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 65-stack-list-arguments 1 --thread 15 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 66-stack-list-arguments 1 --thread 14 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 67-stack-list-arguments 1 --thread 13 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 68-stack-list-arguments 1 --thread 12 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 69-stack-list-arguments 1 --thread 11 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 70-stack-list-arguments 1 --thread 10 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 71-stack-list-arguments 1 --thread 9 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 72-stack-list-arguments 1 --thread 8 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 73-stack-list-arguments 1 --thread 7 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 74-stack-list-arguments 1 --thread 6 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 75-stack-list-arguments 1 --thread 5 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 76-stack-list-arguments 1 --thread 4 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 77-stack-list-arguments 1 --thread 3 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 78-stack-list-arguments 1 --thread 2 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 79-stack-list-arguments 1 --thread 1 to gdb while program is running WARNING [class org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl]: Sending 80-stack-list-frames --thread 1 to gdb while program is running
Created attachment 156616 [details] Possible fix The code in GdbDebuggerImpl.requestThreadsWithStacks() contains latent NPE: if the thread is not found by IDE, then NPE is guaranteed. The possible fix could be as attached - but I have no idea, what are further consequences and thus correct error processing.
I faced it again when trying to debug a relatively simple (although multy-threaded) fs_server program.
I see lots of such exceptions in the log attached to issue 256891 A while ago I attached the proposed fix, which is not ideal probably, but at least eliminates NPE. It should be probably enhanced with a brief error message (in IDE status bar for example)
This fix just helps a user avoid the exception. I need a gdb log to get better understanding why the threadlist is empty. https://enum.ru.oracle.com/hg/release81/rev/fe7746ed691b https://enum.ru.oracle.com/hg/release81/rev/c3b32ff1efa4
Integrated into 'main-silver', will be available in build *201512160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/cdae712fa8b7 User: Nikolay Koldunov <henk89@netbeans.org> Log: Fixed #255779 - NullPointerException at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.makeThreadCurrent (transplanted from fe7746ed691b9bc12acd67b5746058e92b1a7b59)
Cannot reproduce the bug in build 20121215.