QW-Group/ezquake-source

BUG: ezquake hangs on loading gpl maps in gpl maps pk3

Closed this issue · 3 comments

Client hangs when loading a gpl map from the pk3, if you explode them everything is fine. This problem was introduced with the api16 commit:

commit fbcf8a8 (HEAD)
Author: @qqshka ibolsunov@wallarm.com
Date: Sun Oct 22 05:21:18 2023 +0400

SERVER: add support for API16 so we could run latest KTX

Seems like there is some issues, minor testing was done under MacOS,
had to compile without optimizations since it crashed with optimizations,
unfortunatelly it doesn't crash without optimizations so was not able to debug it.

Also need to revisit cmodel.c since during "merge" it lost recent sanity checks validations.

using the old cm_loadmap function in cmodel.c (and all the functions it calls) everything works fine, otherwise it just spins at
unzReadCurrentFile(vfsz->parent->handle, buffer, sizeof(buffer));
inside of vfs_zip.c.

it looks like the new cm_loadmap calls cm_openmap which does an fs_openvfs call and that's what does it, i assume this has all already been done in the client as the old function just loads it directly with fs_loadtempfile.

@dsvensson could you take a look at this?

Doesn't hang here, but it executes code labeled as Com_DPrintf("VFSZIP_MakeActive: Shockingly inefficient\n") and ends up not finding a map that has an entry in gpl_maps.pk3. Perhaps that code path in ezQuake has not been used before as cmodel.c used to just scoop up everything including textures in memory even on servers. I'll see if I can find something.