mvdevs / jk2mv

JK2MV - improved, modernized JK2 client and server
https://jk2mv.org
GNU General Public License v2.0
108 stars 33 forks source link

Server crashes with large number of .pk3 files #147

Closed UncannyFish closed 1 year ago

UncannyFish commented 2 years ago

When I try to launch JK2MV server with 1141 .pk3 files in base folder, it crashes with error *** buffer overflow detected *** I've compiled JK2MV https://github.com/mvdevs/jk2mv/commit/3bdba645b413166594c561c06f3d932825716792 and MVSDK https://github.com/mvdevs/mvsdk/commit/1e3dd0b4ea9411951ce8bb76a68f7b81a4b46854 on Ubuntu 20.04 64 bit using GCC 9.4.0 crashlog-2022-06-05_06-41-08.txt

It looks like some limit around 1024, because it works with 1009 files. But I can't find it.

aufau commented 2 years ago

Hi, thanks for report. I've got some patches that fix the crash and theoretically allow for more pk3 files (although I expect the engine to hit other limits when these pk3s actually contain various assets). Would you care to test it? Unfortunately I can't provide a build until it is merged into main jk2mv repo, patches are in this branch: https://github.com/aufau/jk2mv/tree/faufixes

UncannyFish commented 2 years ago

I don't have server with that many .pk3 files anymore. I've used this fix before my server is gone: https://github.com/mvdevs/jk2mv/commit/4fa8f7564c1a3050069df40caa68e664d5f9518c

aufau commented 1 year ago

Fixed in recent patches. jk2mv allows up to 4096 pk3 files and you can raise it with -maxfds commandline parameter. On top of it it quits with normal error message instead of crash when limit is exceed.