From varming at gmail.com Mon Apr 11 18:06:17 2016 From: varming at gmail.com (Carsten Varming) Date: Mon, 11 Apr 2016 14:06:17 -0400 Subject: Status of jtreg build Message-ID: Dear jtreg devs, I wanted to download jtreg to run JDK9 hotspot regression tests, but I have been unsuccessful so far. Perhaps you know what I need to do to get going. The hotspot regression tests need at least jtreg 4.2 b01. When I downloaded the latest build published at https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from build 496) and tried the hotspot regression tests I got: Error: Unexpected exception occurred! java.lang.NumberFormatException: For input string: "ip" java.lang.NumberFormatException: For input string: "ip" at java.lang.NumberFormatException.forInputString(java.base at 9-internal /NumberFormatException.java:65) at java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) at java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) at com.sun.javatest.regtest.Version.getBuild(Version.java:186) at com.sun.javatest.regtest.Version.compareTo(Version.java:168) at com.sun.javatest.regtest.Main.run(Main.java:1091) at com.sun.javatest.regtest.Main.run(Main.java:1037) at com.sun.javatest.regtest.Main.main(Main.java:951) I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT ( http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java sets Version.build to "tip" and Version.getBuild tries to parse "ip" as a number. :( I tried to get past this problem by changing the required jtreg version to 4.1 b01. That gets the tests running, but a third of them fail with a class loading problem: A ClassFormatError is thrown with "Truncated class file". This seems to be due to a missing java/lang/reflect/JTRegModuleHelper.class. I suspect that this requirement was introduced with the module system that was integrated a few weeks ago. So, how do I get a version of jtreg that works with the latest JDK9? BTW. It looks like the jtreg build ( https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because of a missing dependency on testng. Help much appreaciated, Carsten -------------- next part -------------- An HTML attachment was scrubbed... URL: From volker.simonis at gmail.com Tue Apr 12 06:57:27 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Tue, 12 Apr 2016 08:57:27 +0200 Subject: Status of jtreg build In-Reply-To: References: Message-ID: You can build it yourself :) I've done it last week and everything works smoothly with the new version. The build requires some dependencies though - so here's my setup: I have everything under /share/software/Java/JTREG_from_source/ and a jdk 1.8 in the PATH cd /share/software/Java/JTREG_from_source/ mkdir deps hg clone http://hg.openjdk.java.net/code-tools/asmtools cd asmtools/build ant -Dbuild.root=/share/software/Java/JTREG_from_source/deps -Dbuildprod.root=/share/software/Java/JTREG_from_source/deps this will create /share/software/Java/JTREG_from_source/deps/asmtools-6.0-build/release cd /share/software/Java/JTREG_from_source/deps Download all the other required dependencies (you can find them all with google): drwxr-xr-x 6 simonis simonis 4096 Jul 8 2013 apache-ant-1.9.2 -rw-rw-r-- 1 simonis simonis 5512093 Dec 9 2013 apache-ant-1.9.2-bin.tar.gz drwxrwxr-x 6 simonis simonis 4096 Jun 23 2015 asmtools-6.0-build -rw-rw-r-- 1 simonis simonis 8388898 Dec 9 2013 javahelp2_0_05.zip drwxr-xr-x 5 simonis simonis 4096 Sep 19 2007 jh2.0 drwxrwxr-x 6 simonis simonis 4096 Dec 9 2013 jtharness-4_4_1-MR1-bin-b13-20_dec_2011 -rw-rw-r-- 1 simonis simonis 12324635 Dec 9 2013 jtharness-4_4_1-MR1-bin-b13-20_dec_2011.zip -rw-rw-r-- 1 simonis simonis 253160 Dec 10 2013 junit-4.10.jar drwxr-xr-x 9 simonis simonis 4096 Oct 3 2012 testng-6.8 -rw-rw-r-- 1 simonis simonis 11550802 Dec 9 2013 testng-6.8.zip drwxrwxr-x 4 simonis simonis 4096 Nov 22 2007 xalan-j_2_7_1 -rw-rw-r-- 1 simonis simonis 17336979 Dec 9 2013 xalan-j_2_7_1-bin.zip You also need a jdk 1.6 somewhere. Now clone jtreg and build: cd /share/software/Java/JTREG_from_source/ hg clone http://hg.openjdk.java.net/code-tools/jtreg cd jtreg JDK15HOME=/share/software/Java/jdk1.6.0_26 ASMTOOLS_HOME=/share/software/Java/JTREG_from_source/deps/asmtools-6.0-build/release JAVAHELP_HOME=/share/software/Java/JTREG_from_source/deps/jh2.0/javahelp JTHARNESS_HOME=/share/software/Java/JTREG_from_source/deps/jtharness-4_4_1-MR1-bin-b13-20_dec_2011 XALANHOME=/share/software/Java/JTREG_from_source/deps/xalan-j_2_7_1 TESTNG_HOME=/share/software/Java/JTREG_from_source/deps/testng-6.8 JUNIT_JAR=/share/software/Java/JTREG_from_source/deps/junit-4.10.jar TESTNG_JAR=/share/software/Java/JTREG_from_source/deps/testng-6.8/testng-6.8.jar ANTHOME=/share/software/Java/JTREG_from_source/deps/apache-ant-1.9.2 make -C make BUILD_NUMBER=b01 This will create a new jtreg image under /share/software/Java/JTREG_from_source/jtreg/build/images/jtreg ./build/images/jtreg/bin/jtreg -version jtreg, version 4.2 dev b01 Installed in /share/software/Java/JTREG_from_source/jtreg/build/images/jtreg/lib/jtreg.jar Running on platform version 1.7.0_51 from /share/software/Java/jdk1.7.0_51/jre. Built with Java(TM) 2 SDK, Version 1.6.0_26-b03 on March 30, 2016. Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. TestNG: version 6.8-201210030754 Hope this helps, Volker On Mon, Apr 11, 2016 at 8:06 PM, Carsten Varming wrote: > Dear jtreg devs, > > I wanted to download jtreg to run JDK9 hotspot regression tests, but I > have been unsuccessful so far. Perhaps you know what I need to do to get > going. > > The hotspot regression tests need at least jtreg 4.2 b01. When I > downloaded the latest build published at > https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from build > 496) and tried the hotspot regression tests I got: > > Error: Unexpected exception occurred! java.lang.NumberFormatException: For > input string: "ip" > java.lang.NumberFormatException: For input string: "ip" > at > java.lang.NumberFormatException.forInputString(java.base at 9-internal > /NumberFormatException.java:65) > at java.lang.Integer.parseInt(java.base at 9-internal > /Integer.java:695) > at java.lang.Integer.parseInt(java.base at 9-internal > /Integer.java:813) > at com.sun.javatest.regtest.Version.getBuild(Version.java:186) > at com.sun.javatest.regtest.Version.compareTo(Version.java:168) > at com.sun.javatest.regtest.Main.run(Main.java:1091) > at com.sun.javatest.regtest.Main.run(Main.java:1037) > at com.sun.javatest.regtest.Main.main(Main.java:951) > > I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT ( > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) > went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in > http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java > sets Version.build to "tip" and Version.getBuild tries to parse "ip" as a > number. :( > > I tried to get past this problem by changing the required jtreg version to > 4.1 b01. That gets the tests running, but a third of them fail with a class > loading problem: A ClassFormatError is thrown with "Truncated class file". > This seems to be due to a > missing java/lang/reflect/JTRegModuleHelper.class. I suspect that this > requirement was introduced with the module system that was integrated a few > weeks ago. > > So, how do I get a version of jtreg that works with the latest JDK9? > > BTW. It looks like the jtreg build ( > https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because of > a missing dependency on testng. > > Help much appreaciated, > Carsten > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.gibbons at oracle.com Tue Apr 12 21:11:38 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 12 Apr 2016 14:11:38 -0700 Subject: Status of jtreg build In-Reply-To: References: Message-ID: <570D648A.5020301@oracle.com> On 04/11/2016 11:06 AM, Carsten Varming wrote: > Dear jtreg devs, > > I wanted to download jtreg to run JDK9 hotspot regression tests, but I > have been unsuccessful so far. Perhaps you know what I need to do to > get going. > > The hotspot regression tests need at least jtreg 4.2 b01. When I > downloaded the latest build published at > https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from > build 496) and tried the hotspot regression tests I got: > > Error: Unexpected exception occurred! java.lang.NumberFormatException: > For input string: "ip" > java.lang.NumberFormatException: For input string: "ip" > at > java.lang.NumberFormatException.forInputString(java.base at 9-internal/NumberFormatException.java:65) > at > java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) > at > java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) > at com.sun.javatest.regtest.Version.getBuild(Version.java:186) > at com.sun.javatest.regtest.Version.compareTo(Version.java:168) > at com.sun.javatest.regtest.Main.run(Main.java:1091) > at com.sun.javatest.regtest.Main.run(Main.java:1037) > at com.sun.javatest.regtest.Main.main(Main.java:951) > > I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT > (http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) > went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" > in > http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java > sets Version.build to "tip" and Version.getBuild tries to parse "ip" > as a number. :( > > I tried to get past this problem by changing the required jtreg > version to 4.1 b01. That gets the tests running, but a third of them > fail with a class loading problem: A ClassFormatError is thrown with > "Truncated class file". This seems to be due to a > missing java/lang/reflect/JTRegModuleHelper.class. I suspect that this > requirement was introduced with the module system that was integrated > a few weeks ago. > > So, how do I get a version of jtreg that works with the latest JDK9? > > BTW. It looks like the jtreg build > (https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because > of a missing dependency on testng. > > Help much appreaciated, > Carsten The version of jtreg available on cloudbees.com has the following entry in its MANIFEST.MF, jtreg-Build: tip and jtreg is naively assuming it to be of the form jtreg-Build: b I can make jtreg be more tolerant, but I also also note that the binary is missing lib/asmtools.jar, which is required by some tests. The contents of the tar bundle are all dated 25 January 2016, 10:47 which is somewhat suspicious. -- Jon From martinrb at google.com Tue Apr 12 21:28:11 2016 From: martinrb at google.com (Martin Buchholz) Date: Tue, 12 Apr 2016 14:28:11 -0700 Subject: Status of jtreg build In-Reply-To: <570D648A.5020301@oracle.com> References: <570D648A.5020301@oracle.com> Message-ID: jtreg build on https://adopt-openjdk.ci.cloudbees.com/ is broken, as is its dependency asmtools The jtreg-4.2 build they advertise was created before there was any 4.2 tag. They seem to be missing testng as a dependency. The project does keep trying (and failing) to build, however. I tried and failed to find on the Net the "full" testng-6.8.zip that used to be distributed on testng.org. On Tue, Apr 12, 2016 at 2:11 PM, Jonathan Gibbons wrote: > > > On 04/11/2016 11:06 AM, Carsten Varming wrote: >> >> Dear jtreg devs, >> >> I wanted to download jtreg to run JDK9 hotspot regression tests, but I >> have been unsuccessful so far. Perhaps you know what I need to do to get >> going. >> >> The hotspot regression tests need at least jtreg 4.2 b01. When I >> downloaded the latest build published at >> https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from build >> 496) and tried the hotspot regression tests I got: >> >> Error: Unexpected exception occurred! java.lang.NumberFormatException: For >> input string: "ip" >> java.lang.NumberFormatException: For input string: "ip" >> at >> java.lang.NumberFormatException.forInputString(java.base at 9-internal/NumberFormatException.java:65) >> at >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) >> at >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) >> at com.sun.javatest.regtest.Version.getBuild(Version.java:186) >> at com.sun.javatest.regtest.Version.compareTo(Version.java:168) >> at com.sun.javatest.regtest.Main.run(Main.java:1091) >> at com.sun.javatest.regtest.Main.run(Main.java:1037) >> at com.sun.javatest.regtest.Main.main(Main.java:951) >> >> I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT >> (http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) >> went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in >> http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java >> sets Version.build to "tip" and Version.getBuild tries to parse "ip" as a >> number. :( >> >> I tried to get past this problem by changing the required jtreg version to >> 4.1 b01. That gets the tests running, but a third of them fail with a class >> loading problem: A ClassFormatError is thrown with "Truncated class file". >> This seems to be due to a missing java/lang/reflect/JTRegModuleHelper.class. >> I suspect that this requirement was introduced with the module system that >> was integrated a few weeks ago. >> >> So, how do I get a version of jtreg that works with the latest JDK9? >> >> BTW. It looks like the jtreg build >> (https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because of a >> missing dependency on testng. >> >> Help much appreaciated, >> Carsten > > > The version of jtreg available on cloudbees.com has the following entry in > its MANIFEST.MF, > > jtreg-Build: tip > > and jtreg is naively assuming it to be of the form > jtreg-Build: b > > I can make jtreg be more tolerant, but I also also note that the binary is > missing lib/asmtools.jar, which is required by some tests. The contents of > the tar bundle are all dated 25 January 2016, 10:47 which is somewhat > suspicious. > > -- Jon From volker.simonis at gmail.com Wed Apr 13 06:53:31 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Wed, 13 Apr 2016 08:53:31 +0200 Subject: Status of jtreg build In-Reply-To: References: <570D648A.5020301@oracle.com> Message-ID: On Tue, Apr 12, 2016 at 11:28 PM, Martin Buchholz wrote: > jtreg build on > https://adopt-openjdk.ci.cloudbees.com/ > is broken, as is its dependency asmtools > The jtreg-4.2 build they advertise was created before there was any 4.2 > tag. > They seem to be missing testng as a dependency. > The project does keep trying (and failing) to build, however. > > I tried and failed to find on the Net the "full" testng-6.8.zip that > used to be distributed on testng.org. > > That seems true, but I think all you needed from the "full" testng-6.8.zip was the LICENSE file. See jtreg/make/jtreg.gmk $(JTREG_IMAGEDIR)/legal/testng/LICENSE.txt: $(call PosixPath,$(TESTNG_HOME)/LICENSE.txt) $(MKDIR) -p $(@D) $(CAT) $(TESTNG_HOME)/LICENSE.txt >> $@ The testng jar file is specified by TESTNG_JAR anyway. So I think you can download the jar from http://mvnrepository.com/artifact/org.testng/testng/6.8 or http://mvnrepository.com/artifact/org.testng/testng/6.8.5 because http://openjdk.java.net/jtreg/build.html now recommends 6.8.5 and get the license file from: https://github.com/cbeust/testng > On Tue, Apr 12, 2016 at 2:11 PM, Jonathan Gibbons > wrote: > > > > > > On 04/11/2016 11:06 AM, Carsten Varming wrote: > >> > >> Dear jtreg devs, > >> > >> I wanted to download jtreg to run JDK9 hotspot regression tests, but I > >> have been unsuccessful so far. Perhaps you know what I need to do to get > >> going. > >> > >> The hotspot regression tests need at least jtreg 4.2 b01. When I > >> downloaded the latest build published at > >> https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from > build > >> 496) and tried the hotspot regression tests I got: > >> > >> Error: Unexpected exception occurred! java.lang.NumberFormatException: > For > >> input string: "ip" > >> java.lang.NumberFormatException: For input string: "ip" > >> at > >> java.lang.NumberFormatException.forInputString(java.base at 9-internal > /NumberFormatException.java:65) > >> at > >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) > >> at > >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) > >> at com.sun.javatest.regtest.Version.getBuild(Version.java:186) > >> at com.sun.javatest.regtest.Version.compareTo(Version.java:168) > >> at com.sun.javatest.regtest.Main.run(Main.java:1091) > >> at com.sun.javatest.regtest.Main.run(Main.java:1037) > >> at com.sun.javatest.regtest.Main.main(Main.java:951) > >> > >> I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT > >> ( > http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT > ) > >> went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in > >> > http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java > >> sets Version.build to "tip" and Version.getBuild tries to parse "ip" as > a > >> number. :( > >> > >> I tried to get past this problem by changing the required jtreg version > to > >> 4.1 b01. That gets the tests running, but a third of them fail with a > class > >> loading problem: A ClassFormatError is thrown with "Truncated class > file". > >> This seems to be due to a missing > java/lang/reflect/JTRegModuleHelper.class. > >> I suspect that this requirement was introduced with the module system > that > >> was integrated a few weeks ago. > >> > >> So, how do I get a version of jtreg that works with the latest JDK9? > >> > >> BTW. It looks like the jtreg build > >> (https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because > of a > >> missing dependency on testng. > >> > >> Help much appreaciated, > >> Carsten > > > > > > The version of jtreg available on cloudbees.com has the following entry > in > > its MANIFEST.MF, > > > > jtreg-Build: tip > > > > and jtreg is naively assuming it to be of the form > > jtreg-Build: b > > > > I can make jtreg be more tolerant, but I also also note that the binary > is > > missing lib/asmtools.jar, which is required by some tests. The contents > of > > the tar bundle are all dated 25 January 2016, 10:47 which is somewhat > > suspicious. > > > > -- Jon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinrb at google.com Wed Apr 13 15:26:01 2016 From: martinrb at google.com (Martin Buchholz) Date: Wed, 13 Apr 2016 08:26:01 -0700 Subject: Status of jtreg build In-Reply-To: References: <570D648A.5020301@oracle.com> Message-ID: Maven likes to have as many jar files as possible, so jcommander and testng are separated. But jtreg thinks testng.jar should contain jcommander, so I ended up having to build testng-jar-all (jtreg should probably switch to maven's view of the world and take jcommander as another dependency) Hacky build script snippet: # --- testng --- # Build "fat" testng.jar (incorporating jcommander) from source. # No one seems to distribute such fat testng jars anymore. rm -rf testng testng-* wget -qOtestng.zip https://github.com/cbeust/testng/archive/testng-6.8.5.zip unzip -q testng.zip rm testng.zip mv testng-* testng ( export JAVA_HOME="$HOME/jdk/jdk6" export PATH=$JAVA_HOME/bin:$PATH cd testng && mkdir -p ~/.ant/lib && cp ivy-2.1.0.jar ~/.ant/lib/. && ant clean compile copy-resources testng-jar-all && rm ~/.ant/lib/ivy-2.1.0.jar ) TESTNG_HOME="$ROOT/testng" TESTNG_JAR=$(find "$ROOT/testng/target/" -name "testng*jar") On Tue, Apr 12, 2016 at 11:53 PM, Volker Simonis wrote: > > > On Tue, Apr 12, 2016 at 11:28 PM, Martin Buchholz > wrote: >> >> jtreg build on >> https://adopt-openjdk.ci.cloudbees.com/ >> is broken, as is its dependency asmtools >> The jtreg-4.2 build they advertise was created before there was any 4.2 >> tag. >> They seem to be missing testng as a dependency. >> The project does keep trying (and failing) to build, however. >> >> I tried and failed to find on the Net the "full" testng-6.8.zip that >> used to be distributed on testng.org. >> > > That seems true, but I think all you needed from the "full" testng-6.8.zip > was the LICENSE file. See jtreg/make/jtreg.gmk > > $(JTREG_IMAGEDIR)/legal/testng/LICENSE.txt: $(call > PosixPath,$(TESTNG_HOME)/LICENSE.txt) > $(MKDIR) -p $(@D) > $(CAT) $(TESTNG_HOME)/LICENSE.txt >> $@ > > The testng jar file is specified by TESTNG_JAR anyway. So I think you can > download the jar from > > http://mvnrepository.com/artifact/org.testng/testng/6.8 or > http://mvnrepository.com/artifact/org.testng/testng/6.8.5 > > because http://openjdk.java.net/jtreg/build.html now recommends 6.8.5 and > get the license file from: > > https://github.com/cbeust/testng > >> >> On Tue, Apr 12, 2016 at 2:11 PM, Jonathan Gibbons >> wrote: >> > >> > >> > On 04/11/2016 11:06 AM, Carsten Varming wrote: >> >> >> >> Dear jtreg devs, >> >> >> >> I wanted to download jtreg to run JDK9 hotspot regression tests, but I >> >> have been unsuccessful so far. Perhaps you know what I need to do to >> >> get >> >> going. >> >> >> >> The hotspot regression tests need at least jtreg 4.2 b01. When I >> >> downloaded the latest build published at >> >> https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from >> >> build >> >> 496) and tried the hotspot regression tests I got: >> >> >> >> Error: Unexpected exception occurred! java.lang.NumberFormatException: >> >> For >> >> input string: "ip" >> >> java.lang.NumberFormatException: For input string: "ip" >> >> at >> >> >> >> java.lang.NumberFormatException.forInputString(java.base at 9-internal/NumberFormatException.java:65) >> >> at >> >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) >> >> at >> >> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) >> >> at com.sun.javatest.regtest.Version.getBuild(Version.java:186) >> >> at com.sun.javatest.regtest.Version.compareTo(Version.java:168) >> >> at com.sun.javatest.regtest.Main.run(Main.java:1091) >> >> at com.sun.javatest.regtest.Main.run(Main.java:1037) >> >> at com.sun.javatest.regtest.Main.main(Main.java:951) >> >> >> >> I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT >> >> >> >> (http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) >> >> went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in >> >> >> >> http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java >> >> sets Version.build to "tip" and Version.getBuild tries to parse "ip" as >> >> a >> >> number. :( >> >> >> >> I tried to get past this problem by changing the required jtreg version >> >> to >> >> 4.1 b01. That gets the tests running, but a third of them fail with a >> >> class >> >> loading problem: A ClassFormatError is thrown with "Truncated class >> >> file". >> >> This seems to be due to a missing >> >> java/lang/reflect/JTRegModuleHelper.class. >> >> I suspect that this requirement was introduced with the module system >> >> that >> >> was integrated a few weeks ago. >> >> >> >> So, how do I get a version of jtreg that works with the latest JDK9? >> >> >> >> BTW. It looks like the jtreg build >> >> (https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because >> >> of a >> >> missing dependency on testng. >> >> >> >> Help much appreaciated, >> >> Carsten >> > >> > >> > The version of jtreg available on cloudbees.com has the following entry >> > in >> > its MANIFEST.MF, >> > >> > jtreg-Build: tip >> > >> > and jtreg is naively assuming it to be of the form >> > jtreg-Build: b >> > >> > I can make jtreg be more tolerant, but I also also note that the binary >> > is >> > missing lib/asmtools.jar, which is required by some tests. The contents >> > of >> > the tar bundle are all dated 25 January 2016, 10:47 which is somewhat >> > suspicious. >> > >> > -- Jon > > From jonathan.gibbons at oracle.com Wed Apr 13 15:49:13 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 13 Apr 2016 08:49:13 -0700 Subject: Status of jtreg build In-Reply-To: References: <570D648A.5020301@oracle.com> Message-ID: <570E6A79.8050701@oracle.com> Well, that part of the jtreg build system was written when TestNG came as a single jar and predates its Mavenisation. jtreg would probably work if you had separate jcommander.jar and testng.jar and put jcommander.jar on the Class-Path in the testng.jar manifest. Hmm, that may not work for those tests (like some of the streams tests) which need testng.jar on th bootclasspath. (IIRC, Class-Path is not honored for jars on the bcp.) -- Jon On 04/13/2016 08:26 AM, Martin Buchholz wrote: > Maven likes to have as many jar files as possible, so jcommander and > testng are separated. > But jtreg thinks testng.jar should contain jcommander, so I ended up > having to build testng-jar-all > > (jtreg should probably switch to maven's view of the world and take > jcommander as another dependency) > > Hacky build script snippet: > > # --- testng --- > # Build "fat" testng.jar (incorporating jcommander) from source. > # No one seems to distribute such fat testng jars anymore. > rm -rf testng testng-* > wget -qOtestng.zip https://github.com/cbeust/testng/archive/testng-6.8.5.zip > unzip -q testng.zip > rm testng.zip > mv testng-* testng > ( > export JAVA_HOME="$HOME/jdk/jdk6" > export PATH=$JAVA_HOME/bin:$PATH > cd testng && > mkdir -p ~/.ant/lib && > cp ivy-2.1.0.jar ~/.ant/lib/. && > ant clean compile copy-resources testng-jar-all && > rm ~/.ant/lib/ivy-2.1.0.jar > ) > TESTNG_HOME="$ROOT/testng" > TESTNG_JAR=$(find "$ROOT/testng/target/" -name "testng*jar") > > On Tue, Apr 12, 2016 at 11:53 PM, Volker Simonis > wrote: >> >> On Tue, Apr 12, 2016 at 11:28 PM, Martin Buchholz >> wrote: >>> jtreg build on >>> https://adopt-openjdk.ci.cloudbees.com/ >>> is broken, as is its dependency asmtools >>> The jtreg-4.2 build they advertise was created before there was any 4.2 >>> tag. >>> They seem to be missing testng as a dependency. >>> The project does keep trying (and failing) to build, however. >>> >>> I tried and failed to find on the Net the "full" testng-6.8.zip that >>> used to be distributed on testng.org. >>> >> That seems true, but I think all you needed from the "full" testng-6.8.zip >> was the LICENSE file. See jtreg/make/jtreg.gmk >> >> $(JTREG_IMAGEDIR)/legal/testng/LICENSE.txt: $(call >> PosixPath,$(TESTNG_HOME)/LICENSE.txt) >> $(MKDIR) -p $(@D) >> $(CAT) $(TESTNG_HOME)/LICENSE.txt >> $@ >> >> The testng jar file is specified by TESTNG_JAR anyway. So I think you can >> download the jar from >> >> http://mvnrepository.com/artifact/org.testng/testng/6.8 or >> http://mvnrepository.com/artifact/org.testng/testng/6.8.5 >> >> because http://openjdk.java.net/jtreg/build.html now recommends 6.8.5 and >> get the license file from: >> >> https://github.com/cbeust/testng >> >>> On Tue, Apr 12, 2016 at 2:11 PM, Jonathan Gibbons >>> wrote: >>>> >>>> On 04/11/2016 11:06 AM, Carsten Varming wrote: >>>>> Dear jtreg devs, >>>>> >>>>> I wanted to download jtreg to run JDK9 hotspot regression tests, but I >>>>> have been unsuccessful so far. Perhaps you know what I need to do to >>>>> get >>>>> going. >>>>> >>>>> The hotspot regression tests need at least jtreg 4.2 b01. When I >>>>> downloaded the latest build published at >>>>> https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ (4.2.0-tip, from >>>>> build >>>>> 496) and tried the hotspot regression tests I got: >>>>> >>>>> Error: Unexpected exception occurred! java.lang.NumberFormatException: >>>>> For >>>>> input string: "ip" >>>>> java.lang.NumberFormatException: For input string: "ip" >>>>> at >>>>> >>>>> java.lang.NumberFormatException.forInputString(java.base at 9-internal/NumberFormatException.java:65) >>>>> at >>>>> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:695) >>>>> at >>>>> java.lang.Integer.parseInt(java.base at 9-internal/Integer.java:813) >>>>> at com.sun.javatest.regtest.Version.getBuild(Version.java:186) >>>>> at com.sun.javatest.regtest.Version.compareTo(Version.java:168) >>>>> at com.sun.javatest.regtest.Main.run(Main.java:1091) >>>>> at com.sun.javatest.regtest.Main.run(Main.java:1037) >>>>> at com.sun.javatest.regtest.Main.main(Main.java:951) >>>>> >>>>> I suspect the check against "requiredVersion=4.2 b01" from TEST.ROOT >>>>> >>>>> (http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/1c08ca66db33/test/TEST.ROOT) >>>>> went wrong. I suspect "build = manifest.getProperty("jtreg-Build");" in >>>>> >>>>> http://hg.openjdk.java.net/code-tools/jtreg/file/6bfef17a03d5/src/share/classes/com/sun/javatest/regtest/Version.java >>>>> sets Version.build to "tip" and Version.getBuild tries to parse "ip" as >>>>> a >>>>> number. :( >>>>> >>>>> I tried to get past this problem by changing the required jtreg version >>>>> to >>>>> 4.1 b01. That gets the tests running, but a third of them fail with a >>>>> class >>>>> loading problem: A ClassFormatError is thrown with "Truncated class >>>>> file". >>>>> This seems to be due to a missing >>>>> java/lang/reflect/JTRegModuleHelper.class. >>>>> I suspect that this requirement was introduced with the module system >>>>> that >>>>> was integrated a few weeks ago. >>>>> >>>>> So, how do I get a version of jtreg that works with the latest JDK9? >>>>> >>>>> BTW. It looks like the jtreg build >>>>> (https://adopt-openjdk.ci.cloudbees.com/job/jtreg/) is failing because >>>>> of a >>>>> missing dependency on testng. >>>>> >>>>> Help much appreaciated, >>>>> Carsten >>>> >>>> The version of jtreg available on cloudbees.com has the following entry >>>> in >>>> its MANIFEST.MF, >>>> >>>> jtreg-Build: tip >>>> >>>> and jtreg is naively assuming it to be of the form >>>> jtreg-Build: b >>>> >>>> I can make jtreg be more tolerant, but I also also note that the binary >>>> is >>>> missing lib/asmtools.jar, which is required by some tests. The contents >>>> of >>>> the tar bundle are all dated 25 January 2016, 10:47 which is somewhat >>>> suspicious. >>>> >>>> -- Jon >> From alexander.kulyakhtin at oracle.com Fri Apr 15 14:29:04 2016 From: alexander.kulyakhtin at oracle.com (Alexander Kulyakhtin) Date: Fri, 15 Apr 2016 07:29:04 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? Message-ID: <1fe9afeb-c7c0-4909-a6b2-47aa761a414c@default> Hi, I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) In my test I have @compile MyTest.java @run main/othervm -agentlib:mylib MyTest I run the test with: jtreg -nativepath: MyTest However, it fails with: "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). However, for the -agentlib option, it does not help. Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? Thank you very much for your help. Best regards, Alexander From staffan.larsen at oracle.com Fri Apr 15 14:53:01 2016 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Fri, 15 Apr 2016 16:53:01 +0200 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <1fe9afeb-c7c0-4909-a6b2-47aa761a414c@default> References: <1fe9afeb-c7c0-4909-a6b2-47aa761a414c@default> Message-ID: <47D11364-0E2E-40D1-BC97-E3179DA05FCE@oracle.com> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. Staffan > On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: > > Hi, > > I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) > > In my test I have > > @compile MyTest.java > @run main/othervm -agentlib:mylib MyTest > > I run the test with: > > jtreg -nativepath: MyTest > > However, it fails with: > > "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" > > The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). > However, for the -agentlib option, it does not help. > > Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? > > Thank you very much for your help. > > Best regards, > Alexander > From alexander.kulyakhtin at oracle.com Fri Apr 15 15:19:37 2016 From: alexander.kulyakhtin at oracle.com (Alexander Kulyakhtin) Date: Fri, 15 Apr 2016 08:19:37 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? Message-ID: Hi Staffan, Thank you very much for your suggestion. I wanted to avoid that workaround, since the -agentpath parameter would require taking care of different file extensions for different platforms and of other things not directly related to the test. However, if that's the only option I'm going to do as you have suggested. Best regards, Alexander ----- Original Message ----- From: staffan.larsen at oracle.com To: alexander.kulyakhtin at oracle.com Cc: jtreg-use at openjdk.java.net, dmitry.fazunenko at oracle.com, aleksey.voytilov at oracle.com Sent: Friday, April 15, 2016 5:53:01 PM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. Staffan > On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: > > Hi, > > I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) > > In my test I have > > @compile MyTest.java > @run main/othervm -agentlib:mylib MyTest > > I run the test with: > > jtreg -nativepath: MyTest > > However, it fails with: > > "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" > > The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). > However, for the -agentlib option, it does not help. > > Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? > > Thank you very much for your help. > > Best regards, > Alexander > From jonathan.gibbons at oracle.com Fri Apr 15 15:41:32 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 15 Apr 2016 08:41:32 -0700 Subject: updating TestNG and JUnit for jtreg Message-ID: <57110BAC.7010909@oracle.com> This is a heads-up for those folk that build their own copy of jtreg, especially folk outside Oracle. We are looking up update jtreg and the tests such that they will require the following versions: TestNG 6.9.5 JUnit 4.10 This will allow tests to use newer API in TestNG, and will facilitate improved support for JUnit tests, using TestNG mixed mode. --- Separately, we know that the external builds on cloudbees are broken, and we are working to get that situation addressed. -- Jon From jonathan.gibbons at oracle.com Fri Apr 15 16:04:23 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 15 Apr 2016 09:04:23 -0700 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <47D11364-0E2E-40D1-BC97-E3179DA05FCE@oracle.com> References: <1fe9afeb-c7c0-4909-a6b2-47aa761a414c@default> <47D11364-0E2E-40D1-BC97-E3179DA05FCE@oracle.com> Message-ID: <57111107.9080602@oracle.com> jtreg should report the command it is trying to execute in the "rerun" section. If you execute that command directly, does it work? In other words, can you isolate the problem to jtreg or to the execution of the command that jtreg execs? -- Jon On 04/15/2016 07:53 AM, Staffan Larsen wrote: > I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. > > Staffan > >> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >> >> Hi, >> >> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >> >> In my test I have >> >> @compile MyTest.java >> @run main/othervm -agentlib:mylib MyTest >> >> I run the test with: >> >> jtreg -nativepath: MyTest >> >> However, it fails with: >> >> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >> >> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >> However, for the -agentlib option, it does not help. >> >> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >> >> Thank you very much for your help. >> >> Best regards, >> Alexander >> From alexander.kulyakhtin at oracle.com Mon Apr 18 11:53:40 2016 From: alexander.kulyakhtin at oracle.com (Alexander Kulyakhtin) Date: Mon, 18 Apr 2016 04:53:40 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? Message-ID: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> Jon, In the 'rerun' section I have: images/jdk/bin/java \\ ... -Dtest.nativepath=<...>images/test/hotspot/jtreg/native -Djava.library.path=<...>images/test/hotspot/jtreg/native -agentlib:TestGetModules ... While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. Therefore -agentlib does not know where to look for the library. The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. Best regards, Alexander ----- Original Message ----- From: jonathan.gibbons at oracle.com To: jtreg-use at openjdk.java.net Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? jtreg should report the command it is trying to execute in the "rerun" section. If you execute that command directly, does it work? In other words, can you isolate the problem to jtreg or to the execution of the command that jtreg execs? -- Jon On 04/15/2016 07:53 AM, Staffan Larsen wrote: > I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. > > Staffan > >> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >> >> Hi, >> >> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >> >> In my test I have >> >> @compile MyTest.java >> @run main/othervm -agentlib:mylib MyTest >> >> I run the test with: >> >> jtreg -nativepath: MyTest >> >> However, it fails with: >> >> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >> >> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >> However, for the -agentlib option, it does not help. >> >> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >> >> Thank you very much for your help. >> >> Best regards, >> Alexander >> From jonathan.gibbons at oracle.com Mon Apr 18 17:51:24 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 18 Apr 2016 10:51:24 -0700 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> Message-ID: <57151E9C.6030901@oracle.com> OK, thanks for clarifying. The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) -- Jon On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: > Jon, > > In the 'rerun' section I have: > > images/jdk/bin/java \\ > ... > -Dtest.nativepath=<...>images/test/hotspot/jtreg/native > -Djava.library.path=<...>images/test/hotspot/jtreg/native > -agentlib:TestGetModules > ... > > While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. > Therefore -agentlib does not know where to look for the library. > The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. > > Best regards, > Alexander > > ----- Original Message ----- > From: jonathan.gibbons at oracle.com > To: jtreg-use at openjdk.java.net > Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq > Subject: Re: How to specity the -agentlib option in a jtreg test? > > jtreg should report the command it is trying to execute in the "rerun" > section. > > If you execute that command directly, does it work? In other words, > can you isolate the problem to jtreg or to the execution of the command > that jtreg execs? > > -- Jon > > On 04/15/2016 07:53 AM, Staffan Larsen wrote: >> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. >> >> Staffan >> >>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >>> >>> Hi, >>> >>> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >>> >>> In my test I have >>> >>> @compile MyTest.java >>> @run main/othervm -agentlib:mylib MyTest >>> >>> I run the test with: >>> >>> jtreg -nativepath: MyTest >>> >>> However, it fails with: >>> >>> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >>> >>> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >>> However, for the -agentlib option, it does not help. >>> >>> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >>> >>> Thank you very much for your help. >>> >>> Best regards, >>> Alexander >>> From staffan.larsen at oracle.com Mon Apr 18 18:07:53 2016 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Mon, 18 Apr 2016 20:07:53 +0200 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <57151E9C.6030901@oracle.com> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> Message-ID: The JVMTI spec is kind of vague on this point, but does not mention system properties. -agentlib:= The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html > On 18 apr. 2016, at 19:51, Jonathan Gibbons wrote: > > OK, thanks for clarifying. > > The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) > > -- Jon > > On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >> Jon, >> >> In the 'rerun' section I have: >> >> images/jdk/bin/java \\ >> ... >> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >> -Djava.library.path=<...>images/test/hotspot/jtreg/native >> -agentlib:TestGetModules >> ... >> >> While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. >> Therefore -agentlib does not know where to look for the library. >> The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. >> >> Best regards, >> Alexander >> >> ----- Original Message ----- >> From: jonathan.gibbons at oracle.com >> To: jtreg-use at openjdk.java.net >> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >> Subject: Re: How to specity the -agentlib option in a jtreg test? >> >> jtreg should report the command it is trying to execute in the "rerun" >> section. >> >> If you execute that command directly, does it work? In other words, >> can you isolate the problem to jtreg or to the execution of the command >> that jtreg execs? >> >> -- Jon >> >> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. >>> >>> Staffan >>> >>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >>>> >>>> Hi, >>>> >>>> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >>>> >>>> In my test I have >>>> >>>> @compile MyTest.java >>>> @run main/othervm -agentlib:mylib MyTest >>>> >>>> I run the test with: >>>> >>>> jtreg -nativepath: MyTest >>>> >>>> However, it fails with: >>>> >>>> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >>>> >>>> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >>>> However, for the -agentlib option, it does not help. >>>> >>>> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >>>> >>>> Thank you very much for your help. >>>> >>>> Best regards, >>>> Alexander >>>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.gibbons at oracle.com Mon Apr 18 19:59:19 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 18 Apr 2016 12:59:19 -0700 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> Message-ID: <57153C97.3030300@oracle.com> HI Staffan, The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. And, my question still stands: which is the better one to fix: jtreg, or jvmti? -- Jon On 04/18/2016 11:07 AM, Staffan Larsen wrote: > The JVMTI spec is kind of vague on this point, but does not mention > system properties. > > -agentlib:= > The name following -agentlib: is the name of the library to load. > Lookup of the library, both its full name and location, proceeds in a > platform-specific manner. Typically, the is expanded > to an operating system specific file name. The will be > passed to the agent on start-up. For example, if the > option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to > load the shared library foo.dllfrom the system PATH under > WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the > SolarisTM operating environment. If the agent library is statically > linked into the executable then no actual loading takes place. > > http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html > > > >> On 18 apr. 2016, at 19:51, Jonathan Gibbons >> > wrote: >> >> OK, thanks for clarifying. >> >> The question is, should -agentlib use the system property (that is >> already being set) or should jtreg set LD_LIBRARY_PATH (which is >> platform specific.) >> >> -- Jon >> >> On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >>> Jon, >>> >>> In the 'rerun' section I have: >>> >>> images/jdk/bin/java \\ >>> ... >>> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >>> -Djava.library.path=<...>images/test/hotspot/jtreg/native >>> -agentlib:TestGetModules >>> ... >>> >>> While TestGetModules.so does reside in the >>> images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH >>> to that directory before invoking java. >>> Therefore -agentlib does not know where to look for the library. >>> The System.loadLibrary, on the contrary, does succeed because of the >>> -Djava.library.path passed to java. >>> >>> Best regards, >>> Alexander >>> >>> ----- Original Message ----- >>> From: jonathan.gibbons at oracle.com >>> To: jtreg-use at openjdk.java.net >>> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >>> Subject: Re: How to specity the -agentlib option in a jtreg test? >>> >>> jtreg should report the command it is trying to execute in the "rerun" >>> section. >>> >>> If you execute that command directly, does it work? In other words, >>> can you isolate the problem to jtreg or to the execution of the command >>> that jtreg execs? >>> >>> -- Jon >>> >>> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>>> I don?t know why it does not work for -agentlib, but as a >>>> workaround you can create an @driver class that launches your test >>>> program with the -agentpath parameter and get the location of the >>>> native libraries through the system property test.nativepath. >>>> >>>> Staffan >>>> >>>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin >>>>> >>>> > wrote: >>>>> >>>>> Hi, >>>>> >>>>> I'm trying to create a jtreg test which compiles and then executes >>>>> a java class with the -agentlib option (to test some JVMTI >>>>> functionality) >>>>> >>>>> In my test I have >>>>> >>>>> @compile MyTest.java >>>>> @run main/othervm -agentlib:mylib MyTest >>>>> >>>>> I run the test with: >>>>> >>>>> jtreg -nativepath: MyTest >>>>> >>>>> However, it fails with: >>>>> >>>>> "Could not find agent library mylib on the library path, >>>>> libmylib.so: cannot open shared object file: No such file or >>>>> directory" >>>>> >>>>> The -nativepath does provide for the successful loading of the >>>>> library when I use System.loadLibrary("mylib"). >>>>> However, for the -agentlib option, it does not help. >>>>> >>>>> Does someone know if it is possible to specify the library path >>>>> for the -agentlib option, from within a jtreg test or using the >>>>> jtreg options? >>>>> >>>>> Thank you very much for your help. >>>>> >>>>> Best regards, >>>>> Alexander >>>>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.dehaven at oracle.com Mon Apr 18 20:44:28 2016 From: david.dehaven at oracle.com (David DeHaven) Date: Mon, 18 Apr 2016 13:44:28 -0700 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <57153C97.3030300@oracle.com> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> <57153C97.3030300@oracle.com> Message-ID: <39B0F8A0-5A9B-426C-A53B-2AD87B376426@oracle.com> Mac uses DYLD_LIBRARY_PATH but be warned that 10.11 strips DYLD_xxx variable from the environment in some cases as a security measure. I think it would be ok in this case. -DrD- > HI Staffan, > > The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. > > And, my question still stands: which is the better one to fix: jtreg, or jvmti? > > -- Jon > > On 04/18/2016 11:07 AM, Staffan Larsen wrote: >> The JVMTI spec is kind of vague on this point, but does not mention system properties. >> >> -agentlib:= >> The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. >> >> http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html >> >> >> >>> On 18 apr. 2016, at 19:51, Jonathan Gibbons wrote: >>> >>> OK, thanks for clarifying. >>> >>> The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) >>> >>> -- Jon >>> >>> On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >>>> Jon, >>>> >>>> In the 'rerun' section I have: >>>> >>>> images/jdk/bin/java \\ >>>> ... >>>> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >>>> -Djava.library.path=<...>images/test/hotspot/jtreg/native >>>> -agentlib:TestGetModules >>>> ... >>>> >>>> While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. >>>> Therefore -agentlib does not know where to look for the library. >>>> The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. >>>> >>>> Best regards, >>>> Alexander >>>> >>>> ----- Original Message ----- >>>> From: jonathan.gibbons at oracle.com >>>> To: jtreg-use at openjdk.java.net >>>> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >>>> Subject: Re: How to specity the -agentlib option in a jtreg test? >>>> >>>> jtreg should report the command it is trying to execute in the "rerun" >>>> section. >>>> >>>> If you execute that command directly, does it work? In other words, >>>> can you isolate the problem to jtreg or to the execution of the command >>>> that jtreg execs? >>>> >>>> -- Jon >>>> >>>> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>>>> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. >>>>> >>>>> Staffan >>>>> >>>>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >>>>>> >>>>>> In my test I have >>>>>> >>>>>> @compile MyTest.java >>>>>> @run main/othervm -agentlib:mylib MyTest >>>>>> >>>>>> I run the test with: >>>>>> >>>>>> jtreg -nativepath: MyTest >>>>>> >>>>>> However, it fails with: >>>>>> >>>>>> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >>>>>> >>>>>> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >>>>>> However, for the -agentlib option, it does not help. >>>>>> >>>>>> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >>>>>> >>>>>> Thank you very much for your help. >>>>>> >>>>>> Best regards, >>>>>> Alexander >>>>>> >>> >> > From staffan.larsen at oracle.com Tue Apr 19 07:48:33 2016 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 19 Apr 2016 09:48:33 +0200 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <57153C97.3030300@oracle.com> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> <57153C97.3030300@oracle.com> Message-ID: <87AEFEBB-DB50-4493-B32B-92710E4D0613@oracle.com> > On 18 apr. 2016, at 21:59, Jonathan Gibbons wrote: > > HI Staffan, > > The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. As David said, Mac uses DYLD_LIBRARY_PATH. > And, my question still stands: which is the better one to fix: jtreg, or jvmti? I think the fix needs to be in jtreg. /Staffan > > -- Jon > > On 04/18/2016 11:07 AM, Staffan Larsen wrote: >> The JVMTI spec is kind of vague on this point, but does not mention system properties. >> >> -agentlib:= >> The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. >> >> http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html >> >> >> >>> On 18 apr. 2016, at 19:51, Jonathan Gibbons > wrote: >>> >>> OK, thanks for clarifying. >>> >>> The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) >>> >>> -- Jon >>> >>> On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >>>> Jon, >>>> >>>> In the 'rerun' section I have: >>>> >>>> images/jdk/bin/java \\ >>>> ... >>>> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >>>> -Djava.library.path=<...>images/test/hotspot/jtreg/native >>>> -agentlib:TestGetModules >>>> ... >>>> >>>> While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. >>>> Therefore -agentlib does not know where to look for the library. >>>> The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. >>>> >>>> Best regards, >>>> Alexander >>>> >>>> ----- Original Message ----- >>>> From: jonathan.gibbons at oracle.com >>>> To: jtreg-use at openjdk.java.net >>>> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >>>> Subject: Re: How to specity the -agentlib option in a jtreg test? >>>> >>>> jtreg should report the command it is trying to execute in the "rerun" >>>> section. >>>> >>>> If you execute that command directly, does it work? In other words, >>>> can you isolate the problem to jtreg or to the execution of the command >>>> that jtreg execs? >>>> >>>> -- Jon >>>> >>>> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>>>> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. >>>>> >>>>> Staffan >>>>> >>>>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin > wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >>>>>> >>>>>> In my test I have >>>>>> >>>>>> @compile MyTest.java >>>>>> @run main/othervm -agentlib:mylib MyTest >>>>>> >>>>>> I run the test with: >>>>>> >>>>>> jtreg -nativepath: MyTest >>>>>> >>>>>> However, it fails with: >>>>>> >>>>>> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >>>>>> >>>>>> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >>>>>> However, for the -agentlib option, it does not help. >>>>>> >>>>>> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >>>>>> >>>>>> Thank you very much for your help. >>>>>> >>>>>> Best regards, >>>>>> Alexander >>>>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kulyakhtin at oracle.com Tue Apr 19 12:34:56 2016 From: alexander.kulyakhtin at oracle.com (Alexander Kulyakhtin) Date: Tue, 19 Apr 2016 05:34:56 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? Message-ID: <4d3fd90f-2171-43c7-89e3-96b92ec071a2@default> Jon, Staffan, Based on the discussion below can I file a bug or an enhancement against the jtreg, requiring it to support the -agentlib option? Without the direct support for the -agentlib option, testing JVMTI with the jtreg, though possible, would require a somewhat tedious and platform-dependent workaround. Best regards, Alexander ----- Original Message ----- From: staffan.larsen at oracle.com To: jonathan.gibbons at oracle.com Cc: alexander.kulyakhtin at oracle.com, jtreg-use at openjdk.java.net Sent: Tuesday, April 19, 2016 10:48:32 AM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? On 18 apr. 2016, at 21:59, Jonathan Gibbons < jonathan.gibbons at oracle.com > wrote: HI Staffan, The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. As David said, Mac uses DYLD_LIBRARY_PATH. And, my question still stands: which is the better one to fix: jtreg, or jvmti? I think the fix needs to be in jtreg. /Staffan -- Jon On 04/18/2016 11:07 AM, Staffan Larsen wrote: The JVMTI spec is kind of vague on this point, but does not mention system properties. -agentlib:= The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html On 18 apr. 2016, at 19:51, Jonathan Gibbons < jonathan.gibbons at oracle.com > wrote: OK, thanks for clarifying. The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) -- Jon On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: Jon, In the 'rerun' section I have: images/jdk/bin/java \\ ... -Dtest.nativepath=<...>images/test/hotspot/jtreg/native -Djava.library.path=<...>images/test/hotspot/jtreg/native -agentlib:TestGetModules ... While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. Therefore -agentlib does not know where to look for the library. The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. Best regards, Alexander ----- Original Message ----- From: jonathan.gibbons at oracle.com To: jtreg-use at openjdk.java.net Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? jtreg should report the command it is trying to execute in the "rerun" section. If you execute that command directly, does it work? In other words, can you isolate the problem to jtreg or to the execution of the command that jtreg execs? -- Jon On 04/15/2016 07:53 AM, Staffan Larsen wrote: I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. Staffan On 15 apr. 2016, at 16:29, Alexander Kulyakhtin < alexander.kulyakhtin at oracle.com > wrote: Hi, I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) In my test I have @compile MyTest.java @run main/othervm -agentlib:mylib MyTest I run the test with: jtreg -nativepath: MyTest However, it fails with: "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). However, for the -agentlib option, it does not help. Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? Thank you very much for your help. Best regards, Alexander -------------- next part -------------- An HTML attachment was scrubbed... URL: From staffan.larsen at oracle.com Tue Apr 19 12:42:57 2016 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 19 Apr 2016 14:42:57 +0200 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <4d3fd90f-2171-43c7-89e3-96b92ec071a2@default> References: <4d3fd90f-2171-43c7-89e3-96b92ec071a2@default> Message-ID: <95555160-AF11-4CC3-ABA5-1612DC49BF07@oracle.com> > On 19 apr. 2016, at 14:34, Alexander Kulyakhtin wrote: > > Jon, Staffan, > > Based on the discussion below can I file a bug or an enhancement against the jtreg, requiring it to support the -agentlib option? I think that is a good idea, yes. > > Without the direct support for the -agentlib option, testing JVMTI with the jtreg, though possible, would require a somewhat tedious and platform-dependent workaround. > > Best regards, > Alexander > > > > ----- Original Message ----- > From: staffan.larsen at oracle.com > To: jonathan.gibbons at oracle.com > Cc: alexander.kulyakhtin at oracle.com, jtreg-use at openjdk.java.net > Sent: Tuesday, April 19, 2016 10:48:32 AM GMT +03:00 Iraq > Subject: Re: How to specity the -agentlib option in a jtreg test? > > > On 18 apr. 2016, at 21:59, Jonathan Gibbons > wrote: > > HI Staffan, > > The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. > > As David said, Mac uses DYLD_LIBRARY_PATH. > > And, my question still stands: which is the better one to fix: jtreg, or jvmti? > > I think the fix needs to be in jtreg. > > /Staffan > > > -- Jon > > On 04/18/2016 11:07 AM, Staffan Larsen wrote: > The JVMTI spec is kind of vague on this point, but does not mention system properties. > > -agentlib:= > The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. > > http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html > > > > On 18 apr. 2016, at 19:51, Jonathan Gibbons > wrote: > > OK, thanks for clarifying. > > The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) > > -- Jon > > On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: > Jon, > > In the 'rerun' section I have: > > images/jdk/bin/java \\ > ... > -Dtest.nativepath=<...>images/test/hotspot/jtreg/native > -Djava.library.path=<...>images/test/hotspot/jtreg/native > -agentlib:TestGetModules > ... > > While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. > Therefore -agentlib does not know where to look for the library. > The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. > > Best regards, > Alexander > > ----- Original Message ----- > From: jonathan.gibbons at oracle.com > To: jtreg-use at openjdk.java.net > Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq > Subject: Re: How to specity the -agentlib option in a jtreg test? > > jtreg should report the command it is trying to execute in the "rerun" > section. > > If you execute that command directly, does it work? In other words, > can you isolate the problem to jtreg or to the execution of the command > that jtreg execs? > > -- Jon > > On 04/15/2016 07:53 AM, Staffan Larsen wrote: > I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. > > Staffan > > On 15 apr. 2016, at 16:29, Alexander Kulyakhtin > wrote: > > Hi, > > I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) > > In my test I have > > @compile MyTest.java > @run main/othervm -agentlib:mylib MyTest > > I run the test with: > > jtreg -nativepath: MyTest > > However, it fails with: > > "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" > > The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). > However, for the -agentlib option, it does not help. > > Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? > > Thank you very much for your help. > > Best regards, > Alexander -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.gibbons at oracle.com Tue Apr 19 15:15:44 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 19 Apr 2016 08:15:44 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <87AEFEBB-DB50-4493-B32B-92710E4D0613@oracle.com> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> <57153C97.3030300@oracle.com> <87AEFEBB-DB50-4493-B32B-92710E4D0613@oracle.com> Message-ID: <57164BA0.4060103@oracle.com> OK, The one complication from the jtreg side is that the nativepath has to be merged with any externally supplied value on the PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH. With that complication in mind, should the nativepath be prepended or appending to any existing value on the env variable? -- Jon On 04/19/2016 12:48 AM, Staffan Larsen wrote: > >> On 18 apr. 2016, at 21:59, Jonathan Gibbons >> > wrote: >> >> HI Staffan, >> >> The text specifically describes Windows and Solaris. Should we assume >> that Mac and Linux also use LD_LIBRARY_PATH. > > As David said, Mac uses DYLD_LIBRARY_PATH. > >> And, my question still stands: which is the better one to fix: >> jtreg, or jvmti? > > I think the fix needs to be in jtreg. > > /Staffan > >> >> -- Jon >> >> On 04/18/2016 11:07 AM, Staffan Larsen wrote: >>> The JVMTI spec is kind of vague on this point, but does not mention >>> system properties. >>> >>> -agentlib:= >>> The name following -agentlib: is the name of the library to load. >>> Lookup of the library, both its full name and location, proceeds in >>> a platform-specific manner. Typically, the is >>> expanded to an operating system specific file name. >>> The will be passed to the agent on start-up. For example, >>> if the option -agentlib:foo=opt1,opt2 is specified, the VM will >>> attempt to load the shared library foo.dllfrom the system PATH under >>> WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the >>> SolarisTM operating environment. If the agent library is statically >>> linked into the executable then no actual loading takes place. >>> >>> http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html >>> >>> >>> >>>> On 18 apr. 2016, at 19:51, Jonathan Gibbons >>>> > >>>> wrote: >>>> >>>> OK, thanks for clarifying. >>>> >>>> The question is, should -agentlib use the system property (that is >>>> already being set) or should jtreg set LD_LIBRARY_PATH (which is >>>> platform specific.) >>>> >>>> -- Jon >>>> >>>> On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >>>>> Jon, >>>>> >>>>> In the 'rerun' section I have: >>>>> >>>>> images/jdk/bin/java \\ >>>>> ... >>>>> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >>>>> -Djava.library.path=<...>images/test/hotspot/jtreg/native >>>>> -agentlib:TestGetModules >>>>> ... >>>>> >>>>> While TestGetModules.so does reside in the >>>>> images/test/hotspot/jtreg/native, jtreg does not set >>>>> LD_LIBRARY_PATH to that directory before invoking java. >>>>> Therefore -agentlib does not know where to look for the library. >>>>> The System.loadLibrary, on the contrary, does succeed because of >>>>> the -Djava.library.path passed to java. >>>>> >>>>> Best regards, >>>>> Alexander >>>>> >>>>> ----- Original Message ----- >>>>> From: jonathan.gibbons at oracle.com >>>>> To: jtreg-use at openjdk.java.net >>>>> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >>>>> Subject: Re: How to specity the -agentlib option in a jtreg test? >>>>> >>>>> jtreg should report the command it is trying to execute in the "rerun" >>>>> section. >>>>> >>>>> If you execute that command directly, does it work? In other words, >>>>> can you isolate the problem to jtreg or to the execution of the >>>>> command >>>>> that jtreg execs? >>>>> >>>>> -- Jon >>>>> >>>>> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>>>>> I don?t know why it does not work for -agentlib, but as a >>>>>> workaround you can create an @driver class that launches your >>>>>> test program with the -agentpath parameter and get the location >>>>>> of the native libraries through the system property test.nativepath. >>>>>> >>>>>> Staffan >>>>>> >>>>>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin >>>>>>> >>>>>> > wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm trying to create a jtreg test which compiles and then >>>>>>> executes a java class with the -agentlib option (to test some >>>>>>> JVMTI functionality) >>>>>>> >>>>>>> In my test I have >>>>>>> >>>>>>> @compile MyTest.java >>>>>>> @run main/othervm -agentlib:mylib MyTest >>>>>>> >>>>>>> I run the test with: >>>>>>> >>>>>>> jtreg -nativepath: MyTest >>>>>>> >>>>>>> However, it fails with: >>>>>>> >>>>>>> "Could not find agent library mylib on the library path, >>>>>>> libmylib.so: cannot open shared object file: No such file or >>>>>>> directory" >>>>>>> >>>>>>> The -nativepath does provide for the successful loading of the >>>>>>> library when I use System.loadLibrary("mylib"). >>>>>>> However, for the -agentlib option, it does not help. >>>>>>> >>>>>>> Does someone know if it is possible to specify the library path >>>>>>> for the -agentlib option, from within a jtreg test or using the >>>>>>> jtreg options? >>>>>>> >>>>>>> Thank you very much for your help. >>>>>>> >>>>>>> Best regards, >>>>>>> Alexander >>>>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinrb at google.com Tue Apr 19 18:50:23 2016 From: martinrb at google.com (Martin Buchholz) Date: Tue, 19 Apr 2016 11:50:23 -0700 Subject: Testing with JTREG In-Reply-To: <571660C6.7070606@redhat.com> References: <571660C6.7070606@redhat.com> Message-ID: See thread Status of jtreg build http://mail.openjdk.java.net/pipermail/jtreg-use/2016-April/thread.html yes, you need genuine 4.2 b01. But no one is currently providing such binaries on the Net. Some people have succeeded in building their own, but it's not easy. As jjg said, hopefully https://adopt-openjdk.ci.cloudbees.com/job/jtreg/ will soon get fixed so that it is the one-stop shopping for jtreg binaries. On Tue, Apr 19, 2016 at 9:45 AM, Andrew Haley wrote: > I've recently started to have problems with jtreg. This one: > > JAVA_HOME=/home/aph/hs/build/linux-aarch64-normal-server-release/images/jdk/ ~/jtreg/bin/jtreg -v compiler/intrinsics/string > Error. Parse Exception: Bad classname provided for `build': java.base/java.lang.Helper > > This is my jtreg: > > jtreg, version 4.2.0 dev 3204 > Installed in /home/aph/jtreg/lib/jtreg.jar > Running on platform version 1.8.0-internal from /home/aph/jdk/jre. > Built with 1.7.0_79 on 09/28/2015 06:55 AM. > Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. > Use is subject to license terms. > JCov 2.0-1 > TestNG: version 6.8-201210030754 > > Is it that I need something newer? > > Thanks, > > Andrew. From staffan.larsen at oracle.com Tue Apr 19 20:02:17 2016 From: staffan.larsen at oracle.com (Staffan Larsen) Date: Tue, 19 Apr 2016 13:02:17 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <57164BA0.4060103@oracle.com> References: <0c98f332-50a8-477a-8cc4-cdc0d4b8b080@default> <57151E9C.6030901@oracle.com> <57153C97.3030300@oracle.com> <87AEFEBB-DB50-4493-B32B-92710E4D0613@oracle.com> <57164BA0.4060103@oracle.com> Message-ID: <01B07253-46EB-4458-A496-76E0F0C114D8@oracle.com> I would say nativepath should be prepended, so that we don't accidentally pick up some other library. Thanks, Staffan > On 19 apr. 2016, at 17:15, Jonathan Gibbons wrote: > > OK, > > The one complication from the jtreg side is that the nativepath has to be merged with any externally supplied value on the PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH. > > With that complication in mind, should the nativepath be prepended or appending to any existing value on the env variable? > > -- Jon > >> On 04/19/2016 12:48 AM, Staffan Larsen wrote: >> >>> On 18 apr. 2016, at 21:59, Jonathan Gibbons wrote: >>> >>> HI Staffan, >>> >>> The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. >> >> As David said, Mac uses DYLD_LIBRARY_PATH. >> >>> And, my question still stands: which is the better one to fix: jtreg, or jvmti? >> >> I think the fix needs to be in jtreg. >> >> /Staffan >> >>> >>> -- Jon >>> >>>> On 04/18/2016 11:07 AM, Staffan Larsen wrote: >>>> The JVMTI spec is kind of vague on this point, but does not mention system properties. >>>> >>>> -agentlib:= >>>> The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. >>>> >>>> http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html >>>> >>>> >>>> >>>>> On 18 apr. 2016, at 19:51, Jonathan Gibbons wrote: >>>>> >>>>> OK, thanks for clarifying. >>>>> >>>>> The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) >>>>> >>>>> -- Jon >>>>> >>>>>> On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: >>>>>> Jon, >>>>>> >>>>>> In the 'rerun' section I have: >>>>>> >>>>>> images/jdk/bin/java \\ >>>>>> ... >>>>>> -Dtest.nativepath=<...>images/test/hotspot/jtreg/native >>>>>> -Djava.library.path=<...>images/test/hotspot/jtreg/native >>>>>> -agentlib:TestGetModules >>>>>> ... >>>>>> >>>>>> While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. >>>>>> Therefore -agentlib does not know where to look for the library. >>>>>> The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. >>>>>> >>>>>> Best regards, >>>>>> Alexander >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: jonathan.gibbons at oracle.com >>>>>> To: jtreg-use at openjdk.java.net >>>>>> Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq >>>>>> Subject: Re: How to specity the -agentlib option in a jtreg test? >>>>>> >>>>>> jtreg should report the command it is trying to execute in the "rerun" >>>>>> section. >>>>>> >>>>>> If you execute that command directly, does it work? In other words, >>>>>> can you isolate the problem to jtreg or to the execution of the command >>>>>> that jtreg execs? >>>>>> >>>>>> -- Jon >>>>>> >>>>>>> On 04/15/2016 07:53 AM, Staffan Larsen wrote: >>>>>>> I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. >>>>>>> >>>>>>> Staffan >>>>>>> >>>>>>>> On 15 apr. 2016, at 16:29, Alexander Kulyakhtin wrote: >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) >>>>>>>> >>>>>>>> In my test I have >>>>>>>> >>>>>>>> @compile MyTest.java >>>>>>>> @run main/othervm -agentlib:mylib MyTest >>>>>>>> >>>>>>>> I run the test with: >>>>>>>> >>>>>>>> jtreg -nativepath: MyTest >>>>>>>> >>>>>>>> However, it fails with: >>>>>>>> >>>>>>>> "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" >>>>>>>> >>>>>>>> The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). >>>>>>>> However, for the -agentlib option, it does not help. >>>>>>>> >>>>>>>> Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? >>>>>>>> >>>>>>>> Thank you very much for your help. >>>>>>>> >>>>>>>> Best regards, >>>>>>>> Alexander > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kulyakhtin at oracle.com Wed Apr 20 12:22:17 2016 From: alexander.kulyakhtin at oracle.com (Alexander Kulyakhtin) Date: Wed, 20 Apr 2016 05:22:17 -0700 (PDT) Subject: How to specity the -agentlib option in a jtreg test? Message-ID: <869356c0-ab4f-40ab-ad1a-e3ce09c00339@default> Jon, I think, in the majority of the cases a jvmti test involves creating both a java source and a native agent library (which then gets passed to the test via the -agentlib option). Probably, there are no jvmti tests involving some 'well-known' or 'prebuilt' agent libraries. Therefore, the risk of having the -nativepath pointing to the wrong artifacts seems to be very low. Probably, appending the nativepath to the end of the env variable would be safer in any case. As was agreed before, I have filed https://bugs.openjdk.java.net/browse/CODETOOLS-7901662 to address the -agnetlib issue Best regards, Alexander ----- Original Message ----- From: jonathan.gibbons at oracle.com To: staffan.larsen at oracle.com Cc: alexander.kulyakhtin at oracle.com, jtreg-use at openjdk.java.net Sent: Tuesday, April 19, 2016 7:07:37 PM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? OK, The one complication from the jtreg side is that the nativepath has to be merged with any externally supplied value on the PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH. With that complication in mind, should the nativepath be prepended or appending to any existing value on the env variable? -- Jon On 04/19/2016 12:48 AM, Staffan Larsen wrote: On 18 apr. 2016, at 21:59, Jonathan Gibbons < jonathan.gibbons at oracle.com > wrote: HI Staffan, The text specifically describes Windows and Solaris. Should we assume that Mac and Linux also use LD_LIBRARY_PATH. As David said, Mac uses DYLD_LIBRARY_PATH. And, my question still stands: which is the better one to fix: jtreg, or jvmti? I think the fix needs to be in jtreg. /Staffan -- Jon On 04/18/2016 11:07 AM, Staffan Larsen wrote: The JVMTI spec is kind of vague on this point, but does not mention system properties. -agentlib:= The name following -agentlib: is the name of the library to load. Lookup of the library, both its full name and location, proceeds in a platform-specific manner. Typically, the is expanded to an operating system specific file name. The will be passed to the agent on start-up. For example, if the option -agentlib:foo=opt1,opt2 is specified, the VM will attempt to load the shared library foo.dllfrom the system PATH under WindowsTM or libfoo.so from the LD_LIBRARY_PATH under the SolarisTM operating environment. If the agent library is statically linked into the executable then no actual loading takes place. http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html On 18 apr. 2016, at 19:51, Jonathan Gibbons < jonathan.gibbons at oracle.com > wrote: OK, thanks for clarifying. The question is, should -agentlib use the system property (that is already being set) or should jtreg set LD_LIBRARY_PATH (which is platform specific.) -- Jon On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: Jon, In the 'rerun' section I have: images/jdk/bin/java \\ ... -Dtest.nativepath=<...>images/test/hotspot/jtreg/native -Djava.library.path=<...>images/test/hotspot/jtreg/native -agentlib:TestGetModules ... While TestGetModules.so does reside in the images/test/hotspot/jtreg/native, jtreg does not set LD_LIBRARY_PATH to that directory before invoking java. Therefore -agentlib does not know where to look for the library. The System.loadLibrary, on the contrary, does succeed because of the -Djava.library.path passed to java. Best regards, Alexander ----- Original Message ----- From: jonathan.gibbons at oracle.com To: jtreg-use at openjdk.java.net Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 Iraq Subject: Re: How to specity the -agentlib option in a jtreg test? jtreg should report the command it is trying to execute in the "rerun" section. If you execute that command directly, does it work? In other words, can you isolate the problem to jtreg or to the execution of the command that jtreg execs? -- Jon On 04/15/2016 07:53 AM, Staffan Larsen wrote: I don?t know why it does not work for -agentlib, but as a workaround you can create an @driver class that launches your test program with the -agentpath parameter and get the location of the native libraries through the system property test.nativepath. Staffan On 15 apr. 2016, at 16:29, Alexander Kulyakhtin < alexander.kulyakhtin at oracle.com > wrote: Hi, I'm trying to create a jtreg test which compiles and then executes a java class with the -agentlib option (to test some JVMTI functionality) In my test I have @compile MyTest.java @run main/othervm -agentlib:mylib MyTest I run the test with: jtreg -nativepath: MyTest However, it fails with: "Could not find agent library mylib on the library path, libmylib.so: cannot open shared object file: No such file or directory" The -nativepath does provide for the successful loading of the library when I use System.loadLibrary("mylib"). However, for the -agentlib option, it does not help. Does someone know if it is possible to specify the library path for the -agentlib option, from within a jtreg test or using the jtreg options? Thank you very much for your help. Best regards, Alexander -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.gibbons at oracle.com Wed Apr 20 14:44:19 2016 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 20 Apr 2016 07:44:19 -0700 Subject: How to specity the -agentlib option in a jtreg test? In-Reply-To: <869356c0-ab4f-40ab-ad1a-e3ce09c00339@default> References: <869356c0-ab4f-40ab-ad1a-e3ce09c00339@default> Message-ID: <571795C3.9000107@oracle.com> I pushed a fix for this to jtreg tip yesterday; you should be able to try the code in the 4.2 nightly build, available in the standard place on jre.us.oracle.com/java/re/jtreg/4.2 I chose to append to the path. The only risk is on Windows, where PATH is inherited into test JVMs; on other platforms, (DY)LD_LIBRARY_PATH is not inherited by default, so appended/prepended is mostly a moot point, unless you explicitly use options to enable these variables to be inherited. I'll make sure 7901662 is updated. -- Jon On 04/20/2016 05:22 AM, Alexander Kulyakhtin wrote: > Jon, > > I think, in the majority of the cases a jvmti test involves creating > both a java source and a native agent library (which then gets passed > to the test via the -agentlib option). > Probably, there are no jvmti tests involving some 'well-known' or > 'prebuilt' agent libraries. > Therefore, the risk of having the -nativepath pointing to the wrong > artifacts seems to be very low. Probably, appending the nativepath to > the end of the env variable would be safer in any case. > > As was agreed before, I have filed > https://bugs.openjdk.java.net/browse/CODETOOLS-7901662 to address the > -agnetlib issue > > Best regards, > Alexander > > ----- Original Message ----- > From: jonathan.gibbons at oracle.com > To: staffan.larsen at oracle.com > Cc: alexander.kulyakhtin at oracle.com, jtreg-use at openjdk.java.net > Sent: Tuesday, April 19, 2016 7:07:37 PM GMT +03:00 Iraq > Subject: Re: How to specity the -agentlib option in a jtreg test? > > OK, > > The one complication from the jtreg side is that the nativepath has to > be merged with any externally supplied value on the > PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH. > > With that complication in mind, should the nativepath be prepended or > appending to any existing value on the env variable? > > -- Jon > > On 04/19/2016 12:48 AM, Staffan Larsen wrote: > > > On 18 apr. 2016, at 21:59, Jonathan Gibbons > > wrote: > > HI Staffan, > > The text specifically describes Windows and Solaris. Should > we assume that Mac and Linux also use LD_LIBRARY_PATH. > > > As David said, Mac uses DYLD_LIBRARY_PATH. > > And, my question still stands: which is the better one to > fix: jtreg, or jvmti? > > > I think the fix needs to be in jtreg. > > /Staffan > > > -- Jon > > On 04/18/2016 11:07 AM, Staffan Larsen wrote: > > The JVMTI spec is kind of vague on this point, but does > not mention system properties. > > -agentlib:= > The name following -agentlib: is the name of the library > to load. Lookup of the library, both its full name and > location, proceeds in a platform-specific > manner. Typically, the is expanded to an > operating system specific file name. The will be > passed to the agent on start-up. For example, if the > option -agentlib:foo=opt1,opt2 is specified, the VM will > attempt to load the shared library foo.dllfrom the > system PATH under WindowsTM or libfoo.so from > the LD_LIBRARY_PATH under the SolarisTM operating > environment. If the agent library is statically linked > into the executable then no actual loading takes place. > > http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html > > > > On 18 apr. 2016, at 19:51, Jonathan Gibbons > > wrote: > > OK, thanks for clarifying. > > The question is, should -agentlib use the system > property (that is already being set) or should jtreg > set LD_LIBRARY_PATH (which is platform specific.) > > -- Jon > > On 04/18/2016 04:53 AM, Alexander Kulyakhtin wrote: > > Jon, > > In the 'rerun' section I have: > > images/jdk/bin/java \\ > ... > -Dtest.nativepath=<...>images/test/hotspot/jtreg/native > -Djava.library.path=<...>images/test/hotspot/jtreg/native > -agentlib:TestGetModules > ... > > While TestGetModules.so does reside in the > images/test/hotspot/jtreg/native, jtreg does not > set LD_LIBRARY_PATH to that directory before > invoking java. > Therefore -agentlib does not know where to look > for the library. > The System.loadLibrary, on the contrary, does > succeed because of the -Djava.library.path passed > to java. > > Best regards, > Alexander > > ----- Original Message ----- > From: jonathan.gibbons at oracle.com > > To: jtreg-use at openjdk.java.net > > Sent: Friday, April 15, 2016 7:05:18 PM GMT +03:00 > Iraq > Subject: Re: How to specity the -agentlib option > in a jtreg test? > > jtreg should report the command it is trying to > execute in the "rerun" > section. > > If you execute that command directly, does it > work? In other words, > can you isolate the problem to jtreg or to the > execution of the command > that jtreg execs? > > -- Jon > > On 04/15/2016 07:53 AM, Staffan Larsen wrote: > > I don?t know why it does not work for > -agentlib, but as a workaround you can create > an @driver class that launches your test > program with the -agentpath parameter and get > the location of the native libraries through > the system property test.nativepath. > > Staffan > > On 15 apr. 2016, at 16:29, Alexander > Kulyakhtin > > > wrote: > > Hi, > > I'm trying to create a jtreg test which > compiles and then executes a java class > with the -agentlib option (to test some > JVMTI functionality) > > In my test I have > > @compile MyTest.java > @run main/othervm -agentlib:mylib MyTest > > I run the test with: > > jtreg -nativepath: MyTest > > However, it fails with: > > "Could not find agent library mylib on the > library path, libmylib.so: cannot open > shared object file: No such file or directory" > > The -nativepath does provide for the > successful loading of the library when I > use System.loadLibrary("mylib"). > However, for the -agentlib option, it does > not help. > > Does someone know if it is possible to > specify the library path for the -agentlib > option, from within a jtreg test or using > the jtreg options? > > Thank you very much for your help. > > Best regards, > Alexander > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: