JDK-8194285 : tools/jimage/JImageExtractTest.java fails with java.io.IOException: "./JImageExtractTest7820094828510119097not_an_image" is not an image file
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux
  • Submitted: 2018-01-02
  • Updated: 2018-01-18
  • Resolved: 2018-01-18
Related Reports
Duplicate :  
Description
tools/jimage/JImageExtractTest.java fails with java.io.IOException: "./JImageExtractTest7820094828510119097not_an_image" is not an image file


----------System.out:(13/485)----------
Invoking testExtract
jimage [extract, /sandbox/testJDK/lib/modules]
Invoking testExtractHelp
jimage [extract, --help]
jimage [extract, --help]
Invoking testExtractToDir
jimage [extract, --dir, ./JImageExtractTest6216172566610168749, /sandbox/testJDK/lib/modules]
Invoking testExtractNoImageSpecified
jimage [extract, ]
Invoking testExtractFromDir
jimage [extract, sandbox/testJDK/lib]
Invoking testExtractNotAnImage
jimage [extract, ./JImageExtractTest7820094828510119097not_an_image]
----------System.err:(46/3154)----------
java.io.IOException: "./JImageExtractTest7820094828510119097not_an_image" is not an image file
	at java.base/jdk.internal.jimage.BasicImageReader.<init>(BasicImageReader.java:148)
	at java.base/jdk.internal.jimage.BasicImageReader.open(BasicImageReader.java:181)
	at jdk.jlink/jdk.tools.jimage.JImageTask.iterate(JImageTask.java:392)
	at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:441)
	at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:237)
	at jdk.jlink/jdk.tools.jimage.Main.run(Main.java:48)
	at JImageCliTest.jimage(JImageCliTest.java:78)
	at JImageExtractTest.testExtractNotAnImage(JImageExtractTest.java:87)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at JImageCliTest.runTests(JImageCliTest.java:111)
	at JImageExtractTest.main(JImageExtractTest.java:178)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at JImageCliTest.runTests(JImageCliTest.java:111)
	at JImageExtractTest.main(JImageExtractTest.java:178)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.RuntimeException: Output contains error, output=[]
: expected true, was false
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertTrue(Asserts.java:486)
	at JImageCliTest$JImageResult.assertShowsError(JImageCliTest.java:96)
	at JImageExtractTest.testExtractNotAnImage(JImageExtractTest.java:89)
	... 12 more
Comments
tools/jimage/JImageExtractTest.java is on test/jdk/ProblemList.txt (JDK-8170120). This test should be excluded. I will close this issue as a dup of JDK-8170120. [~mli] please follow up to run tests with the proper problem list.
18-01-2018

I'm (still) trying to create that docker setup locally. Hi [~mli] : Will you please post your Dockerfile or instructions on how to create the same setup at my end? Thanks.
18-01-2018

I suspect this issue may be due to aggressive memory usage of jimage tool. Perhaps setting -Xmx value to be some non-default large value *may* help. Given that docker installations are meant to conservative in memory usage, I'm not sure if we have to fix the test at all. Perhaps excluding it for docker platform is not a bad idea.
12-01-2018

it's reproducible. this is a issue on docker environment(as below): # cat initial.DockerFile FROM oel:7.4 ...
02-01-2018