Mtasa-blue: Linux server freeze with empty file src

Created on 24 Dec 2018  路  9Comments  路  Source: multitheftauto/mtasa-blue

Describe the bug
If you provide resource with <file src=""/> linux server go freeze.

To reproduce
freeze.zip
just let your server load this resource. copy script into resource directory and start server, if you have linux, server will freeze.

Expected behaviour
Don't freeze and print that could not find

Screenshots
image

Version
MTA:SA Server v1.5.6-release-14688

Additional context
Working only on linux, i tested on windows and everything working.

I noticed that my server consume a lot of cpu.

bug

Most helpful comment

The server tries to generate a checksum for a directory and the implementation opens the directory with fopen, which actually works on Linux, and then reads repeatedly 65536 bytes in a loop.

https://github.com/multitheftauto/mtasa-blue/blob/13771a4f7fbe28f497a1786711e2460c31fb0f9d/Server/mods/deathmatch/logic/CResource.cpp#L553

https://github.com/multitheftauto/mtasa-blue/blob/13771a4f7fbe28f497a1786711e2460c31fb0f9d/vendor/bochs/bochs_internal/crc32.cpp#L40-L51

All 9 comments

Can't reproduce this one, I just get [14:19:17] ERROR: Couldn't find file for resource freeze (on Linux)

i can reproduce this every single time, did you download resource that i provided?
screenshot from console
image

Yes, with your resource:

start freeroam
[14:36:45] start: Requested by Console
[14:36:45] Starting freeroam
[14:36:45] start: Resource 'freeroam' started
refresh
[14:36:56] ERROR: Couldn't find file  for resource freeze
[14:36:56] Loading of resource 'freeze' failed
[14:36:56] Resources: 1 loaded, 0 failed

say hi
[14:37:00] CONSOLECHAT: hi

I'm using a custom debug build though, so it could be release-only.

proof of work
https://i.gyazo.com/47cd2c9a02bed8b069a218462a04483e.mp4 freeze after i execute /refresh command ( only resource freeze is installed )
and server files ( latest nightly )
multitheftauto_linux_x64-1.5.6-rc-16177.zip

  • Can't reproduce with R7 (build 14688) - Updated 11th October 2018 (from
    https://linux.mtasa.com/)
  • Can't reproduce with multitheftauto_linux_x64-1.5.6-rc-16177.tar.gz (from https://nightly.mtasa.com/)

Linux fez 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u1 (2018-08-03) x86_64 GNU/Linux

Linux DESKTOP-O9QIRJK 4.4.0-17134-Microsoft #471-Microsoft Fri Dec 07 20:04:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
Debian,

my linux, on my hosting provider ( serverproject.pl ) this resource also cause freeze

could someone else test it?

Can't reproduce with multitheftauto_linux_x64-1.5.6-rc-16177.tar.gz multitheftauto_linux_x64-1.4.1-rc-7382-net1D8.tar.gz (from https://nightly.mtasa.com/)

say hi
[15:18:33] CONSOLECHAT: hi
refresh
[15:18:36] ERROR: Couldn't find file  for resource freeze
[15:18:36] Loading of resource 'freeze' failed
say hi
[15:18:38] CONSOLECHAT: hi

Linux hgs 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I can reproduce the https://github.com/multitheftauto/mtasa-blue/issues/738#issuecomment-449745620 if you unzip the resource.

edit: this is actually multitheftauto_linux_x64-1.4.1-rc-7382-net1D8.tar.gz

The server tries to generate a checksum for a directory and the implementation opens the directory with fopen, which actually works on Linux, and then reads repeatedly 65536 bytes in a loop.

https://github.com/multitheftauto/mtasa-blue/blob/13771a4f7fbe28f497a1786711e2460c31fb0f9d/Server/mods/deathmatch/logic/CResource.cpp#L553

https://github.com/multitheftauto/mtasa-blue/blob/13771a4f7fbe28f497a1786711e2460c31fb0f9d/vendor/bochs/bochs_internal/crc32.cpp#L40-L51

Was this page helpful?
0 / 5 - 0 ratings