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.04k stars 435 forks source link

NPE occured from Tag.getAttributes() #365

Closed MSDehghan closed 1 year ago

MSDehghan commented 2 years ago

I was exploring the default add sample in the JITWatch and suddenly this exception was shown.


Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "org.adoptopenjdk.jitwatch.model.Tag.getAttributes()" because "<local8>" is null
        at org.adoptopenjdk.jitwatch.hotthrow.HotThrowFinder.visitTag(HotThrowFinder.java:119)
        at org.adoptopenjdk.jitwatch.hotthrow.HotThrowFinder.visitTag(HotThrowFinder.java:215)
        at org.adoptopenjdk.jitwatch.compilation.CompilationUtil.visitParseTagsOfCompilation(CompilationUtil.java:89)
        at org.adoptopenjdk.jitwatch.hotthrow.HotThrowFinder.findHotThrows(HotThrowFinder.java:94)
        at org.adoptopenjdk.jitwatch.toplist.HotThrowTopListVisitable.visit(HotThrowTopListVisitable.java:34)
        at org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor.walkPackage(TreeVisitor.java:48)
        at org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor.walkPackage(TreeVisitor.java:39)
        at org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor.walkPackage(TreeVisitor.java:39)
        at org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor.walkTree(TreeVisitor.java:29)
        at org.adoptopenjdk.jitwatch.toplist.AbstractTopListVisitable.buildTopList(AbstractTopListVisitable.java:58)
        at org.adoptopenjdk.jitwatch.ui.toplist.TopListStage.buildTableView(TopListStage.java:208)
        at org.adoptopenjdk.jitwatch.ui.toplist.TopListStage.access$100(TopListStage.java:48)
        at org.adoptopenjdk.jitwatch.ui.toplist.TopListStage$3.changed(TopListStage.java:151)
        at org.adoptopenjdk.jitwatch.ui.toplist.TopListStage$3.changed(TopListStage.java:146)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
        at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:106)
        at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
        at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
        at javafx.scene.control.ComboBoxBase.setValue(ComboBoxBase.java:151)
        at javafx.scene.control.ComboBox.updateValue(ComboBox.java:516)
        at javafx.scene.control.ComboBox$3.changed(ComboBox.java:499)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
        at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80)
        at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
        at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
        at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
        at javafx.scene.control.SelectionModel.setSelectedItem(SelectionModel.java:105)
        at javafx.scene.control.ComboBox$ComboBoxSelectionModel.lambda$new$0(ComboBox.java:556)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
        at javafx.beans.property.ReadOnlyIntegerPropertyBase.fireValueChangedEvent(ReadOnlyIntegerPropertyBase.java:78)
        at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:102)
        at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:114)
        at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
        at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:69)
        at javafx.scene.control.SingleSelectionModel.updateSelectedIndex(SingleSelectionModel.java:215)
        at javafx.scene.control.SingleSelectionModel.select(SingleSelectionModel.java:149)
        at javafx.scene.control.skin.ComboBoxListViewSkin.lambda$createListView$10(ComboBoxListViewSkin.java:558)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:348)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
        at javafx.beans.property.ReadOnlyIntegerPropertyBase.fireValueChangedEvent(ReadOnlyIntegerPropertyBase.java:78)
        at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:102)
        at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:114)
        at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
        at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:69)
        at javafx.scene.control.MultipleSelectionModelBase.select(MultipleSelectionModelBase.java:413)
        at javafx.scene.control.MultipleSelectionModelBase.clearAndSelect(MultipleSelectionModelBase.java:360)
        at javafx.scene.control.ListView$ListViewBitSetSelectionModel.clearAndSelect(ListView.java:1451)
        at com.sun.javafx.scene.control.behavior.CellBehaviorBase.simpleSelect(CellBehaviorBase.java:282)
        at com.sun.javafx.scene.control.behavior.CellBehaviorBase.doSelect(CellBehaviorBase.java:246)
        at com.sun.javafx.scene.control.behavior.CellBehaviorBase.mousePressed(CellBehaviorBase.java:176)
        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.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:3897)
        at javafx.scene.Scene.processMouseEvent(Scene.java:1878)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2623)
        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:399)
        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:557)
        at com.sun.glass.ui.View.notifyMouse(View.java:943)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        at java.base/java.lang.Thread.run(Thread.java:833)
chriswhocodes commented 2 years ago

Hi, thanks for reporting. Which JDK are you using please?

MSDehghan commented 2 years ago

Hi, this is my JDK version:


java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
chriswhocodes commented 2 years ago

Hi, I've been unable to reproduce this bug. Please could you post your hotspot log? Thanks :)