Openapoc: [CRASH] when start alien invasion mission in building after center camera on it from Message Log (segmentation fault)

Created on 21 Mar 2019  路  4Comments  路  Source: OpenApoc/OpenApoc

When I select "alien spotted" to focus camera view on Megapol building and Valkyria with agents flied into it. After click on icon to start alien invasion mission the game crashes. Sometimes on loading screen.

Video with bug presentation: https://youtube.com/video/OivfcPrhfVE/

Guided by @FranciscoDA I tried to start with args
--Framework.Renderers=GL_2_0
--Framework.Renderers=GLES_3_0
--Framework.Data.ImageSetCacheSize=10000

Compiled on Linux Mint 19.1 with g++ and clang++
Bug persist with different versions on linux nVIDIA drivers and opensource nouveau driver.

save_Atrosha Strategy.save.gz

gdb_output.txt

!BUG! HIGH PRIORITY

Most helpful comment

The root cause of this issue is when a thread other than the "main" renderer thread tries to load an image, it may cause a cached image to be deleted - and if that was used in the renderer it will also destroy the renderer's private data in a thread where the GL context isn't bound, which is undefined (and indeed some drivers crash or abort). This also can cause crashes at exit for a similar reason - where the renderer (and GL context) are destroyed before the last Images are.

The fix for this would be have a threaded renderer, so all the render ops are called from the same thread as the context is bound - I have some prototypes of this hanging around, but never got around to merging - as it happens none of the drivers I happen to use crash - they just spit out a warning and never destroy the texture (effectively leaking)

All 4 comments

In result of our prospects with @FranciscoDA we found the origin that causes a crash:
chat

I attach full log with GL debug info:
debug_stderr_glinfo_output.txt

For now to avoid the crash use --Game.ASyncLoading=0 --Framework.Data.ImageCacheSize=100000 --Framework.Data.ImageSetCacheSize=100000 as game parameters.

It causes cache handler to do not delete textures, when cache filled up.

The root cause of this issue is when a thread other than the "main" renderer thread tries to load an image, it may cause a cached image to be deleted - and if that was used in the renderer it will also destroy the renderer's private data in a thread where the GL context isn't bound, which is undefined (and indeed some drivers crash or abort). This also can cause crashes at exit for a similar reason - where the renderer (and GL context) are destroyed before the last Images are.

The fix for this would be have a threaded renderer, so all the render ops are called from the same thread as the context is bound - I have some prototypes of this hanging around, but never got around to merging - as it happens none of the drivers I happen to use crash - they just spit out a warning and never destroy the texture (effectively leaking)

We can try together.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BeornTB picture BeornTB  路  3Comments

FilmBoy84 picture FilmBoy84  路  3Comments

FilmBoy84 picture FilmBoy84  路  3Comments

makus82 picture makus82  路  3Comments

FilmBoy84 picture FilmBoy84  路  3Comments