RFR:8153978:New test to verify the modules info as returned by the JVMTI

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Tue Jun 21 07:46:32 UTC 2016


Hi Christian and Alexander,

Not sure if my code is correct but I can not pass through the following 
agent library load error:

     Error occurred during initialization of VM
     Could not find agent library GetModuleByPkgTest1 on the library 
path, with error: libGetModuleByPkgTest1.so: cannot open shared object 
file: No such file or directory


I'm using the following shell script to run my test:

#!/bin/sh

IMAGES=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images
JAVA_HOME=$IMAGES/jdk
export LD_LIBRARY_PATH=$IMAGES/test/hotspot/jtreg/native

# /java/re/jtreg/4.2/nightly/binaries/jtreg/bin/jtreg \

/java/re/jtreg/4.2/promoted/latest/binaries/jtreg/bin/jtreg \
  -J-Dtest.java.opts='-Xmixed -server' \
  -jdk ${JAVA_HOME} -Dtest.java.opts='-Xmixed -server' \
  /var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java



The jtreg lines are:

% cat -50 
test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
/*
  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  */

/**
  * @test
  * @summary Verifies the JVMTI GetModuleByPackageName API
  * @compile GetModuleByPkgTest1.java
  * @run main/othervm -agentlib:GetModuleByPkgTest1 GetModuleByPkgTest1
  */
  . . .

Please, let me know if you see anything wrong in my testing environment.
Below is the full .jtr log.

Thanks,
Serguei

cat 
./JTwork/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.jtr
#Test Results (version 2)
#Tue Jun 21 00:33:26 PDT 2016
#checksum:265f9695e52dbedb
#-----testdescription-----
$file=/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
$root=/var/tmp/sspitsyn/jdk9/hotspot/test
keywords=othervm
run=USER_SPECIFIED compile GetModuleByPkgTest1.java\nUSER_SPECIFIED 
main/othervm -agentlib\:GetModuleByPkgTest1 GetModuleByPkgTest1\n
source=GetModuleByPkgTest1.java
title=Verifies the JVMTI GetModuleByPackageName API

#-----environment-----

#-----testresult-----
description=file\:/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
elapsed=2061 0\:00\:02.061
end=Tue Jun 21 00\:33\:26 PDT 2016
environment=regtest
execStatus=Failed. Unexpected exit from test [exit code\: 1]
hostname=sc11137378.us.oracle.com
javatestOS=Linux 3.2.0-55-generic (amd64)
javatestVersion=4.4
jtregVersion=jtreg 4.2 fcs b02
script=com.sun.javatest.regtest.RegressionScript
sections=script_messages compile build main
start=Tue Jun 21 00\:33\:24 PDT 2016
test=serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
testJDK=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk
user.name=sspitsyn
work=/var/tmp/sspitsyn/tst/jdk9/JTwork/serviceability/jvmti/GetModuleByPackageName

#section:script_messages
----------messages:(5/324)----------
JDK under test: 
/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk
java version "9-internal"
Java(TM) SE Runtime Environment (fastdebug build 
9-internal+0-2016-06-09-145126.sspitsyn.jdk9)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 
9-internal+0-2016-06-09-145126.sspitsyn.jdk9, mixed mode)


#section:compile
----------messages:(4/233)----------
command: compile 
/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
reason: User specified action: run compile GetModuleByPkgTest1.java
Mode: othervm
elapsed time (seconds): 1.7
----------configuration:(4/227)----------
javac compilation environment
   class path: 
/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 

/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 


----------rerun:(21/1677)*----------
DISPLAY=localhost:11.0 \\
HOME=/home/sspitsyn \\
JTREG_HOME=/java/re/jtreg/4.2/promoted/latest/binaries/jtreg \\
LANG=en_US.UTF-8 \\
PATH=/bin:/usr/bin \\
/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk/bin/javac 
\\
         -J'-Dtest.java.opts=-Xmixed -server' \\
-J-Dtest.src=/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 
\\
-J-Dtest.src.path=/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 
\\
-J-Dtest.classes=/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
\\
-J-Dtest.class.path=/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
\\
         -J-Dtest.vm.opts='-Dtest.java.opts=-Xmixed -server' \\
         -J-Dtest.tool.vm.opts='-J-Dtest.java.opts=-Xmixed -server' \\
         -J-Dtest.compiler.opts= \\
         -J-Dtest.java.opts= \\
-J-Dtest.jdk=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk 
\\
-J-Dcompile.jdk=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk 
\\
         -J-Dtest.timeout.factor=1.0 \\
         -d 
/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
\\
         -sourcepath 
/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 
\\
         -classpath 
/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName:/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.java
----------System.out:(0/0)----------
----------System.err:(0/0)----------
result: Passed. Compilation successful

#section:build
----------messages:(3/104)----------
command: build GetModuleByPkgTest1
reason: Named class compiled on demand
elapsed time (seconds): 0.002
result: Passed. All files up to date

#section:main
----------messages:(4/228)----------
command: main -agentlib:GetModuleByPkgTest1 GetModuleByPkgTest1
reason: User specified action: run main/othervm 
-agentlib:GetModuleByPkgTest1 GetModuleByPkgTest1
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.017
----------configuration:(0/0)----------
----------System.out:(2/210)----------
Error occurred during initialization of VM
Could not find agent library GetModuleByPkgTest1 on the library path, 
with error: libGetModuleByPkgTest1.so: cannot open shared object file: 
No such file or directory
----------System.err:(0/0)----------
----------rerun:(21/1756)*----------
DISPLAY=localhost:11.0 \\
HOME=/home/sspitsyn \\
JTREG_HOME=/java/re/jtreg/4.2/promoted/latest/binaries/jtreg \\
LANG=en_US.UTF-8 \\
PATH=/bin:/usr/bin \\
CLASSPATH=/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName:/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName:/net/scanas416.us.oracle.com/export/java_re2/misc/promoted/jtreg/4.2/fcs/b02/binaries/jtreg/lib/javatest.jar:/net/scanas416.us.oracle.com/export/java_re2/misc/promoted/jtreg/4.2/fcs/b02/binaries/jtreg/lib/jtreg.jar 
\\
/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk/bin/java 
\\
-Dtest.src=/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 
\\
-Dtest.src.path=/var/tmp/sspitsyn/jdk9/hotspot/test/serviceability/jvmti/GetModuleByPackageName 
\\
-Dtest.classes=/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
\\
-Dtest.class.path=/var/tmp/sspitsyn/tst/jdk9/JTwork/classes/serviceability/jvmti/GetModuleByPackageName 
\\
         -Dtest.vm.opts='-Dtest.java.opts=-Xmixed -server' \\
         -Dtest.tool.vm.opts='-J-Dtest.java.opts=-Xmixed -server' \\
         -Dtest.compiler.opts= \\
         -Dtest.java.opts= \\
-Dtest.jdk=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk 
\\
-Dcompile.jdk=/var/tmp/sspitsyn/jdk9/build/linux-x86_64-normal-server-fastdebug/images/jdk 
\\
         -Dtest.timeout.factor=1.0 \\
         '-Dtest.java.opts=-Xmixed -server' \\
         -agentlib:GetModuleByPkgTest1 \\
         com.sun.javatest.regtest.agent.MainWrapper 
/var/tmp/sspitsyn/tst/jdk9/JTwork/serviceability/jvmti/GetModuleByPackageName/GetModuleByPkgTest1.d/main.0.jta
result: Failed. Unexpected exit from test [exit code: 1]


test result: Failed. Unexpected exit from test [exit code: 1]

Thanks,
Serguei


On 6/19/16 00:09, serguei.spitsyn at oracle.com wrote:
> Hi Christian,
>
> Thank you for the reply!
> Serguei
>
>
> On 6/18/16 17:33, Christian Tornqvist wrote:
>>
>> Hi Serguei,
>>
>> We’re currently using jtreg 4.2 b02, so you should be able to do this.
>>
>> Thanks,
>>
>> Christian
>>
>> *From:*serviceability-dev 
>> [mailto:serviceability-dev-bounces at openjdk.java.net] *On Behalf Of 
>> *serguei.spitsyn at oracle.com
>> *Sent:* Friday, June 17, 2016 7:39 PM
>> *To:* Alexander Kulyakhtin <alexander.kulyakhtin at oracle.com>
>> *Cc:* serviceability-dev at openjdk.java.net
>> *Subject:* Re: RFR:8153978:New test to verify the modules info as 
>> returned by the JVMTI
>>
>> Hi Alexander,
>>
>> I'm curious if the jtreg 4.2 is out and this test can be pushed now?
>> I'd want to use the same pattern to write the Jigsaw related JVMTI tests.
>>
>> Thanks,
>> Serguei
>>
>>
>> On 5/5/16 04:25, Alexander Kulyakhtin wrote:
>>
>>     Sergey,
>>
>>     Thank you very much for the review.
>>     I will be pushing the fix as soon as jtreg 4.2 is out, since 4.2 
>>     has the fix for CODETOOLS-7901662, required for this test.
>>
>>     Best regards,
>>     Alexander
>>
>>     From: serguei.spitsyn at oracle.com <mailto:serguei.spitsyn at oracle.com>
>>     To: alexander.kulyakhtin at oracle.com
>>     <mailto:alexander.kulyakhtin at oracle.com>
>>     Cc: serviceability-dev at openjdk.java.net
>>     <mailto:serviceability-dev at openjdk.java.net>,
>>     aleksey.voytilov at oracle.com <mailto:aleksey.voytilov at oracle.com>
>>     Sent: Wednesday, May 4, 2016 11:31:07 PM GMT +03:00 Iraq
>>     Subject: Re: RFR:8153978:New test to verify the modules info as
>>     returned by the JVMTI
>>
>>     Hi Alexander,
>>
>>     It looks good.
>>     Thank you for making the changes!
>>
>>     Thanks,
>>     Serguei
>>
>>
>>
>>     On 5/4/16 05:17, Alexander Kulyakhtin wrote:
>>
>>         Hi Sergey,
>>
>>         Thank you very much for the review.
>>
>>         Please, find the updated webrev with your findings corrected at:
>>         http://cr.openjdk.java.net/~akulyakh/8153978_02/index.html
>>         <http://cr.openjdk.java.net/%7Eakulyakh/8153978_02/index.html>
>>
>>         Best regards,
>>         Alexander
>>
>>         ----- Original Message -----
>>         From: serguei.spitsyn at oracle.com
>>         <mailto:serguei.spitsyn at oracle.com>
>>         To: alexander.kulyakhtin at oracle.com
>>         <mailto:alexander.kulyakhtin at oracle.com>,
>>         serviceability-dev at openjdk.java.net
>>         <mailto:serviceability-dev at openjdk.java.net>
>>         Cc: aleksey.voytilov at oracle.com
>>         <mailto:aleksey.voytilov at oracle.com>
>>         Sent: Tuesday, May 3, 2016 1:06:05 AM GMT +03:00 Iraq
>>         Subject: Re: RFR:8153978:New test to verify the modules info
>>         as returned by the JVMTI
>>
>>         Hi Alexander,
>>
>>
>>         Could you, fix a couple of minor issues?
>>
>>         test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
>>
>>            58         for(Module mod : my.modules()) {
>>
>>            59             if(!jvmtiModules.contains(mod)) {
>>
>>            A space is missed after the 'for' and 'if' keywords.
>>
>>
>>         test/serviceability/jvmti/GetModulesInfo/ModulesInfo.java.
>>
>>            31     boolean compareExcludingUnnamed(ModulesInfo other) {
>>
>>            I'd suggest to call it compareNamed.
>>
>>
>>         Otherwise, the new test looks great.
>>         Thanks a lot for taking care about it!
>>
>>         Thanks,
>>         Serguei
>>
>>
>>
>>         On 4/29/16 06:12, Alexander Kulyakhtin wrote:
>>
>>             Hi,
>>
>>             Could you, please, review these test-only changes (adding a new test).
>>
>>             CR:https://bugs.openjdk.java.net/browse/JDK-8153978  "New test to verify the modules info as returned by the JVMTI"
>>
>>             Webrev:http://cr.openjdk.java.net/~akulyakh/8153978_01/
>>             <http://cr.openjdk.java.net/%7Eakulyakh/8153978_01/>
>>
>>             The new test verifies that JVMTI returns the correct info about the modules loaded at the application startup.
>>
>>             It also verifies that the returned info is consistent with the same info returned by the Java API.
>>
>>             It then loads a new named module and checks the correctness of the JVMTI info again.
>>
>>             Due to a tools issuehttps://bugs.openjdk.java.net/browse/CODETOOLS-7901662  the test can only be pushed in when the updated jtreg is released.
>>
>>             The test passes fine with the nightly jtreg build, containing the CODETOOLS-7901662 fix.
>>
>>             Best regards,
>>
>>             Alexander
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20160621/d85b556d/attachment-0001.html>


More information about the serviceability-dev mailing list