Running native code test (original) (raw)
David Holmes david.holmes at oracle.com
Thu Dec 3 07:15:00 UTC 2015
- Previous message (by thread): RFR: JDK-8036003: Add --with-debug-symbols=[none|internal|external|zipped]
- Next message (by thread): Running native code test
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
cc'ing build-dev
On 2/12/2015 1:28 AM, Carsten Varming wrote:
Dear David,
See inline. On Tue, Dec 1, 2015 at 2:26 AM, David Holmes <david.holmes at oracle.com_ _<mailto:david.holmes at oracle.com>> wrote: Hi Carsten, On 1/12/2015 8:21 AM, Carsten Varming wrote: Dear Ioi, Absolutely, diff -r 7606b8556225 test/Makefile --- a/test/Makefile Thu Nov 26 13:13:03 2015 +0100 +++ b/test/Makefile Mon Nov 30 17:20:30 2015 -0500 @@ -156,7 +156,7 @@ TESTNATIVEDIR = $(JPRTTESTNATIVEPATH) endif ifdef TESTNATIVEDIR - JTREGNATIVEPATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVEDIR)/hotspot/jtreg/native") + JTREGNATIVEPATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVEDIR)/hotspot/jtreg/native/lib") endif
In hotspot/make/test/JtregNative.gmk we have: BUILDHOTSPOTJTREGOUTPUTDIR := $(BUILDOUTPUT)/support/test/hotspot/jtreg/native The SetupTestFilesCompilation macro adds the subdirectory "lib" to the path such that the ".so" files (or ".dylib" files) end up in $(BUILDOUTPUT)/support/test/hotspot/jtreg/native/lib.
Thanks for that. Tracing through these makefile macros is far too painful. I wish there were some way to see what they looked like once expanded.
so the above patch should not be needed.
Without the patch the following sequence of commands fails: sh configure --enable-debug make images make build-test-hotspot-jtreg-native cd hotspot/test make TESTDIRS=runtime/SameObject TESTNATIVEDIR=../../build/macosx-x8664-normal-server-fastdebug/support/test JTHOME=/Users/cvarming/workspace/jtreg/jtreg JAVAHOME=../../build/macosx-x8664-normal-server-fastdebug/images/jdk PRODUCTHOME=$JAVAHOME jtregtests TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.UnsatisfiedLinkError: no SameObject in java.library.path and java.library.path is defined by: -Djava.library.path=/Users/cvarming/workspace/jdk9-rt/hotspot/test/../../build/macosx-x8664-normal-server-fastdebug/support/test/hotspot/jtreg/native
What I see in a JPRT build is simply:
(cd /scratch/hotspot/make/test && make -r -R -I /scratch/make/common
SPEC=/scratch/build/linux-x86-normal-clientANDserver-fastdebug/spec.gmk
MAKE_LOG_FLAGS="" LOG_LEVEL=debug -f JtregNative.gmk
test-image-hotspot-jtreg-native)
On the other hand, with the patch the test runs fine. Looking at SameObject.jtr I can see: -Djava.library.path=/Users/cvarming/workspace/jdk9-rt/hotspot/test/../../build/macosx-x8664-normal-server-fastdebug/support/test/hotspot/jtreg/native/lib, i.e., "/lib" is appended to the path and the test pass. So I wonder, are these tests run by JPRT? And if they are, then what I am doing wrong?
Yes they are run (or some subset thereof). The -nativepath that gets passed to jtreg does not include a lib component.
I'm afraid I don't know what is going wrong.
David
BTW. This paths above are taken from runs on my mac. The problem also occurs on my Linux desktop.
Carsten David -----
# Expect JPRT to set JPRTARCHIVEBUNDLE (path to zip bundle for results) Carsten On Mon, Nov 30, 2015 at 5:17 PM, Ioi Lam <ioi.lam at oracle.com_ _<mailto:ioi.lam at oracle.com>> wrote: Your patch seems to have been stripped by the mailer. Is it possible to just include it as plain text in the e-mail? Thanks - Ioi On 11/30/15 1:34 PM, Carsten Varming wrote: Hi everyone, I was recently trying to run some tests that use native code, e.g., hotspot/runtime/SameObject/SameObject.java and found that I had to apply the attached diff to get the tests to work. I am doing something wrong or is this a trivial bug? Carsten
- Previous message (by thread): RFR: JDK-8036003: Add --with-debug-symbols=[none|internal|external|zipped]
- Next message (by thread): Running native code test
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]