Community
Participate
Working Groups
Build Identifier: 20100617-1415 (Helios Release) After having created a new project and imported the C sources, Eclipse gives the following error: An internal error occurred during: "Refreshing workspace". when trying to navigate the source tree. Reproducible: Always Steps to Reproduce: Tried to import some existing C/C++ project with a Makefile (e.g. E-UAE tarball and PUAE sources pulled from GIT). 1. Download http://www.rcdrummond.net/uae/e-uae-0.8.29-WIP4/e-uae-0.8.29-WIP4.tar.bz2 2. Decompress it somewhere and create a new project in Eclipse 3. Right click on project -> Import -> Existing code as Makefile project and select root directory of E-UAE sources 4. Eclipse error: An internal error occurred during: "Refreshing workspace". with stacktrace in the Details section above.
Created attachment 179686 [details] Eclipse stacktrace
The exception is raised by the file-system: Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -258403790 at java.lang.String.checkBounds(String.java:368) at java.lang.String.<init>(String.java:457) at org.eclipse.core.internal.filesystem.local.unix.UnixFileNatives.bytesToFileName(UnixFileNatives.java:169) at org.eclipse.core.internal.filesystem.local.unix.UnixFileNatives.fetchFileInfo(UnixFileNatives.java:83) at org.eclipse.core.internal.filesystem.local.LocalFileNativesManager.fetchFileInfo(LocalFileNativesManager.java:31) at org.eclipse.core.internal.filesystem.local.LocalFile.fetchInfo(LocalFile.java:144)
Created attachment 180066 [details] Possible patch v.0.1 Possible solution for the bug. The exception is thrown from a method that seems to be platform dependent (I can't see such method in Sun/Oracle java.lang.String). For Sun/Oracle implementation of java.lang.String the same exception could be thrown if (length > data.length - start) that means if you try to read more chars than it is available in the array. Tracing back the cause you will see that this could happen if the length returned from readlink(name, target, target.length) is bigger than length of the array target. The readlink method is a native method that wraps equivalent unix method but instead of passing the length of the array to this the method it uses PATH_MAX. This is not good because the value is hardcoded with the value appropriate for the OS where the compiler was run while the size of the array is set as PATH_MAX with the value taken directly from the OS running the code.
I made a mistake - there is checkBounds method in Sun/Oracle java implementation but it is not part of API.
Moving to 3.8.
I have never been able to reproduce it. Marking WORKSFORME. Please reopen if you see this again or can provide reproducible steps.