AdoptOpenJDK / jitwatch

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
Other
3.1k stars 440 forks source link

Exception when run on 23-valhalla+1-90 (2024/7/26) #390

Closed rkraneis closed 2 months ago

rkraneis commented 2 months ago
 ~/.local/jdk-23-valhalla/bin/java -jar ~/.local/jitwatch/jitwatch-ui-1.4.9-shaded-linux-x64.jar
Exception in thread "JavaFX Application Thread" java.lang.IdentityException: java.lang.Integer is not an identity class
    at java.base/java.util.WeakHashMap.newValueEntry(WeakHashMap.java:584)
    at java.base/java.util.WeakHashMap.put(WeakHashMap.java:553)
    at javafx.scene.control.SplitPane$1.onChanged(SplitPane.java:214)
    at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
    at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
    at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
    at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
    at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
    at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
    at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:162)
    at java.base/java.util.AbstractList.add(AbstractList.java:113)
    at org.adoptopenjdk.jitwatch.ui.triview.TriView.checkColumns(TriView.java:488)
    at org.adoptopenjdk.jitwatch.ui.triview.TriView.access$900(TriView.java:76)
    at org.adoptopenjdk.jitwatch.ui.triview.TriView$8.changed(TriView.java:378)
    at org.adoptopenjdk.jitwatch.ui.triview.TriView$8.changed(TriView.java:374)
    at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
    at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
    at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
    at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.scene.control.CheckBox.setSelected(CheckBox.java:157)
    at javafx.scene.control.CheckBox.fire(CheckBox.java:237)
    at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
    at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3894)
    at javafx.scene.Scene.processMouseEvent(Scene.java:1887)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2620)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
    at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
    at com.sun.glass.ui.View.notifyMouse(View.java:937)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)

Seems to be a JavaFX issue? Still wonder why this happens, as WeakHashMap should use the SOFT ValuePolicy by default ...

rkraneis commented 2 months ago

Scammers have been reported. Maybe @chriswhocodes can close the comments, if GitHub doesn't get to it, first ...

chriswhocodes commented 2 months ago

Scammer comments removed. I'll take a look at your issue.

Kinds regards,

Chris

rkraneis commented 2 months ago

Thank you for the quick reaction. Just some more datapoints:

Regarding the ValuePolicy; it seems from the stack trace above that THROW is used (WeakHashMap.java#L584). Very puzzling.

rkraneis commented 2 months ago

-Djava.util.WeakHashMap.valueKeyRetention=SOFT makes it work. I guess the JavaDoc doesn't reflect reality yet and the EA is more aggressive.

The issue therefore is actually invalid.

C1 / Level 3 assembly is found; C2 / Level 4 is probably just not generated by EA.

chriswhocodes commented 2 months ago

Hi @rkraneis I'm glad you resolved your issue.

Do you happen to have any simple self-contained Valhalla code you could contribute as a sandbox example [1] to JITWatch?

Most of the communication I've had recently regarding JITWatch is people trying out Valhalla.

Kind regards,

Chris

[1] https://github.com/AdoptOpenJDK/jitwatch/tree/master/core/src/main/resources/examples

rkraneis commented 2 months ago

Hey @chriswhocodes I will see what I can polish up; including the "official" examples from the JEP might be the most interesting right now.