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 268301 - ArrayIndexOutOfBoundsException: 308
Summary: ArrayIndexOutOfBoundsException: 308
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 269113 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-01 01:40 UTC by Exceptions Reporter
Modified: 2016-12-13 11:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 226529


Attachments
stacktrace (3.85 KB, text/plain)
2016-10-01 01:40 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2016-10-01 01:40:27 UTC
Build: NetBeans IDE 8.1 (Build 201511021428)
VM: OpenJDK 64-Bit Server VM, 25.102-b14, OpenJDK Runtime Environment, 1.8.0_102-8u102-b14.1-1~bpo8+1-b14
OS: Linux

User Comments:
GUEST: Hmm nothing? I think I've just pressed run button. 
Hope some of my project details will be usefull to you:
- language: C++ 11
- WxWidgets 3.0
- makefile based
- My OS: Debian Linux Jessie

BTW. I noticed the error message after compilling following code: 
        year   = std::stoi( (std::string) date[0].substr(22,4) );
        month  = std::stoi( (std::string) date[0].substr(27,2) );
        day    = std::stoi( (std::string) date[0].substr(30,2) );
        hour   = std::stoi( (std::string) date[0].substr(33,2) );
        minute = std::stoi( (std::string) date[0].substr(36,2) );
        second = std::stoi( (std::string) date[0].substr(39,2) );




Stacktrace: 
java.lang.ArrayIndexOutOfBoundsException: 308
   at java.lang.Integer.valueOf(Integer.java:831)
   at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onID(APTBaseLanguageFilter.java:124)
   at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onToken(APTBaseLanguageFilter.java:145)
   at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter$FilterStream.nextToken(APTBaseLanguageFilter.java:159)
   at org.netbeans.modules.cnd.apt.impl.support.SplitShiftRightTokenFilter.nextToken(SplitShiftRightTokenFilter.java:77)
   at org.netbeans.modules.cnd.apt.impl.support.SplitShiftRightTokenFilter.nextToken(SplitShiftRightTokenFilter.java:59)
Comment 1 Exceptions Reporter 2016-10-01 01:40:30 UTC
Created attachment 162299 [details]
stacktrace
Comment 2 Alexander Simon 2016-10-26 07:36:36 UTC
I see the same exception on sparc untit test machine:
java.lang.ArrayIndexOutOfBoundsException: 347
	at java.lang.Integer.valueOf(Integer.java:831)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onID(APTBaseLanguageFilter.java:124)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onToken(APTBaseLanguageFilter.java:145)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter$FilterStream.nextToken(APTBaseLanguageFilter.java:159)
	at org.netbeans.modules.cnd.antlr.TokenBuffer.<init>(TokenBuffer.java:58)
	at org.netbeans.modules.cnd.antlr.LLkParser.<init>(LLkParser.java:33)
	at org.netbeans.modules.cnd.antlr.LLkParserNoEx.<init>(LLkParserNoEx.java:63)
	at org.netbeans.modules.cnd.modelimpl.parser.generated.CPPParser.<init>(CPPParser.java:46)
	at org.netbeans.modules.cnd.modelimpl.parser.generated.CPPParser.<init>(CPPParser.java:41)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.<init>(CPPParserEx.java:196)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.getInstance(CPPParserEx.java:231)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.getInstance(CPPParserEx.java:220)
	at org.netbeans.modules.cnd.modelimpl.parser.ParserProviderImpl$Antlr2CppParser.init(ParserProviderImpl.java:162)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.doParse(FileImpl.java:1545)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._parse(FileImpl.java:1162)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsedImpl(FileImpl.java:738)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:653)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:148)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:74)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at java.lang.Thread.run(Thread.java:745)
Comment 3 Alexander Simon 2016-10-26 07:38:02 UTC
for more details see job/cnd-test-solaris.sparc/13860
Comment 4 Vladimir Kvashin 2016-10-27 08:32:43 UTC
I'm marking it as a 8.2 patch candidate. What makes me think so:
1) it's an exception in old code model, which means it will affect the upcoming Studio release
2) it still reproduces even in tests
Comment 5 Vladimir Kvashin 2016-10-27 08:36:20 UTC
To put it more precise: one of the two exception reports shows
"C/C++ code model: using old preprocessor" in log. (While the other one uses new prerocessor)
Comment 6 Vladimir Voskresensky 2016-11-28 14:10:37 UTC
see https://netbeans.org/bugzilla/show_bug.cgi?id=269113 as well?
Comment 7 Vladimir Voskresensky 2016-11-28 14:11:22 UTC
(In reply to Vladimir Kvashin from comment #5)
> To put it more precise: one of the two exception reports shows
> "C/C++ code model: using old preprocessor" in log. (While the other one uses
> new prerocessor)
So, removing 'newcodemodel' prefix
Comment 8 Vladimir Voskresensky 2016-11-28 16:47:39 UTC
*** Bug 269113 has been marked as a duplicate of this bug. ***
Comment 9 Vladimir Voskresensky 2016-11-28 16:48:11 UTC
see investigation in https://netbeans.org/bugzilla/show_bug.cgi?id=269113#c7
Comment 10 Vladimir Voskresensky 2016-11-28 16:57:31 UTC
fresh stack trace is 
va.lang.ArrayIndexOutOfBoundsException:287:java.lang.ArrayIndexOutOfBoundsException: 287:null:25 in onID 
java.lang.ArrayIndexOutOfBoundsException: 287
	at java.lang.Integer.valueOf(Integer.java:831)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onID(APTBaseLanguageFilter.java:125)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter.onToken(APTBaseLanguageFilter.java:146)
	at org.netbeans.modules.cnd.apt.support.lang.APTBaseLanguageFilter$FilterStream.nextToken(APTBaseLanguageFilter.java:160)
	at org.netbeans.modules.cnd.modelimpl.parser.apt.APTParseFileWalker$LdScopeFilter.nextToken(APTParseFileWalker.java:548)
	at org.netbeans.modules.cnd.antlr.TokenBuffer.<init>(TokenBuffer.java:67)
	at org.netbeans.modules.cnd.antlr.LLkParser.<init>(LLkParser.java:33)
	at org.netbeans.modules.cnd.antlr.LLkParserNoEx.<init>(LLkParserNoEx.java:63)
	at org.netbeans.modules.cnd.modelimpl.parser.generated.CPPParser.<init>(CPPParser.java:46)
	at org.netbeans.modules.cnd.modelimpl.parser.generated.CPPParser.<init>(CPPParser.java:41)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.<init>(CPPParserEx.java:196)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.getInstance(CPPParserEx.java:231)
	at org.netbeans.modules.cnd.modelimpl.parser.CPPParserEx.getInstance(CPPParserEx.java:220)
	at org.netbeans.modules.cnd.modelimpl.parser.ParserProviderImpl$Antlr2CppParser.init(ParserProviderImpl.java:163)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.doParse(FileImpl.java:1546)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._parse(FileImpl.java:1162)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsedImpl(FileImpl.java:738)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:653)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:148)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:74)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 11 Vladimir Voskresensky 2016-11-28 18:35:33 UTC
fixed on enum
changeset: 313463:7ecc78878c7f [release82] 
changeset: 313464:ff893c3cec4d [release82] 

Had to introduce own cache of Integers due to bug in JIT
Comment 12 Quality Engineering 2016-12-03 03:04:22 UTC
Integrated into 'main-silver', will be available in build *201612030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c1b1e52b1efe
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing bug #268301 - ArrayIndexOutOfBoundsException: 308
- catch early enough, but not in onID to allow JIT optimizations still to work
(transplanted from 7ecc78878c7f3ac560bb1b2403eae87265061ff0)
Comment 13 soldatov 2016-12-13 11:44:11 UTC
Verified in NetBeans IDE 8.2 (Build 201612122312)

I will recheck this bug later (in new biweekly build on Solaris Sparc).