Velaron / cs16-client

Other
78 stars 17 forks source link

when I put a bomb, the engine crashes (Ubuntu Arm64) #64

Closed ArtemS2 closed 5 months ago

ArtemS2 commented 7 months ago

Launched via gdb:

(No debugging symbols found in ./xash3d) (gdb) run Starting program: /home/artem/games/HalfLife(xash3d)/xash3d [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [New Thread 0xfffff5a5d100 (LWP 10733)] [New Thread 0xffffeaf4e100 (LWP 10735)] [New Thread 0xffffe842b100 (LWP 10737)] [New Thread 0xffffbffff100 (LWP 10738)] [New Thread 0xffffbf7ef100 (LWP 10739)] [Thread 0xffffbffff100 (LWP 10738) exited] [Thread 0xffffbf7ef100 (LWP 10739) exited] [Thread 0xffffe842b100 (LWP 10737) exited] [Thread 0xffffeaf4e100 (LWP 10735) exited] [Thread 0xfffff5a5d100 (LWP 10733) exited] process 10731 is executing new program: /home/artem/games/HalfLife(xash3d)/xash3d [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [New Thread 0xfffff5a5d100 (LWP 10743)] [New Thread 0xffffeaf4e100 (LWP 10744)] [New Thread 0xffffd3f46100 (LWP 10746)] [New Thread 0xffffd3ef6100 (LWP 10747)] [New Thread 0xffffd36e6100 (LWP 10748)] [12:45:20] Setting up renderer... [12:45:20] Custom resource propagation complete. [12:45:23] Scoring will not start until both teams have players

Thread 1 "xash3d" received signal SIGSEGV, Segmentation fault. 0x0000ffffea3c3c14 in RadiusDamage(Vector, entvars_s, entvars_s, float, float, int, int) () from cstrike/dlls/cs_arm64.so (gdb) bt

0 0x0000ffffea3c3c14 in RadiusDamage(Vector, entvars_s, entvars_s, float, float, int, int) () from cstrike/dlls/cs_arm64.so

1 0x0000ffffea39a98c in CBaseMonster::RadiusDamage(entvars_s, entvars_s, float, int, int) () from cstrike/dlls/cs_arm64.so

2 0x0000ffffea3e2030 in CGrenade::Explode2_OrigFunc(TraceResult*, int) ()

from cstrike/dlls/cs_arm64.so

3 0x0000ffffea3e91c8 in IHookChainClassImpl<void, CGrenade, TraceResult, int>::callNext(CGrenade, TraceResult*, int) () from cstrike/dlls/cs_arm64.so

4 0x0000ffffea3e89b8 in IHookChainRegistryClassImpl<void, CGrenade, TraceResult, int>::callChain(void (CGrenade::)(TraceResult, int), CGrenade, TraceResult*, int) () from cstrike/dlls/cs_arm64.so

5 0x0000ffffea3e18bc in CGrenade::Explode2(TraceResult*, int) ()

from cstrike/dlls/cs_arm64.so

6 0x0000ffffea3e4504 in CGrenade::Detonate2() ()

from cstrike/dlls/cs_arm64.so

7 0x0000ffffea38e7c0 in CBaseEntity::Think() () from cstrike/dlls/cs_arm64.so

8 0x0000ffffea3a97c8 in DispatchThink(edict_s*) ()

from cstrike/dlls/cs_arm64.so

9 0x0000fffff6c84ca4 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

10 0x0000fffff6c7e064 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

11 0x0000fffff6c08a48 in ?? ()

--Type for more, q to quit, c to continue without paging-- from /home/artem/games/HalfLife(xash3d)/libxash.so

12 0x0000fffff6c0a038 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

13 0x0000fffff6c0a198 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

14 0x0000fffff6c098b0 in Host_Main ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

15 0x0000aaaaaaaa0a34 in ?? ()

16 0x0000fffff7e173fc in __libc_start_call_main (

main=main@entry=0xaaaaaaaa0980, argc=argc@entry=4, 
argv=argv@entry=0xffffffffebd8)
at ../sysdeps/nptl/libc_start_call_main.h:58

17 0x0000fffff7e174cc in __libc_start_main_impl (main=0xaaaaaaaa0980, argc=4,

argv=0xffffffffebd8, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=<optimized out>)
at ../csu/libc-start.c:392

18 0x0000aaaaaaaa0af0 in ?? ()

(gdb)

ArtemS2 commented 7 months ago

Снимок экрана от 2023-11-18 12-53-13

ArtemS2 commented 7 months ago

For some reason, when starting a local server, players are not given a knife and a pistol.(

Vladislav4KZ commented 7 months ago

For some reason, when starting a local server, players are not given a knife and a pistol.(

@ArtemS2 Make sure that you have not changed the values ​​of the following cvars:

mp_ct_give_player_knife "1"
mp_t_give_player_knife "1"
mp_ct_default_weapons_secondary "usp"
mp_t_default_weapons_secondary "glock18"
ArtemS2 commented 7 months ago

@Vladislav4KZ What file can I write them to?

Vladislav4KZ commented 7 months ago

What file can I write them to?

@ArtemS2 In general, these are cvars with default values, I don’t know in which config you have them stored if their values has been changed.

Try to copy and paste these cvars to userconfig.cfg and check if it helped.

ArtemS2 commented 7 months ago

@Vladislav4KZ Doesn't work via usercfg. It works if you enter it through the console. But when I go to the menu and create a new server, I get the “SV_Multicast” error. If you restart the engine, everything returns to normal, but the knife and pistols are not issued.

Vladislav4KZ commented 7 months ago

I get the “SV_Multicast” error.

@ArtemS2 Do you have metamod installed? This issue is related to it.

ArtemS2 commented 7 months ago

@Vladislav4KZ I didn't install metamod. How can you install it?

Vladislav4KZ commented 7 months ago

Wait a minute though, I haven’t seen the arm64 metamod builds, but I got the SV_Multicast error because of it

Vladislav4KZ commented 7 months ago

How can you install it?

I installed it on Windows x86

ArtemS2 commented 7 months ago

@Vladislav4KZ Is it possible to write here in Russian? Or is it better not to?

Vladislav4KZ commented 7 months ago

It works if you enter it through the console.

Check your configs, somewhere the values of those cvars has really been changed.

Vladislav4KZ commented 7 months ago

Is it possible to write here in Russian? Or is it better not to?

We all understand and speak Russian, me and Velaron for sure

Vladislav4KZ commented 7 months ago

Квары с userconfig.cfg не работают видимо из-за того, что они выполняются до запуска сервера.

Поэтому пистолет и нож не появляются у игрока.

Velaron commented 7 months ago

У mp_ct_give_player_knife дефолтное значение 1, не знаю каким образом оно могло поменяться на другое

ArtemS2 commented 7 months ago

я добавил квары в server.cfg и listenserver.cfg, но ничего не изменилось

Velaron commented 7 months ago

Не могу воспроизвести у себя такие проблемы и вылеты, так что пока хз что сказать, очень странное поведение...

ArtemS2 commented 7 months ago

С вылетами самое интересное , что они случаются, только когда я закладываю бомбу на локальном сервере. Если играю по итернету, с бомбой все нормально

Velaron commented 7 months ago

Ну да, потому что вылет в серверной библиотеке, которая при игре по сети не используется

ArtemS2 commented 7 months ago

А можно собрать дебаг сборку , чтоб через gdb отловить ошибку с более конкретной информацией? Или это ничего не даст?

Velaron commented 7 months ago

Если есть какие-то навыки, попробуй, потому что я не смогу это пофиксить когда это у меня не происходит

ArtemS2 commented 7 months ago

А какой флаг для cmake , чтоб debug собрать?

Velaron commented 7 months ago

Просто возьми команды с README и Release на Debug замени

ArtemS2 commented 7 months ago

Пока получил такое: (gdb) run Starting program: /home/artem/games/HalfLife(xash3d)/xash3d [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [New Thread 0xfffff5a5d100 (LWP 28805)] [New Thread 0xffffeaf4e100 (LWP 28807)] [New Thread 0xffffe842b100 (LWP 28810)] [New Thread 0xffffbffff100 (LWP 28811)] [New Thread 0xffffbf7ef100 (LWP 28812)] [Thread 0xffffbffff100 (LWP 28811) exited] [Thread 0xffffbf7ef100 (LWP 28812) exited] [Thread 0xffffe842b100 (LWP 28810) exited] [Thread 0xffffeaf4e100 (LWP 28807) exited] [Thread 0xfffff5a5d100 (LWP 28805) exited] process 28803 is executing new program: /home/artem/games/HalfLife(xash3d)/xash3d [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [New Thread 0xfffff5a5d100 (LWP 28818)] [New Thread 0xffffeaf4e100 (LWP 28819)] [New Thread 0xffffd3f46100 (LWP 28820)] [New Thread 0xffffd3ef6100 (LWP 28821)] [New Thread 0xffffd36e6100 (LWP 28822)] [14:56:11] Setting up renderer... [14:56:11] Custom resource propagation complete. [14:56:14] Scoring will not start until both teams have players

Thread 1 "xash3d" received signal SIGSEGV, Segmentation fault. 0x0000ffffea3c3c14 in RadiusDamage(Vector, entvars_s, entvars_s, float, float, int, int) () from cstrike/dlls/cs_arm64.so (gdb) bt

0 0x0000ffffea3c3c14 in RadiusDamage(Vector, entvars_s, entvars_s, float, float, int, int) () from cstrike/dlls/cs_arm64.so

1 0x0000ffffea39a98c in CBaseMonster::RadiusDamage(entvars_s, entvars_s, float, int, int) () from cstrike/dlls/cs_arm64.so

2 0x0000ffffea3e2030 in CGrenade::Explode2_OrigFunc(TraceResult*, int) ()

from cstrike/dlls/cs_arm64.so

3 0x0000ffffea3e91c8 in IHookChainClassImpl<void, CGrenade, TraceResult, int>::callNext(CGrenade, TraceResult*, int) () from cstrike/dlls/cs_arm64.so

4 0x0000ffffea3e89b8 in IHookChainRegistryClassImpl<void, CGrenade, TraceResult, int>::callChain(void (CGrenade::)(TraceResult, int), CGrenade, TraceResult*, int) () from cstrike/dlls/cs_arm64.so

5 0x0000ffffea3e18bc in CGrenade::Explode2(TraceResult*, int) ()

from cstrike/dlls/cs_arm64.so

6 0x0000ffffea3e4504 in CGrenade::Detonate2() ()

from cstrike/dlls/cs_arm64.so

7 0x0000ffffea38e7c0 in CBaseEntity::Think() () from cstrike/dlls/cs_arm64.so

8 0x0000ffffea3a97c8 in DispatchThink(edict_s*) ()

from cstrike/dlls/cs_arm64.so

9 0x0000fffff6c84ca4 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

10 0x0000fffff6c7e064 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

11 0x0000fffff6c08a48 in ?? ()

--Type for more, q to quit, c to continue without paging-- from /home/artem/games/HalfLife(xash3d)/libxash.so

12 0x0000fffff6c0a038 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

13 0x0000fffff6c0a198 in ?? ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

14 0x0000fffff6c098b0 in Host_Main ()

from /home/artem/games/HalfLife(xash3d)/libxash.so

15 0x0000aaaaaaaa0a34 in ?? ()

16 0x0000fffff7e173fc in __libc_start_call_main (

main=main@entry=0xaaaaaaaa0980, argc=argc@entry=4, 
argv=argv@entry=0xffffffffebd8)
at ../sysdeps/nptl/libc_start_call_main.h:58

17 0x0000fffff7e174cc in __libc_start_main_impl (main=0xaaaaaaaa0980, argc=4,

argv=0xffffffffebd8, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=<optimized out>)
at ../csu/libc-start.c:392

18 0x0000aaaaaaaa0af0 in ?? ()

(gdb)

Velaron commented 7 months ago

попробуй еще потыкать info args/info locals возможно сначала надо сделать select-frame 0

ArtemS2 commented 7 months ago

No symbol table info available. пишет

Velaron commented 7 months ago

попробуй сначала select-frame 0 тогда, а потом уже другие

ArtemS2 commented 7 months ago

Не хочет

ArtemS2 commented 7 months ago

(gdb) select-frame address function level view Вообще выбор по подсказкам такой

Velaron commented 7 months ago

@nekonomicon @a1batross кто может помочь с дебагом через gdb?

ArtemS2 commented 7 months ago

(gdb) info registers x0 0x0 0 x1 0xaaaaab760998 187649997801880 x2 0x83 131 x3 0x33ab731afb139328 3723196076670554920 x4 0x8080000000000000 -9187343239835811840 x5 0x6572103a1a0f1916 7309922986907080982 x6 0x16190f1a3a10f2e5 1592320548569936613 x7 0xfffff7ffdb58 281474842483544 x8 0xffffffffe378 281474976703352 x9 0x3 3 x10 0xffffffffffff1b18 -58600 x11 0xfffffcff 4294966527 x12 0x4 4 x13 0x135a0000 324665344 x14 0xe 14 x15 0xd 13 x16 0xffffea645438 281474614187064 x17 0xfffff6b53330 281474820813616 x18 0x3f 63 x19 0xaaaaaba9c000 187650001190912 x20 0xfffff6d85000 281474823114752 x21 0xaaaaab776b60 187649997892448 x22 0xaaaaab776bf0 187649997892592 --Type for more, q to quit, c to continue without paging-- x23 0xfffff6d30000 281474822766592 x24 0xaaaaab760900 187649997801728 x25 0x0 0 x26 0xaaaaab76c6ec 187649997850348 x27 0xaaaaaaab1d28 187649984503080 x28 0x0 0 x29 0xffffffffe2f0 281474976703216 x30 0xffffea3c3b5c 281474611559260 sp 0xffffffffe2f0 0xffffffffe2f0 pc 0xffffea3c3c14 0xffffea3c3c14 <RadiusDamage(Vector, entvars_s, entvars_s, float, float, int, int)+816> cpsr 0x60001000 [ EL=0 BTYPE=0 SSBS C Z ] Unable to fetch vFP/SIMD registers.: Нет такого процесса. Есть такое

ArtemS2 commented 7 months ago

info frame Stack level 0, frame at 0x0: pc = 0x0; saved pc = 0xffffea3c3b5c called by frame at 0xffffffffe2f0 Arglist at 0xffffffffe2f0, args: Locals at 0xffffffffe2f0, Previous frame's sp is 0xffffffffe2f0 Unable to fetch vFP/SIMD registers.: Нет такого процесса.

nekonomicon commented 7 months ago

кто может помочь с дебагом через gdb?

А что тут помогать? Движок нужно с дебагом пересобрать и вывод bt full в gdb получить.

a1batross commented 7 months ago

Не только движок, но и cs_arm64.so

ArtemS2 commented 7 months ago

Пересобрал все на debug баги ушли

nekonomicon commented 7 months ago

Потому что отключены оптимизации. Нужно -O1 или -O2 передать в дебаг сборках.

Velaron commented 7 months ago

попробуй тип сборки RelWithDebInfo вместо Debug

ArtemS2 commented 7 months ago

[16:05:08] Custom resource propagation complete. [16:05:08] Error: SV_Multicast: expected 0 bytes, it written 17. Ignored. [16:05:08] Error: SV_Multicast: expected 0 bytes, it written 1. Ignored. [16:05:10] Error: SV_Multicast: expected 0 bytes, it written 1. Ignored. [16:05:10] Error: SV_Multicast: expected 0 bytes, it written 1. Ignored. Только такая ошибка есть, если сервер пересоздавать

ArtemS2 commented 7 months ago

@Velaron Invalid build type. Valid are: fastnative, fast, release, debug, sanitize, msan, none Или нужно именно cs пресобрать?

ArtemS2 commented 7 months ago

@nekonomicon ./waf configure -T debug -01 --64 ?

nekonomicon commented 7 months ago

здесь значение поменять скорее всего.

a1batross commented 7 months ago

Движок:

./waf configure -T debug install --destdir="/home/artem/games/HalfLife(xash3d)"

(64 не нужен, он форсится только на x86)

ReGameDLL_CS (я тут точно не уверен, пусть @Velaron поправит меня если я не прав):

rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
make -j$(nproc)

Ну и полученный cs.so закинуть в cstrike/dlls/cs_arm64.so

Velaron commented 7 months ago

@Velaron Invalid build type. Valid are: fastnative, fast, release, debug, sanitize, msan, none Или нужно именно cs пресобрать?

Я про сборку cs16-client, сборка поддерживается только из корневой директории еще, так как там некоторые нужные переменные выставляются

a1batross commented 7 months ago

@nekonomicon не надо там ничего менять, я сомневаюсь что ошибка в движке. Движок мы более тщательно тестируем, а вот регейм наврядли кто-то компилировал под ARM64.

nekonomicon commented 7 months ago

Ну общая рекомендация при сборке с санитайзерами по крайней мере включать -O1. В обычных дебаг сборках по идее тоже полезно, потому что там с -O0 дополнительный код с защитой от переполнения включается и правило strict-aliasing не работает, это все может мешать отладке. Движок на 64 битах тоже не сказать, что хорошо отлажен.

ArtemS2 commented 7 months ago

Движок:

./waf configure -T debug install --destdir="/home/artem/games/HalfLife(xash3d)"

(64 не нужен, он форсится только на x86)

ReGameDLL_CS (я тут точно не уверен, пусть @Velaron поправит меня если я не прав):

rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
make -j$(nproc)

Ну и полученный cs.so закинуть в cstrike/dlls/cs_arm64.so

Баги не вернулись с бомбой и выдачей пистолета и ножа

ArtemS2 commented 7 months ago

@nekonomicon Ну с основной игрой ,blueshift и opof на 64 битах не было проблем

ArtemS2 commented 7 months ago

Потому что отключены оптимизации. Нужно -O1 или -O2 передать в дебаг сборках.

Изменил на 01 , тоже все нормально

nekonomicon commented 7 months ago

Попробуй -O3 тогда.

ArtemS2 commented 7 months ago

Попробуй -O3 тогда.

На 3 тоже проблем нет