Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in NativeImageGenerator if something goes wrong too early #845

Closed
dmlloyd opened this issue Dec 6, 2018 · 1 comment
Closed

NPE in NativeImageGenerator if something goes wrong too early #845

dmlloyd opened this issue Dec 6, 2018 · 1 comment
Assignees

Comments

@dmlloyd
Copy link
Contributor

dmlloyd commented Dec 6, 2018

fatal error: java.lang.NullPointerException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
	at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:418)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:278)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:375)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:104)
Caused by: java.lang.NullPointerException
	at com.oracle.graal.pointsto.reports.CallTreePrinter.buildCallTree(CallTreePrinter.java:155)
	at com.oracle.graal.pointsto.reports.CallTreePrinter.print(CallTreePrinter.java:61)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:764)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:401)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image building with exit status 1

Really this comes from a bad, bad try/finally block in NativeImageGenerator. It does all kinds of things with the "bigbang" field, which is not initialized until partway through the try block, so if anything fails before that point, it blows up in the finally block leaving no hint as to what happened.

johnaohara added a commit to johnaohara/graal that referenced this issue Dec 17, 2018
@olpaw olpaw changed the title NPE in native image driver if something goes wrong too early NPE in NativeImageGenerator if something goes wrong too early Jan 16, 2019
@cstancu
Copy link
Member

cstancu commented Jan 16, 2019

This was fixed as part of 74675c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants