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

Bug 336517

Summary: UnixFileNatives.readlink() doesn't work on AIX PPC platform
Product: [Eclipse Project] Platform Reporter: Jinghua Feng <fengj>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov
Version: 4.1   
Target Milestone: ---   
Hardware: Other   
OS: other   
Whiteboard:

Description Jinghua Feng CLA 2011-02-07 10:09:37 EST
Build Identifier: eclipse-SDK-I20100608-0911-aix-motif

Hi,
We experienced a few StringIndexOutOfBoundsException when running eclipse-Automated-Tests (3.6) with IBM latest Java 6 release on AIX PPC-32 platform. The exceptions and stack trace are as following:
java.lang.StringIndexOutOfBoundsException at java.lang.String.<init>(String.java:244) at org.eclipse.core.internal.filesystem.local.Convert.fromPlatformBytes(Convert.java:85) at org.eclipse.core.internal.filesystem.local.unix.UnixFileNatives.bytesToFileName(UnixFileNatives.java:170) 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) at org.eclipse.core.filesystem.provider.FileStore.fetchInfo(FileStore.java:277) at org.eclipse.core.tests.filesystem.SymlinkTest.fetchFileInfos(SymlinkTest.java:64) at org.eclipse.core.tests.filesystem.SymlinkTest.makeLinkStructure(SymlinkTest.java:87) at org.eclipse.core.tests.filesystem.SymlinkTest.testBrokenSymlinkAttributes(SymlinkTest.java:111) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:376) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:209) at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35) at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) at org.eclipse.core.launcher.Main.main(Main.java:34) 

These exception also were seen from following Java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap3260sr9-20101125_01(SR9))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr9-20101124_69295 (JIT enabled, AOT enabled)
J9VM - 20101124_069295
JIT  - r9_20101028_17488ifx2
GC   - 20101027_AA)
JCL  - 20101119_01
My observation is that native method readlink(name, target, target.length)  in \org.eclipse.core.filesystem\src\org\eclipse\core\internal\filesystem\local\unix\UnixFileNatives.java returns a big number instead of the actual length of file name. When this big number was passed to construct a new string using "return new String(source, 0, length, defaultEncoding);", a StringIndexOutOfBoundsException is thrown. The code snippet in question is as following:
int length = readlink(name, target, target.length); 
if (length > 0) info.setStringAttribute(EFS.ATTRIBUTE_LINK_TARGET, bytesToFileName(target, length)); 
I suspect UnixFileNatives\readlink doesn't work as expect on AIX PPC platform. Could you check if this is the case?
Thanks.

Reproducible: Always

Steps to Reproduce:
run eclipse-Automated-Tests-3.6 with eclipse-SDK-I20100608-0911-aix-motif.zip and IBM JDK 6.0 (AIX/PPC32) such as 6.0 Service Refresh 9 (AIX / PPC32) (pap3260sr9-20101125_01) (J9)
Comment 1 Lars Vogel CLA 2019-09-24 13:59:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Alexander Kurtakov CLA 2019-10-23 02:27:09 EDT
AIX is not supported for years now.