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

Crash on 'e' clicking an assembly table in JoshariasSurvival as a client only game #2594

Closed
Cervator opened this Issue Nov 6, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@Cervator
Member

Cervator commented Nov 6, 2016

Noted during multiplayer testing. Harvest some wooden trunk blocks, craft an assembly table, place it, attempt to e click it.

Works fine as a server/client instance run locally (and in single player). Works fine if the client-only instance opens an assembly table crafted and placed by the host. Crashes if the client-only instance is the one to craft, place, and open the table.

Might be a module repo fix, but wondering if there's something we can do engine-side to better guard against this or trigger code warnings, etc?

Counting this a blocker for Alpha 6 since it puts a pretty hard limit on how far we can get in a JS multiplayer test session :-) Hi @Josharias! Save us!

15:28:53.949 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 465, netId = 1828, prefab = 'ManualLabor:PlantMatter'}
15:29:20.699 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4172, netId = 1831}
15:29:22.496 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4213, netId = 1857}
15:29:23.707 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4236, netId = 1862}
15:29:24.933 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4259, netId = 1885, prefab = 'engine:blockItemBase'}
15:29:25.445 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4274, netId = 1888}
15:29:27.243 [main] ERROR o.t.p.t.TypeSerializationLibrary - Unable to register field of type Collection: not a supported type or MappedContainer
15:29:27.244 [main] INFO  o.t.p.t.TypeSerializationLibrary - Unsupported field: 'Core:MoveItemRequest.clientSideTempEntities'
15:29:29.783 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4683, netId = 1893, prefab = 'engine:blockItemBase'}
15:29:34.898 [main] INFO  o.t.network.internal.ServerImpl - Destroying entity: EntityRef{id = 4803, netId = 1894, prefab = 'engine:blockItemBase'}
15:29:36.349 [main] ERROR o.terasology.engine.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.NullPointerException: null
	at org.terasology.machines.ui.DefaultMachineWindow.update(DefaultMachineWindow.java:279)
	at org.terasology.rendering.nui.internal.NUIManagerInternal.update(NUIManagerInternal.java:483)
	at org.terasology.engine.modes.StateIngame.updateUserInterface(StateIngame.java:239)
	at org.terasology.engine.modes.StateIngame.update(StateIngame.java:188)
	at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:413)
	at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:368)
	at org.terasology.engine.Terasology.main(Terasology.java:152)
15:29:36.349 [main] INFO  o.terasology.engine.TerasologyEngine - Shutting down Terasology...
15:29:36.360 [main] INFO  o.t.n.internal.NetworkSystemImpl - Network shutdown
15:29:36.513 [main] WARN  o.t.rendering.nui.asset.UIFormat - Field 'emptyIcon' not recognized for interface org.terasology.rendering.nui.UIWidget in {"type":"UIIconBar","id":"breathBar","icon":"engine:icons#bubble","family":"breathBar","emptyIcon":"engine:icons#burstBubble","halfIconMode":"shrink","spacing":2,"maxIcons":10,"layoutInfo":{"use-content-width":true,"use-content-height":true,"position-left":{"target":"CENTER"},"position-right":{"target":"RIGHT","widget":"healthBar"},"position-bottom":{"target":"TOP","widget":"healthBar","offset":1}}}
15:29:36.514 [main] WARN  o.t.rendering.nui.asset.UIFormat - Field 'crosshairIcon' not recognized for interface org.terasology.rendering.nui.UIWidget in {"type":"UICrosshair","id":"crosshair","crosshairIcon":"engine:gui#crosshair","layoutInfo":{"use-content-width":true,"use-content-height":true,"position-horizontal-center":{},"position-vertical-center":{}}}
15:29:36.722 [main] WARN  o.t.rendering.nui.skin.UISkinFormat - Failed to resolve UIWidget class UIInputBindButton, skipping style information

@Cervator Cervator added this to the Alpha 6 milestone Nov 6, 2016

@Josharias Josharias self-assigned this Nov 7, 2016

@Cervator

This comment has been minimized.

Show comment
Hide comment
@Cervator

Cervator Nov 25, 2016

Member

Turns out after some research by @portokaliu that this closely relates to Terasology/JoshariasSurvival#15 which is one of the few bugs I've submitted in a module tracker thinking it wasn't engine related ... and of course it turns out to be ;-)

There's a null check missing in a place that causes the crash, a few other similar places do have a null check which is then what ends up eating the first e click. The second attempt then succeeds as whatever timing issue has resolved itself and the null is no longer in place.

(I think that summarizes it ..)

Member

Cervator commented Nov 25, 2016

Turns out after some research by @portokaliu that this closely relates to Terasology/JoshariasSurvival#15 which is one of the few bugs I've submitted in a module tracker thinking it wasn't engine related ... and of course it turns out to be ;-)

There's a null check missing in a place that causes the crash, a few other similar places do have a null check which is then what ends up eating the first e click. The second attempt then succeeds as whatever timing issue has resolved itself and the null is no longer in place.

(I think that summarizes it ..)

@keturn

This comment has been minimized.

Show comment
Hide comment
@keturn

keturn Nov 26, 2016

I'm going to take a stab at clarifying DefaultMachineWindow to make it harder to run into an NPE, but this is still a good question:

Might be a module repo fix, but wondering if there's something we can do engine-side to better guard against this or trigger code warnings, etc?

What that makes me think of is an error-handling mechanism in the mainloop that logs/reports the error instead of crashing the client.

There's a hazard there of maybe getting part way through the update, erroring out, and then leaving things in an inconsistent state. But ... maybe updateUserInterface should be safe to do that with? That is, the user interface is reflecting game state, and shouldn't be modifying game state itself?

keturn commented Nov 26, 2016

I'm going to take a stab at clarifying DefaultMachineWindow to make it harder to run into an NPE, but this is still a good question:

Might be a module repo fix, but wondering if there's something we can do engine-side to better guard against this or trigger code warnings, etc?

What that makes me think of is an error-handling mechanism in the mainloop that logs/reports the error instead of crashing the client.

There's a hazard there of maybe getting part way through the update, erroring out, and then leaving things in an inconsistent state. But ... maybe updateUserInterface should be safe to do that with? That is, the user interface is reflecting game state, and shouldn't be modifying game state itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment