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

ZoneOffsetTransition state changing during image generation #10309

Closed
galderz opened this issue Jun 26, 2020 · 3 comments
Closed

ZoneOffsetTransition state changing during image generation #10309

galderz opened this issue Jun 26, 2020 · 3 comments
Assignees
Labels
kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@galderz
Copy link
Member

galderz commented Jun 26, 2020

I've been experimenting with a branch that adds 3rd party library sources into the source cache (#10094), and that has triggered an issue similar to #9750.

Caused by: com.oracle.svm.core.util.UserError$UserException: Static field or an object referenced from a static field changed during native image generation?
  object:2014=[Ljava.time.zone.ZoneOffsetTransition;@51cbb5d  of class: java.util.concurrent.ConcurrentHashMap$Node
  reachable through:
    object: [Ljava.util.concurrent.ConcurrentHashMap$Node;@78ccb00c  of class: java.util.concurrent.ConcurrentHashMap$Node[]
    object: {2017=[Ljava.time.zone.ZoneOffsetTransition;@37d6862f, 2018=[Ljava.time.zone.ZoneOffsetTransition;@66d8e07b, 2019=[Ljava.time.zone.ZoneOffsetTransition;@17730b7e, 2020=[Ljava.time.zone.ZoneOffsetTransition;@58db713f, 2014=[Ljava.time.zone.ZoneOffsetTransition;@51cbb5d}  of class: java.util.concurrent.ConcurrentHashMap
    object: ZoneRules[currentStandardOffset=Z]  of class: java.time.zone.ZoneRules
    object: Europe/London  of class: java.time.ZoneRegion
    object: sun.util.calendar.ZoneInfo[id="Europe/London",offset=0,dstSavings=3600000,useDaylight=true,transitions=242,lastRule=java.util.SimpleTimeZone[id=Europe/London,offset=0,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]  of class: sun.util.calendar.ZoneInfo
    object: 0000-12-30T16:47:04.192Z  of class: sun.util.calendar.ImmutableGregorianDate
    object: [CommonEra (C.E.) since 0000-12-30T16:47:04.192 local time]  of class: sun.util.calendar.Era
    object: [Lsun.util.calendar.Era;@225671db  of class: sun.util.calendar.Era[]
    root: sun.util.calendar.JulianCalendar$Date.setNormalizedYear(int)

	at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.verifyTargetDidNotChange(NativeImageHeapWriter.java:130)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.writeReference(NativeImageHeapWriter.java:158)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.write(NativeImageHeapWriter.java:147)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.writeConstant(NativeImageHeapWriter.java:184)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.writeObject(NativeImageHeapWriter.java:377)
	at com.oracle.svm.hosted.image.NativeImageHeapWriter.writeHeap(NativeImageHeapWriter.java:89)
	at com.oracle.svm.hosted.image.NativeBootImage.build(NativeBootImage.java:483)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:636

Longer output.

@galderz galderz added the kind/bug Something isn't working label Jun 26, 2020
@galderz galderz self-assigned this Jun 26, 2020
@galderz galderz changed the title ZoneOffTransition state changing during image generation ZoneOffsetTransition state changing during image generation Jun 26, 2020
@galderz
Copy link
Member Author

galderz commented Jun 29, 2020

Indeed this is strictly related to the debug info integration. The issue happens because of a side effect of the code that inspects the files to add to source cache when inspecting a source root that is a -source.jar. When it does that, SourceCache invokes Files.isRegularFile which indirectly fills up the Java Time ZoneRules.lastRulesCache. When the image is written, the code discovers this change and complains. Not sure about the best fix yet.

@galderz
Copy link
Member Author

galderz commented Jun 29, 2020

FYI, the stacktrace to modifying lastRulesCache can be found here.

@galderz
Copy link
Member Author

galderz commented Jul 1, 2020

This is a GraalVM issue, not a Quarkus one. Closing this, I'll open an issue in GraalVM shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants