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 82103 - NPE when step in system function
Summary: NPE when step in system function
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-07 20:03 UTC by julieg
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NullPointerException log (16.13 KB, application/octet-stream)
2006-08-11 08:43 UTC, alexandrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description julieg 2006-08-07 20:03:37 UTC
to reproduce:

=> open/build quote sample project
=> open quote.cc and set bpt at line 78
=> click continue button
=> enter xyz from the debugging xterm window
=> click next several times until line 84 (cout << ...)
=> click step in
=> gdb-lite thows exception

java.lang.NullPointerException
	at
org.netbeans.modules.cnd.debugger.gdb.EditorContextBridge.showSource(EditorContextBridge.java:70)
[catch] at
org.netbeans.modules.cnd.debugger.gdb.CurrentThreadAnnotationListener$1.run(CurrentThreadAnnotationListener.java:149)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Nikolay Molchanov 2006-08-09 06:48:26 UTC
Julie, is it on Windows? If yes, which gdb was used? 
I think I fixed this problem today (08/08) for gdb 6.5 on Windows.
-- Nik
Comment 2 alexandrov 2006-08-11 08:43:54 UTC
Created attachment 32807 [details]
NullPointerException log
Comment 3 alexandrov 2006-08-11 08:46:45 UTC
Nik, problem is reprodicible for any c++ project on gdb 6.5.5, cnd build 060810
5-6 "Step into" leads to NPE
I've attached log for running MP project
Debugger Console stack is the next^
 Start debugger gdb
gdb_cmd=gdb --nw --interpreter=mi
set new-console
~"GNU gdb 6.5.50.20060706-cvs (cygwin-special)\n"
~"Copyright (C) 2006 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you 
are\n"
~"welcome to change it and/or distribute copies of it under certain 
conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB.  Type \"show warranty\" for 
details.\n"
~"This GDB was configured as \"i686-pc-cygwin\"."
~"\n"
(gdb) 
&"set new-console\n"
212-file-exec-and-symbols C:/Documents\ and\ Settings/USER/MP4/dist/Debug_mp/mp
^done
(gdb) 
221-break-insert mp.cc:29
212^done
(gdb) 
221^done,bkpt=
{number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0040117a",func="m
ain",file="mp.cc",fullname="/cygdrive/c/Documents and 
Settings/USER/MP4/mp.cc",line="29",times="0"}
(gdb) 
-exec-run mp
^running
(gdb) 
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame=
{addr="0x0040117a",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="29"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x0040117a",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="29"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x0040118e",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="30"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x0040118e",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="30"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x00401196",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="33"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x00401196",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="33"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x004011a0",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="34"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x004011a0",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="34"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x004011a8",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="35"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x004011a8",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="35"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x004011f7",func="main",args=[{name="argc",value="2"},
{name="argv",value="0x6c1a20"}],file="mp.cc",fullname="/cygdrive/c/Documents 
and Settings/USER/MP4/mp.cc",line="41"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x004011f7",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="41"}]
(gdb) 
-exec-step 
^running
(gdb) 
*stopped,reason="end-stepping-range",thread-id="1",frame=
{addr="0x0042d0c4",func="std::ostream::operator<<",args=
[],file="/usr/lib/gcc/i686-pc-
cygwin/3.4.4/include/c++/iostream",fullname="/usr/lib/gcc/i686-pc-
cygwin/3.4.4/include/c++/iostream",line="77"}
(gdb) 
-stack-list-frames
^done,stack=[frame=
{level="0",addr="0x0042d0c4",func="std::ostream::operator<<",file="/usr/lib/gcc
/i686-pc-cygwin/3.4.4/include/c++/iostream",fullname="/usr/lib/gcc/i686-pc-
cygwin/3.4.4/include/c++/iostream",line="77"},frame=
{level="1",addr="0x0040121c",func="main",file="mp.cc",fullname="/cygdrive/c/Doc
uments and Settings/USER/MP4/mp.cc",line="41"}]
(gdb) 
Comment 4 Nikolay Molchanov 2006-08-19 01:21:56 UTC
We investigated this issue, and I thought we added the most important comments, 
but I don't see them here, so I'll add them again:

 The problem is reproducible only if directory name has spaces.
 If the same project is created in directory, which name does not
 have spaces, everything works just fine.


Comment 5 julieg 2006-09-13 23:02:10 UTC
According to the FCS quality criteria, NPE is a P1 bug.
Comment 6 _ gordonp 2006-09-14 00:18:07 UTC
EditorContextBridge.showSource() was trying to show source even when we
didn't have a file name or the file name was a unix-like file name (gdb
gives us paths like /usr/include/... now, instead of c:\cygwin\usr\include\...).

When this happened, we created a java.io.File and tried to get a FileObject
from it. Now we're checking File.exists() before trying to get the FileObject.
If it exists, we can get a FO. If not, we skip it.
Comment 7 Alexander Pepin 2007-09-18 14:52:50 UTC
Verified in nightly build 20070915