feathersui / feathersui-openfl

Cross-platform graphical user interface components for creative frontend projects — powered by Haxe and OpenFL
https://feathersui.com/
Other
160 stars 16 forks source link

Exception: Null Object Reference - Rectangle.hx #164

Closed piotrzarzycki21 closed 6 months ago

piotrzarzycki21 commented 7 months ago

@joshtynjala I'm not sure where to raise this issue. It looks in the stacktrace like I should put it in openfl, but it still happened in app with feathersui, so I decided try it here. We have a crash of our Super.Human.Installer - I don't have any specific scenario for that - it happened once server is starting. If this stacktrace doesn't say anything useful I will close this issue.

[2024-02-20 16:28:34][FATAL][Genesis/Source/genesis/application/GenesisApplication.hx:557] Fatal exception : Null Object Reference
Details : Exception: Null Object Reference
Called from openfl.geom.Rectangle.boot (openfl/geom/Rectangle.hx line 63)
Called from lime.utils.ObjectPool.release (lime/utils/ObjectPool.hx line 114)
Called from openfl.display._internal.Context3DGraphics.buildBuffer (openfl/display/_internal/Context3DGraphics.hx line 366)
Called from openfl.display._internal.Context3DGraphics.render (openfl/display/_internal/Context3DGraphics.hx line 528)
Called from openfl.display._internal.Context3DGraphics.renderMask (openfl/display/_internal/Context3DGraphics.hx line 845)
Called from openfl.display._internal.Context3DShape.renderMask (openfl/display/_internal/Context3DShape.hx line 90)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawableMask (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 60)
Called from openfl.display.OpenGLRenderer.__renderDrawableMask (openfl/display/OpenGLRenderer.hx line 876)
Called from openfl.display.OpenGLRenderer.__pushMask (openfl/display/OpenGLRenderer.hx line 673)
Called from openfl.display.OpenGLRenderer.__pushMaskObject (openfl/display/OpenGLRenderer.hx line 703)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 24)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display._internal.Context3DDisplayObjectContainer.renderDrawable (openfl/display/_internal/Context3DDisplayObjectContainer.hx line 31)
Called from openfl.display.OpenGLRenderer.__renderDrawable (openfl/display/OpenGLRenderer.hx line 850)
Called from openfl.display.OpenGLRenderer.__render (openfl/display/OpenGLRenderer.hx line 764)
Called from openfl.display.Stage.__render (openfl/display/Stage.hx line 2105)
Called from openfl.display.Stage.__onLimeRender (openfl/display/Stage.hx line 2186)
Called from lime.app._Event_lime_graphics_RenderContext_Void.dispatch (lime/_internal/macros/EventMacro.hx line 91)
Called from lime._internal.backend.native.NativeApplication.handleRenderEvent (lime/_internal/backend/native/NativeApplication.hx line 375)
Called from lime._internal.backend.native.NativeApplication.exec (lime/_internal/backend/native/NativeApplication.hx line 146)
Called from lime.app.Application.exec (lime/app/Application.hx line 150)
Called from openfl.display.Application.exec (openfl/display/Application.hx line 130)
Called from ApplicationMain.create (ApplicationMain.hx line 142)
Native : null
Stack : null
joshtynjala commented 7 months ago

It appears that the crash is happening while attempting to render a display object with a mask. For some reason, the Rectangle released back to an ObjectPool is null. This ObjectPool is used internally by OpenFL, and is not exposed publicly, and objects returned to it should never be null. So it seems to be a bug in OpenFL. That's basically all that I can infer from the stack trace alone.

Can you try running with -debug? It appears that there are additional checks in ObjectPool when running debug mode that might provide additional clues by throwing an exception earlier.

piotrzarzycki21 commented 7 months ago

Can you try running with -debug?

By that do you mean run application trough IDE with -debug? Otherwise stack trace which I'm presenting is from application which were build using -debug.

joshtynjala commented 7 months ago

Okay, if you've already built with -debug, then you don't need to do anything.

The only option left is for me to try to find a way to reproduce on my machine, and to dive into the OpenFL code to figure out why a null Rectangle is incorrectly ending up in the ObjectPool.

piotrzarzycki21 commented 7 months ago

Thanks! I have two more stack traces which pointing into internal code. I will raise separated issues. All of that is not high priority. Crashes are intermittent.

joshtynjala commented 6 months ago

Closing in favor of #165.