Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314275 - Exception in thread "ErrorReader" java.lang.ArrayIndexOutOfBoundsException
Summary: Exception in thread "ErrorReader" java.lang.ArrayIndexOutOfBoundsException
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 10:00 EDT by Jens Seidel CLA
Modified: 2010-05-28 11:34 EDT (History)
1 user (show)

See Also:


Attachments
patch (975 bytes, patch)
2010-05-25 10:32 EDT, Elena Laskavaia CLA
no flags Details | Diff
correct patch (872 bytes, patch)
2010-05-25 20:16 EDT, Elena Laskavaia CLA
cdtdoug: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Seidel CLA 2010-05-25 10:00:52 EDT
Build Identifier: I20100513-1500

During compilation of a managed C++ project I got on the console:

Exception in thread "ErrorReader" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.eclipse.cdt.utils.spawner.SpawnerInputStream.read(SpawnerInputStream.java:71)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.BufferedReader.readLine(BufferedReader.java:379)
        at org.eclipse.cdt.internal.core.ProcessClosure$ReaderThread.run(ProcessClosure.java:53)


Reproducible: Didn't try
Comment 1 Elena Laskavaia CLA 2010-05-25 10:32:14 EDT
Created attachment 169839 [details]
patch

Either I am crazy or this method never worked properly for offset > 0.
Can somebody review the patch?
Comment 2 Elena Laskavaia CLA 2010-05-25 20:16:10 EDT
Created attachment 169919 [details]
correct patch

Misunderstood what "offset" means in this function. Corrected.
Comment 3 Elena Laskavaia CLA 2010-05-25 20:24:14 EDT
It was set as found in 6.0 but I checked 6.0 branch and it does not have this problem, so I set it to 7.0

Fixed
Comment 4 Anton Leherbauer CLA 2010-05-27 06:42:43 EDT
Mea culpa.  What a silly bug.
Thanks for fixing, Elena!