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.
Summary: | ArrayIndexOutOfBoundsException at java.lang.System.arraycopy | ||
---|---|---|---|
Product: | cnd | Reporter: | baffyofdaffy <baffyofdaffy> |
Component: | -- Other -- | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | vstejskal |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=62240 | ||
Issue Type: | DEFECT | Exception Reporter: | 62240 |
Attachments: | stacktrace |
Description
baffyofdaffy
2009-02-25 19:34:57 UTC
Created attachment 77377 [details]
stacktrace
This issue has already 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=62240 vita, please: shouldn't AbstractDocument.getText() throw BadLocationException instead of ArrayIndexOutOfBoundsException? This one calls org.netbeans.editor.DocumentContent.getString() which checks arguments in checkBounds(offset, length, length()). Why would checkBounds allow to continue with wrong arguments and thus result in AIOOB? Reassigning. > vita, please: shouldn't AbstractDocument.getText() throw BadLocationException instead of ArrayIndexOutOfBoundsException?
Yes, under normal circumstances it should. What you see here is a race condition, because Document.getText as well as
any other method accessing document contents ought to be called under the document's readlock. There are different
stacktraces duplicated to this issue, which means that there are different places in the IDE that violate this rule. Fix
your EditableDiffView$RefreshDiffTask.computeDiff(EditableDiffView.java:985) and pass it to others. You should wrap your
code in Document.render call.
fixing diff's part: cdev #4e2a7ad2eb6e reassigning to cnd to deal with the other reports 1) java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(System.java:0) at org.netbeans.editor.DocumentContent.copySpanChars(DocumentContent.java:280) at org.netbeans.editor.DocumentContent.getText(DocumentContent.java:185) at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:169) at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:757) at org.netbeans.modules.cnd.modelimpl.platform.FileBufferDoc.getInputStream(FileBufferDoc.java:143) 2) java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(System.java:0) at org.netbeans.editor.DocumentContent.copySpanChars(DocumentContent.java:280) at org.netbeans.editor.DocumentContent.getText(DocumentContent.java:185) at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:169) at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:757) at org.netbeans.modules.cnd.editor.parser.CppFile.startParsing(CppFile.java:165) at org.netbeans.modules.cnd.editor.parser.CppFile.startParsing(CppFile.java:136) at org.netbeans.modules.cnd.editor.parser.CppMetaModel$2.run(CppMetaModel.java:176) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) fixed: http://hg.netbeans.org/cnd-main?cmd=changeset;node=1c28d503a1c9 http://hg.netbeans.org/cnd-main?cmd=changeset;node=3ba40c01291a Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1c28d503a1c9 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixing IZ#159167: ArrayIndexOutOfBoundsException at java.lang.System.arraycopy Integrated into 'main-golden', will be available in build *200909211401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4e2a7ad2eb6e User: Ondrej Vrabec <ovrabec@netbeans.org> Log: #159167 - ArrayIndexOutOfBoundsException at java.lang.System.arraycopy getting document contents under a read lock |