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 151481

Summary: StringIndexOutOfBoundsException when debugging
Product: cnd Reporter: Egor Ushakov <gorrus>
Component: DebuggerAssignee: _ gordonp <gordonp>
Status: VERIFIED FIXED    
Severity: blocker CC: joris_m, sustaining
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows XP   
URL: http://statistics.netbeans.org/analytics/detail.do?id=132872
Issue Type: DEFECT Exception Reporter:

Description Egor Ushakov 2008-10-27 14:57:56 UTC
From the exception report http://statistics.netbeans.org/analytics/detail.do?id=132872:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:687)
        at org.netbeans.modules.cnd.debugger.gdb.GdbDebugger.createShareTab(GdbDebugger.java:1770)
        at org.netbeans.modules.cnd.debugger.gdb.GdbDebugger.resultRecord(GdbDebugger.java:1049)
        at org.netbeans.modules.cnd.debugger.gdb.proxy.GdbProxyEngine.processMessage(GdbProxyEngine.java:357)
        at org.netbeans.modules.cnd.debugger.gdb.proxy.GdbProxyEngine.access$100(GdbProxyEngine.java:76)
        at org.netbeans.modules.cnd.debugger.gdb.proxy.GdbProxyEngine$.run(GdbProxyEngine.java:238)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

This may be connected with issue 142889
Comment 1 Alexander Pepin 2008-10-27 15:33:47 UTC
link to this issue added to issue #142889
Comment 2 Exceptions Reporter 2008-11-07 21:40:08 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=132872
Comment 3 _ gordonp 2008-11-07 22:34:10 UTC
Trivial fix
Comment 4 _ gordonp 2008-11-07 22:46:55 UTC
Fixed in http://hg.netbeans.org/main/rev/66a3add56e01
Comment 5 Quality Engineering 2008-11-08 04:27:45 UTC
Integrated into 'main-golden', will be available in build *200811080201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/66a3add56e01
User: Gordon Prieur <gordonp@netbeans.org>
Log: Fixed IZ #151481  SIOOBE in GdbDebugger.createShareTab.
Comment 6 ahot 2008-12-23 19:23:08 UTC
OK in Build 200812230201
Comment 7 _ gordonp 2009-01-09 16:28:38 UTC
*** Issue 156535 has been marked as a duplicate of this issue. ***
Comment 8 joris_m 2009-01-10 10:56:26 UTC
Hi,

This issue is said to be fixed but is it also fixed in the released version 6.5 (with updates)?? This because I am still
having trouble with this issue there..

regards,

Joris
Comment 9 _ gordonp 2009-01-10 19:38:27 UTC
Joris, the bug was *not* fixed in 6.5. I'm changing Target Milestone to 7.0 since
thats where it was really fixed and verified.

Alexander, can you consider nominating this issue for patch 2? Its a trivial fix,
changing "if (line.charAt(0))" to "if (line.length() > 0 && line.charAt(0))".

Support: There are several other changes in the changeset related to findbugs cleanup,
but those parts are not actually part of this fix and don't need to be backported to
a patch). The line mentioned above is all that would be needed in a patch.
Comment 10 Alexander Pepin 2009-01-12 10:35:36 UTC
It would be good to have this in the patch2
Comment 11 jinb 2009-01-14 16:17:10 UTC
fix backported into release65_fixes branch
http://hg.netbeans.org/release65_fixes/rev/638317b4663b
Comment 12 Alexander Pepin 2009-01-19 15:35:42 UTC
verified in patch2