Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314275

Summary: Exception in thread "ErrorReader" java.lang.ArrayIndexOutOfBoundsException
Product: [Tools] CDT Reporter: Jens Seidel <jensseidel>
Component: cdt-coreAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Doug Schaefer <cdtdoug>
Severity: normal    
Priority: P3 CC: aleherb+eclipse
Version: 7.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch
none
correct patch cdtdoug: iplog-

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!