Skip to content

Only the first native-image run yields a working image #2554

@informarte

Description

@informarte

Description of issue

I am experiencing a compilation issue: In my project, only the first native-image run yields a working image, all following runs result in a crashing image. To make native-image work again, I have to kill the native-image daemon.

Steps to reproduce this issue

  1. Download sources
git clone https://github.com/informarte/yuck
cd yuck
git checkout native-image-compilation-issue
  1. Stop any running native-image daemon

  2. Build and run the binary

make NATIVE=1 native-image && ./target/native-image/yuck

This should produce a help message.

  1. Rebuild and rerun the binary
rm target/native-image/yuck && make NATIVE=1 native-image && ./target/native-image/yuck

This should produce the following stack trace:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:290)
	at java.lang.Class.ensureInitialized(DynamicHub.java:499)
	at yuck.flatzinc.runner.FlatZincRunner.main(FlatZincRunner.scala)
Caused by: java.lang.ClassCastException: yuck.util.logging.ManagedLogManager cannot be cast to yuck.util.logging.ManagedLogManager
	at yuck.util.logging.YuckLogging.$init$(YuckLogging.scala:12)
	at yuck.flatzinc.runner.FlatZincRunner$.<clinit>(FlatZincRunner.scala:22)
	at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:350)
	at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:270)
	... 2 more
  1. Goto step 2

Environment

  • GraalVM version: CE 20.1.0
  • JDK major version: 11
  • OS: Linux 4.15.0 (Ubuntu 18.04)
  • Architecture: x86_64

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions