luciusDXL / TheForceEngine

Modern "Jedi Engine" replacement supporting Dark Forces, mods, and in the future Outlaws.
https://TheForceEngine.github.io
GNU General Public License v2.0
969 stars 72 forks source link

[🐛][🐧] Memory corruption when DARKPILO.CFG is not correctly loaded #437

Closed JakeSmarter closed 4 weeks ago

JakeSmarter commented 1 month ago

Flatpak Linux v1.10.000-28-ge19bcde1+

Launch a game. Try to switch to “Classic (Software)” and back to “GPU / OpenGL” while not resuming the game.

Thread 1 "theforceengine" received signal SIGSEGV, Segmentation fault.
0x0000aaaaaab32ec4 in TFE_DarkForces::hud_drawElementToScreen (elem=0x0, rect=rect@entry=0xaaaaaafe6168 <TFE_Jedi::s_screenRect+16>, x0=x0@entry=0, y0=y0@entry=0, framebuffer=0x0)
    at /run/build/tfe/TheForceEngine/TFE_DarkForces/hud.cpp:1349
warning: Source file is more recent than executable.
1349            s32 x1 = x0 + elem->width - 1;
#0  0x0000aaaaaab32ec4 in TFE_DarkForces::hud_drawElementToScreen (elem=0x0, rect=rect@entry=0xaaaaaafe6168 <TFE_Jedi::s_screenRect+16>, x0=x0@entry=0, y0=y0@entry=0, framebuffer=0x0)
    at /run/build/tfe/TheForceEngine/TFE_DarkForces/hud.cpp:1349
#1  0x0000aaaaaab18704 in TFE_DarkForces::escapeMenu_draw (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:466
#2  0x0000aaaaaab19380 in TFE_DarkForces::escapeMenu_update () at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:547
#3  0x0000aaaaaab37ff4 in TFE_DarkForces::mission_mainTaskFunc (msg=<optimized out>) at /run/build/tfe/TheForceEngine/TFE_DarkForces/mission.cpp:594
#4  0x0000aaaaaabc3544 in TFE_Jedi::task_run () at /run/build/tfe/TheForceEngine/TFE_Jedi/Task/task.cpp:580
#5  0x0000aaaaaaab6ea8 in main (argc=1, argv=0xffffffffebd8) at /run/build/tfe/TheForceEngine/main.cpp:867

@fpiesche Now we get a chance to test the Flatpak .Debug extension. :wink:

mlauss2 commented 1 month ago

I tried to reproduce this on x86 for around 10 minutes, but cannot trigger any fault. Which level did you launch before trying this?

"elem" being a nullptr can happen in TFE_DarkForces/GameUI/escapeMenu.cpp::224, but then you should get a SIGSEGV at the memset in line 226, not suddenly so far down the callchain. Maybe some compiler misoptimization?

JakeSmarter commented 1 month ago

Which level did you launch before trying this?

SECBASE but it actually does not matter. This time, I launched a game in “Classic (Software)” mode first, went into the graphics menu, selected “GPU / OpenGL”, and pressed Esc.

Thread 1 "theforceengine" received signal SIGSEGV, Segmentation fault.
TFE_RenderBackend::getRenderTargetTexture (rtHandle=0x0) at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderTarget.h:25
25      inline const TextureGpu* getTexture(s32 index = 0) const { return m_texture[index]; }
#0  TFE_RenderBackend::getRenderTargetTexture (rtHandle=0x0) at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderTarget.h:25
#1  0x0000aaaaaab180b4 in TFE_DarkForces::escapeMenu_drawGpu (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:316
#2  0x0000aaaaaab18744 in TFE_DarkForces::escapeMenu_draw (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:396
#3  0x0000aaaaaab19380 in TFE_DarkForces::escapeMenu_update () at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:547
#4  0x0000aaaaaab37ff4 in TFE_DarkForces::mission_mainTaskFunc (msg=<optimized out>) at /run/build/tfe/TheForceEngine/TFE_DarkForces/mission.cpp:594
#5  0x0000aaaaaabc3544 in TFE_Jedi::task_run () at /run/build/tfe/TheForceEngine/TFE_Jedi/Task/task.cpp:580
#6  0x0000aaaaaaab6ea8 in main (argc=1, argv=0xffffffffebe8) at /run/build/tfe/TheForceEngine/main.cpp:867

Maybe some compiler misoptimization?

I do not think so. Nothing fancy here, just the usual -O2 when CMake builds RelWithDebInfo.

JakeSmarter commented 1 month ago

This time I got a SIGABRT in “Classic (Software)” mode without switch the renderer. TFE just crashed mid game in a gdb session. :thinking: I do not think it is a hardware memory bug because other stuff would be crashing too.

corrupted double-linked list

Thread 1 "theforceengine" received signal SIGABRT, Aborted.
0x0000fffff7726a00 in __pthread_kill_implementation () from /usr/lib/aarch64-linux-gnu/libc.so.6
#0  0x0000fffff7726a00 in __pthread_kill_implementation () from /usr/lib/aarch64-linux-gnu/libc.so.6
#1  0x0000fffff76dfc6c in raise () from /usr/lib/aarch64-linux-gnu/libc.so.6
#2  0x0000fffff76cad3c in abort () from /usr/lib/aarch64-linux-gnu/libc.so.6
#3  0x0000fffff771a5c4 in __libc_message () from /usr/lib/aarch64-linux-gnu/libc.so.6
#4  0x0000fffff7731298 in malloc_printerr () from /usr/lib/aarch64-linux-gnu/libc.so.6
#5  0x0000fffff7731ae0 in unlink_chunk.isra () from /usr/lib/aarch64-linux-gnu/libc.so.6
#6  0x0000fffff7734aa4 in _int_malloc () from /usr/lib/aarch64-linux-gnu/libc.so.6
#7  0x0000fffff7735070 in _int_memalign () from /usr/lib/aarch64-linux-gnu/libc.so.6
#8  0x0000fffff77357c8 in _mid_memalign.isra.0 () from /usr/lib/aarch64-linux-gnu/libc.so.6
#9  0x0000fffff7737008 in posix_memalign () from /usr/lib/aarch64-linux-gnu/libc.so.6
#10 0x0000ffffeaa5ae7c in llvmpipe_resource_create_all.constprop () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#11 0x0000ffffea9c6164 in u_upload_alloc () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#12 0x0000ffffea9c6318 in u_upload_data () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#13 0x0000ffffeaa81140 in llvmpipe_set_constant_buffer () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#14 0x0000ffffea750330 in st_upload_constants () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#15 0x0000ffffea4fa0f0 in st_prepare_draw () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#16 0x0000ffffea6797e4 in _mesa_validated_drawrangeelements () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#17 0x0000ffffea67ac74 in _mesa_DrawElementsBaseVertex () from /usr/lib/aarch64-linux-gnu/GL/default/lib/dri/swrast_dri.so
#18 0x0000aaaaaabe0818 in TFE_PostProcess::drawRectangle () at /run/build/tfe/TheForceEngine/TFE_PostProcess/postprocess.cpp:362
#19 TFE_PostProcess::execute () at /run/build/tfe/TheForceEngine/TFE_PostProcess/postprocess.cpp:350
#20 0x0000aaaaaabea06c in TFE_RenderBackend::drawVirtualDisplay () at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp:701
#21 0x0000aaaaaabea118 in TFE_RenderBackend::swap (blitVirtualDisplay=blitVirtualDisplay@entry=true) at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderBackend.cpp:246
#22 0x0000aaaaaaab6f40 in main (argc=1, argv=0xffffffffebe8) at /run/build/tfe/TheForceEngine/main.cpp:897
JakeSmarter commented 1 month ago

Got it again when switching from “Classic (Software)” to “GPU / OpenGL”. Hence, it is reproducible.

Thread 1 "theforceengine" received signal SIGSEGV, Segmentation fault.
TFE_RenderBackend::getRenderTargetTexture (rtHandle=0x0) at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderTarget.h:25
25      inline const TextureGpu* getTexture(s32 index = 0) const { return m_texture[index]; }
#0  TFE_RenderBackend::getRenderTargetTexture (rtHandle=0x0) at /run/build/tfe/TheForceEngine/TFE_RenderBackend/Win32OpenGL/renderTarget.h:25
#1  0x0000aaaaaab180b4 in TFE_DarkForces::escapeMenu_drawGpu (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:316
#2  0x0000aaaaaab18744 in TFE_DarkForces::escapeMenu_draw (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:396
#3  0x0000aaaaaab19380 in TFE_DarkForces::escapeMenu_update () at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:547
#4  0x0000aaaaaab37ff4 in TFE_DarkForces::mission_mainTaskFunc (msg=<optimized out>) at /run/build/tfe/TheForceEngine/TFE_DarkForces/mission.cpp:594
#5  0x0000aaaaaabc3544 in TFE_Jedi::task_run () at /run/build/tfe/TheForceEngine/TFE_Jedi/Task/task.cpp:580
#6  0x0000aaaaaaab6ea8 in main (argc=1, argv=0xffffffffebe8) at /run/build/tfe/TheForceEngine/main.cpp:867

The SIGABRT may be limited to the Mesa 3D software renderer only.

JakeSmarter commented 1 month ago
Thread 1 "theforceengine" received signal SIGSEGV, Segmentation fault.
0x0000aaaaaab32ec4 in TFE_DarkForces::hud_drawElementToScreen (elem=0x0, rect=rect@entry=0xaaaaaafe6168 <TFE_Jedi::s_screenRect+16>, x0=x0@entry=0, y0=y0@entry=0, framebuffer=0x0)
    at /run/build/tfe/TheForceEngine/TFE_DarkForces/hud.cpp:1349
1349            s32 x1 = x0 + elem->width - 1;
#0  0x0000aaaaaab32ec4 in TFE_DarkForces::hud_drawElementToScreen (elem=0x0, rect=rect@entry=0xaaaaaafe6168 <TFE_Jedi::s_screenRect+16>, x0=x0@entry=0, y0=y0@entry=0, framebuffer=0x0)
    at /run/build/tfe/TheForceEngine/TFE_DarkForces/hud.cpp:1349
#1  0x0000aaaaaab18704 in TFE_DarkForces::escapeMenu_draw (drawMouse=drawMouse@entry=4294967295, drawBackground=drawBackground@entry=4294967295) at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:466
#2  0x0000aaaaaab19380 in TFE_DarkForces::escapeMenu_update () at /run/build/tfe/TheForceEngine/TFE_DarkForces/GameUI/escapeMenu.cpp:547
#3  0x0000aaaaaab37ff4 in TFE_DarkForces::mission_mainTaskFunc (msg=<optimized out>) at /run/build/tfe/TheForceEngine/TFE_DarkForces/mission.cpp:594
#4  0x0000aaaaaabc3544 in TFE_Jedi::task_run () at /run/build/tfe/TheForceEngine/TFE_Jedi/Task/task.cpp:580
#5  0x0000aaaaaaab6ea8 in main (argc=1, argv=0xffffffffebe8) at /run/build/tfe/TheForceEngine/main.cpp:867

This one happens reproduceably when switching from “GPU / OpenGL” to “Classic (Software)”.

mlauss2 commented 1 month ago

can you please post a screenshot of all your settings please? I can't even reproduce it with clang+lld...

JakeSmarter commented 1 month ago

can you please post a screenshot of all your settings please?

I am not sure what you mean by this but here is my settings.ini:

[Window]
x=0
y=64
width=1920
height=1080
baseWidth=1280
baseHeight=720
fullscreen=true
[Graphics]
gameWidth=1920
gameHeight=1080
fov=120
widescreen=true
asyncFramebuffer=true
gpuColorConvert=true
colorCorrection=true
perspectiveCorrect3DO=false
extendAjoinLimits=true
vsync=true
show_fps=true
3doNormalFix=false
ignore3doLimits=true
ditheredBilinear=false
useBilinear=true
useMipmapping=true
bilinearSharpness=0.000
anisotropyQuality=0.000
frameRateLimit=60
brightness=1.000
contrast=1.000
saturation=1.000
gamma=1.000
reticleEnable=true
reticleIndex=6
reticleRed=0.000
reticleGreen=1.000
reticleBlue=0.000
reticleOpacity=1.000
reticleScale=1.000
bloomEnabled=true
bloomStrength=0.333
bloomSpread=0.500
renderer=1
colorMode=2
skyMode=0
[Enhancements]
hdTextures=0
hdSprites=0
hdHud=0
[Hud]
hudScale="Proportional"
hudPos="Edge"
scale=1.000
pixelOffsetLeft=0
pixelOffsetRight=0
pixelOffsetY=0
[Sound]
masterVolume=1.000
soundFxVolume=1.000
musicVolume=0.000
cutsceneSoundFxVolume=1.000
cutsceneMusicVolume=0.750
audioDevice=0
midiOutput=0
midiType=1
use16Channels=true
disableSoundInMenus=false
[System]
gameExitsToMenu=true
returnToModLoader=true
gifRecordingFramerate=18.000
[A11y]
language="en"
lastFontPath=""
showCutsceneSubtitles=false
showCutsceneCaptions=false
cutsceneFontSize=1
cutsceneFontColor=-1
cutsceneTextBackgroundAlpha=0.000
showCutsceneTextBorder=false
cutsceneTextSpeed=1.000
showGameplaySubtitles=false
showGameplayCaptions=false
gameplayFontSize=0
gameplayFontColor=-1
gameplayTextBackgroundAlpha=0.000
showGameplayTextBorder=false
gameplayMaxTextLines=3
gameplayTextSpeed=1.000
gameplayCaptionMinVolume=32
enableHeadwave=false
disableScreenFlashes=false
disablePlayerWeaponLighting=false
[Game]
game="Dark Forces"
[Dark_Forces]
sourcePath="~/.var/app/io.github.theforceengine.tfe/data/"
emulatorPath=""
airControl=0
bobaFettFacePlayer=false
smoothVUEs=false
disableFightMusic=false
enableAutoaim=true
showSecretFoundMsg=true
autorun=false
crouchToggle=false
ignoreInfLimit=true
stepSecondAlt=false
pitchLimit=3
solidWallFlagFix=true
[Outlaws]
sourcePath="~/.var/app/io.github.theforceengine.tfe/data/"
emulatorPath=""
[CVar]
mlauss2 commented 1 month ago

Tried with your settings, still cannot reproduce on x86. Give me some time to get some linux-capable ARM64 hardware and I'll try that again.

JakeSmarter commented 1 month ago

I think I have fixed it. The cause turns out to be that TFE does not load DARKPILO.CFG properly. This was something that has been bothering me since I have installed TFE because I could not create an agent. I was getting this:

[Error : Agent] Cannot open DarkPilo.cfg

To reproduce, try to place an empty (0 size) DARKPILO.CFG in $XDG_CONFIG_HOME. Start a new game. Watch how when you create a new agent the text is garbled. Note that you can also continue to start a mission. Try to toggle the renderer then and you should get that behavior I have reported initially.

The reason for this whole mess is that TFE on POSIX systems does not search nor creates files in a case insensitive manner, as it is on Windows and DOS. More specifically, if the original DARKPILO.CFG in any of the game data directories is not in upper case then reading it fails and TFE creates an empty DARKPILO.CFG in $XDG_CONFIG_HOME. This is what started all this trouble.

408 is related.

mlauss2 commented 1 month ago

Ah cool, I can see the darkpilo.cfg error, let me try to fix that.

mlauss2 commented 1 month ago

@JakeSmarter : Please try this branch https://github.com/mlauss2/TheForceEngine/tree/darkpilofix

Now the log just says:

[Error : DarkForcesMain] DARKPILO.CFG corrupted; creating new
luciusDXL commented 1 month ago

Thanks for the heads up, I will look at that code again - it should create a new file if the existing file is invalid, but it is probably not properly checking the size (or if the read is successful).

JakeSmarter commented 1 month ago

@mlauss2 darkpilofix properly creates a new $XDG_CONFIG_HOME/DARKPILO.CFG but still does not read (or copy) an existing DARKPILO.CFG in the game data directory if the file name is not all caps.

mlauss2 commented 1 month ago

@JakeSmarter you are absolutely correct; I tweaked the fix and added another patch to fix the import DaRkPiLo.CfG files from the Dark Forces data directory. Please throw away your copy of the "darkpilo" branch and repull it, thank you!

JakeSmarter commented 1 month ago

v1.10.000-29-g51e3271a: Works as expected. With DARKPILO.CFG properly loaded the initial SIGSEGV behavior when switching renderers is gone. Good job! :+1: You have fixed it. :smile:

However, I am getting other file warnings which may or may not be related because it looks like it is also about file names. But, I am not completely sure because these seem like file names in .GOB files?

[Player] Setting up level 'ROBOTICS'
[Warning : level_loadGeometry] Could not open 'RWDANGER.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWDIRTY1.BM', using 'default.bm' instead.

“Jabba’s Ship” level seems to suffer most:

[Player] Setting up level 'JABSHIP'
[Player] Player Inventory copied, size = 140
[Warning : level_loadGeometry] Could not open 'BANSIGN1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'KTEXT.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'TIEWNG2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZACOMP3.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZASWIT13.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZASWIT15.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZASWIT20.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZASWITO0.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZASWITO6.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZDALARM.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZDARMOR1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZDCARGO1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPBRICK4.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPCARGO1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPDIMNDY.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPGRTE2X.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPGRTE4X.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPGRTE7Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPHTECZ2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPIMP03.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPIMP04.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPIMP05.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPINT18.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPINT21Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT02X.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT02Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT05.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT07.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT11.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT12.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT13X.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPLIT13Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPMARBE1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPMARBR1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPPANEL2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPPANEL4.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPPOOLG3.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPRIVET2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPROCK01.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP01.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP02.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP03.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP04.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP05.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP07.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP08.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSIMP10.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSLOT4Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSLOT5X.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSLOT5Y.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSTOND1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSTOND2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPSTONRD.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPTECH1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPTECH2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZPTILE1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSBARTEC.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSCOMP1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSCOMP2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSREBEL1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSREBEL2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSREBEL4.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZSREBEL5.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWBARLT3.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWBCLIFF.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWBORDER.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWCLIFDK.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWCMENT6.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWDSTAR1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWDSTAR2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWEXT02L.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWEXT05L.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWEXT06D.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWEXT07D.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWEXT10.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWGRUV1D.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT02.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT04.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT05.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT07.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT09.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT10.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT11.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT13.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT15.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT16.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWILIT17.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWINT03.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWINT17.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWMARBL1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWMARBL2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWPANEL2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWPANLC2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWRULER.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWSEAM1.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWSEAM2.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWSEAM3.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWSEAM4.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWSTRIP4.BM', using 'default.bm' instead.
[Warning : INF] Unknown elevator command - 'EVENT_MASK'.
[Warning : level_loadINF] Hit the end of INF 'JABSHIP' before parsing all items: 65/100
mlauss2 commented 1 month ago

looks like textures.gob is missing? but only at jabship? is this a mod?

i just got linux booting on this wretched arm64 laptop; give me a few days so i can install a complete dev environment.

JakeSmarter commented 1 month ago

looks like textures.gob is missing?

Nop, everything is right there and I cannot make out any lacking textures in the game either. The level plays fine.

is this a mod?

Nop, pure vanilla.

i just got linux booting on this wretched arm64 laptop; give me a few days so i can install a complete dev environment.

I do not think this an architecture issue. The only thing that comes to my mind what could be going wrong is that for some texture reads the path to TEXTURES.GOB may be malformed, e.g. due to case sensitivity or because of \ instead of / on POSIX systems.

mlauss2 commented 1 month ago

please post the output of "ls -la" of your Dark Forces directory I made all filenames of the dark forces directory lower case, it still works flawlessly, at least on x86.

luciusDXL commented 1 month ago

v1.10.000-29-g51e3271a: Works as expected. With DARKPILO.CFG properly loaded the initial SIGSEGV behavior when switching renderers is gone. Good job! 👍 You have fixed it. 😄

However, I am getting other file warnings which may or may not be related because it looks like it is also about file names. But, I am not completely sure because these seem like file names in .GOB files?

[Player] Setting up level 'ROBOTICS'
[Warning : level_loadGeometry] Could not open 'RWDANGER.BM', using 'default.bm' instead.
[Warning : level_loadGeometry] Could not open 'ZWDIRTY1.BM', using 'default.bm' instead.

“Jabba’s Ship” level seems to suffer most:

[Player] Setting up level 'JABSHIP'
[Player] Player Inventory copied, size = 140
[Warning : level_loadGeometry] Could not open 'BANSIGN1.BM', using 'default.bm' instead.
... many missing files ...
[Warning : INF] Unknown elevator command - 'EVENT_MASK'.
[Warning : level_loadINF] Hit the end of INF 'JABSHIP' before parsing all items: 65/100

Dark Forces levels have warnings - but they don't effect the gameplay itself. There are many textures in JABSHIP that are not referenced, or are referenced by areas you never see. These files just don't exist in the vanilla GOB files. You get the same warnings on Windows as well. The level also has an INF error, but that exists in vanilla as well - it results in a command being ignored (but the level would probably break if it was restored since it was tested this way).

This isn't a Linux path issue - GOBs and other archives act the same on Linux and Windows when accessing internal files. You can ignore these warnings when playing the game, there is no good way to fix it without changing the original data (and it wouldn't change the play experience anyway, as mentioned above).

luciusDXL commented 1 month ago

I changed the name of this issue to better reflect the actual bug- it doesn't have anything to do with the renderers, but instead is an issue when unable to load or create the DARKPILO.CFG file.

JakeSmarter commented 1 month ago

These files just don't exist in the vanilla GOB files. You get the same warnings on Windows as well.

I thought so too but was not sure and unaware that this is expected behavior on Windows too. Well, it looks like we tracked it down then. :+1: Good job guys. @luciusDXL, I guess you can close this issue once you have a patch merged.