Code Monkey home page Code Monkey logo

Comments (8)

keithc-ca avatar keithc-ca commented on July 20, 2024 1

I think the root of the problem here is in SystemLookup.java because jdkLibraryPath("syslookup") is answering ${java.home}/bin/libsyslookup.so when, on AIX, os.name=Windows. I suggest this would be solved by replacing the two uses of Utils.IS_WINDOWS with OperatingSystem.isWindows().

I'll create a pull request to validate that.

from openj9.

pshipton avatar pshipton commented on July 20, 2024

@ChengJin01 did ibmruntimes/openj9-openjdk-jdk21#159 break AIX?

from openj9.

pshipton avatar pshipton commented on July 20, 2024

jdk22 as well https://openj9-jenkins.osuosl.org/job/Test_openjdk22_j9_sanity.openjdk_ppc64_aix_Nightly/73
ibmruntimes/openj9-openjdk-jdk22#61

from openj9.

ChengJin01 avatar ChengJin01 commented on July 20, 2024

The failing test at https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/openj9/test/jdk/java/foreign/TestFallbackLookup.java is intended to verify whether an exception is triggered by loading a non-existent ucrtbase.dll on Winfdows:

public class TestFallbackLookup {
    @Test
    void testBadSystemLookupRequest() {
        // we request a Linker, forcing OS name to be "Windows". This should trigger an exception when
        // attempting to load a non-existent ucrtbase.dll. Make sure that no error is generated at this stage.
        assertTrue(Linker.nativeLinker().defaultLookup().find("nonExistentSymbol").isEmpty()); <------
    }
}

in which NullPointerException came from getInlinedFunctListAddr() added in ibmruntimes/openj9-openjdk-jdk21#159 which should never fail at

    private static MemorySegment getInlinedFunctListAddr() {
...
        SymbolLookup funcsLibLookup = libLookup(libs -> libs.load(jdkLibraryPath("syslookup")));

given https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/openj9/closed/src/java.base/aix/native/libsyslookup/syslookup.c exists out there (unless libsyslookup.so was not generated in compilation). I will need to investigate to see what really happened in there.

from openj9.

ChengJin01 avatar ChengJin01 commented on July 20, 2024

I think the problem came from the option -Dos.name=Windows specified at https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/openj9/test/jdk/java/foreign/TestFallbackLookup.java:

/*
 * @test
 * @enablePreview
 * @requires jdk.foreign.linker != "UNSUPPORTED"
 * @run testng/othervm -Dos.name=Windows --enable-native-access=ALL-UNNAMED TestFallbackLookup
 */

which is intended to verify the unexpected behavior if the os.name changes to Windows in which case it skips OperatingSystem.isAix() without checking System.getProperty("os.name") in getInlinedFunctListAddr() , which ended up with a null value when loading libsyslookup.so via libLookup(), which means we have to restore Utils.IS_AIX and Utils.IS_ZOS back in the code to prevent such abnormal situation.

FYI: @keithc-ca

from openj9.

keithc-ca avatar keithc-ca commented on July 20, 2024

I'd rather see a solution that doesn't involve making changes to Utils.

from openj9.

ChengJin01 avatar ChengJin01 commented on July 20, 2024

I'd rather see a solution that doesn't involve making changes to Utils.

There is no easy way around this situation given the problem essentially comes from the inconsistency between the platform property specified in OperatingSystem and system property os.name unless we are able to consolidate both of them in dealing with this platform specific case (which is out of scope with this issue).

from openj9.

ChengJin01 avatar ChengJin01 commented on July 20, 2024

Close the issue as resolved.

from openj9.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.