beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
210 stars 100 forks source link

Engine crash when calling LuaVBOImpl::InstanceDataFromFeatureIDs on geothermal vent feature #1437

Closed salinecitrine closed 5 months ago

salinecitrine commented 5 months ago

URL of infolog.txt https://log.beyondallreason.dev/logs-20240413T1755-op_VmwQP.zip note: there's a lot of widget debugging messages in there; this crash was encountered while developing a new widget

Engine Version 105.1.1-2314-g9e0bf7d bar

Translated Stack Trace with links

(I don't know how to do this; https://imolarpg.dyndns.org/bar/stacktrace_translator/frontend/index.php didn't work)

Additional context The last log message before the crash is Error: [MatrixUploader::GetElemOffsetImpl] Supplied invalid CFeature (id:27697) (id varies).

As far as I can tell, the call sequence looks something like this:

LuaVBOImpl::InstanceDataFromFeatureIDs LuaVBOImpl::InstanceDataFromImpl LuaVBOImpl::InstanceDataFromGetData TypedStorageBufferUploader::GetElemOffset MatrixUploader::GetElemOffsetImpl Error: [MatrixUploader::GetElemOffsetImpl] Supplied invalid CFeature (id:...)

and then at some point before returning from LuaVBOImpl::InstanceDataFromFeatureIDs, it crashes.

The only feature I've seen this occur with so far is geothermal vents.

lhog commented 5 months ago

Can you send your widget so I can reproduce?

salinecitrine commented 5 months ago

Can you send your widget so I can reproduce?

Here's a minimal reproducer: https://gist.github.com/salinecitrine/c7633fc6053d20bcd907d4dfae8bc436 To reproduce, load a map with a geo, and enable the widget. Tested on "Rosetta 1.42", "Hotlips Remake 3.1.1", and "Erebos Lakes 1.0".

Here's the original widgets, with crash protection commented out: Widgets.zip To reproduce, disable "Smart Area Reclaim", enable both of these widgets, activate the reclaim command, alt+leftclick+drag starting on a tree, and expand the area to include a geo. Tested on "Hotlips Remake 3.1.1".

salinecitrine commented 5 months ago

Thank you for the quick fix!

lhog commented 5 months ago

Always a pleasure when it's easy to reproduce