-
Notifications
You must be signed in to change notification settings - Fork 71
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
[🐛][🐧] Memory corruption when DARKPILO.CFG is not correctly loaded #437
Comments
I tried to reproduce this on x86 for around 10 minutes, but cannot trigger any fault. "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? |
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
I do not think so. Nothing fancy here, just the usual |
This time I got a
|
Got it again when switching from “Classic (Software)” to “GPU / OpenGL”. Hence, it is reproducible.
The |
This one happens reproduceably when switching from “GPU / OpenGL” to “Classic (Software)”. |
can you please post a screenshot of all your settings please? |
I am not sure what you mean by this but here is my [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] |
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. |
I think I have fixed it. The cause turns out to be that TFE does not load
To reproduce, try to place an empty (0 size) 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 #408 is related. |
Ah cool, I can see the darkpilo.cfg error, let me try to fix that. |
@JakeSmarter : Please try this branch https://github.com/mlauss2/TheForceEngine/tree/darkpilofix Now the log just says:
|
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). |
@mlauss2 |
@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! |
v1.10.000-29-g51e3271a: Works as expected. With 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
“Jabba’s Ship” level seems to suffer most:
|
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. |
Nop, everything is right there and I cannot make out any lacking textures in the game either. The level plays fine.
Nop, pure vanilla.
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 |
please post the output of "ls -la" of your Dark Forces directory |
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). |
SIGSEGV
when switching “Renderer” between “GPU / OpenGL” and “Classic (Software)”
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. |
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. 👍 Good job guys. @luciusDXL, I guess you can close this issue once you have a patch merged. |
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.
@fpiesche Now we get a chance to test the Flatpak
.Debug
extension. 😉The text was updated successfully, but these errors were encountered: