Skip to content
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

Mem_Alloc: out of memory #36

Closed
Antom91 opened this issue Feb 11, 2025 · 45 comments
Closed

Mem_Alloc: out of memory #36

Antom91 opened this issue Feb 11, 2025 · 45 comments
Assignees
Labels
containerization-vm-restricted Issue related to restricted environment (docker,lxc,virtual machine,selinux,seccomp,audit,bpf).

Comments

@Antom91
Copy link

Antom91 commented Feb 11, 2025

Describe the bug
Sometimes I got Mem_Alloc: out of memory error message and Error: NET_StringToSockaddr: failed to create thread!
What could be the reason and how to fix it

Screenshots

Image

Please complete the following information:

  • OS and Arch: Ubuntu 22.04, x86_64
  • Engine version: Xash3D-NG (build 3602)

Additional context
The server uses YAPB bots and sometimes players join in to the server, it can work for 12+ hours and an error pops up, I didn't pay attention, maybe the server has a memory leak somewhere, the dedicated server itself only has 1 GB of RAM, I'll watch today and add information

@Mr0maks
Copy link
Collaborator

Mr0maks commented Feb 11, 2025

Hello, does its run under restricted environment (docker, lxc, selinux)?

@Antom91
Copy link
Author

Antom91 commented Feb 11, 2025

Hello, does its run under restricted environment (docker, lxc, selinux)?

yes, docker

Docker version 24.0.2, build 659604f

docker run --restart=always --name xash_public --hostname xash_public --network=host -v /opt/xashds_public:/opt/xashds_public --workdir /opt/xashds_public ubuntu:focal ./xashds -game cstrike +map de_dust2 +sv_lan 0 +public 1 +maxplayers 28 +port 27015

@Mr0maks
Copy link
Collaborator

Mr0maks commented Feb 11, 2025

Hello, does its run under restricted environment (docker, lxc, selinux)?

yes, docker

Looks like same issue: moby/moby#42680
As debug try to use --privileged and if that fixes Error: NET_StringToSockaddr: failed to create thread! so thats a clone/clone3 restriction.

@Mr0maks Mr0maks added the containerization-vm-restricted Issue related to restricted environment (docker,lxc,virtual machine,selinux,seccomp,audit,bpf). label Feb 11, 2025
@Antom91
Copy link
Author

Antom91 commented Feb 11, 2025

added --privileged to docker run, will check

@Mr0maks Mr0maks self-assigned this Feb 11, 2025
@xiaodo1337
Copy link

xiaodo1337 commented Feb 11, 2025

Today it also happend to my server, but out of memory error reported when load a map

@Antom91
Copy link
Author

Antom91 commented Feb 12, 2025

The same, again

Image

The server is worked ~ 20 hours and got Xash Error: Mem_Alloc: out of memory

@Mr0maks
Copy link
Collaborator

Mr0maks commented Feb 12, 2025

The same, again

Image

The server is worked ~ 20 hours and got Xash Error: Mem_Alloc: out of memory

To localize the problem, disable all external addons (metamod, amxx) and start the server. Also I recommend to add swap (1 - 2GB). And check that on latest commit.

@Antom91
Copy link
Author

Antom91 commented Feb 12, 2025

Image

Launched another one server in but on the latest commit bd8d0c6

Server 1: Disabled metamod and AmxModx, just clean server + YAPB Bots
Server 2: Latest commit(bd8d0c6) + Amxmodx + metamod + yapb

Let's check

@Antom91
Copy link
Author

Antom91 commented Feb 13, 2025

Both servers got an error

Also checked dmesg, and there are no messages about OOM. It looks like RAM is enough , more than 500Mb free + 2Gb of SWAP

[22:56:17] Connecting Bot...
[22:56:35] Error: NET_StringToSockaddr: failed to create thread!
[22:56:35] Error: NET_StringToSockaddr: failed to create thread!
[22:56:35] Error: NET_StringToSockaddr: failed to create thread!
[22:56:35] Error: NET_StringToSockaddr: failed to create thread!
Failed to allocate 8 megabytes of memory. Closing down.
Sys_Crash: signal 6, err 0 with code -6 at 00000001 00000000
Stack backtrace:
 1: e8323579 <__kernel_vsyscall+9> (linux-gate.so.1)
Stack dump:
 0: ffcababc
 1: 00000000
 2: ffcababc
 3: e802f416 <gsignal+198> (/lib/i386-linux-gnu/libc.so.6)
 4: 64c2e838 (./xashds)
 5: 000000fb
 6: c1ffc000
 7: 00000000
 8: 00000000
 9: 66d093e8
 10: 68071818
 11: 64b10c9e (./xashds)
 12: ffcabeb0
 13: ffcabe40
 14: ffcabe34
 15: 2a0bf400
 16: 00000001
 17: 64bc1e24 (./xashds)
 18: ffcabb58
 19: 64b10ed5 (./xashds)
 20: 64c2e838 (./xashds)
 21: 000000fb
 22: 00000000
 23: 3f800000
 24: ffcabe74
 25: ffcabe80
 26: ffcabef0
 27: 64b10c9e (./xashds)
 28: ffcabef0
 29: ffcabe80
 30: ffcabe74
 31: 64c2e838 (./xashds)
======================================
Xash Error: Sys_Crash: signal 6, err 0 with code -6 at 00000001 00000000
Stack backtrace:
 1: e8323579 <__kernel_vsyscall+9> (linux-gate.so.1)
Stack dump:
 0: ffcababc
 1: 00000000
 2: ffcababc
 3: e802f416 <gsignal+198> (/lib/i386-linux-gnu/libc.so.6)
 4: 64c2e838 (./xashds)
 5: 000000fb
 6: c1ffc000
 7: 00000000
 8: 00000000
 9: 66d093e8
 10: 68071818
 11: 64b10c9e (./xashds)
 12: ffcabeb0
 13: ffcabe40
 14: ffcabe34
 15: 2a0bf400
 16: 00000001
 17: 64bc1e24 (./xashds)
 18: ffcabb58
 19: 64b10ed5 (./xashds)
 20: 64c2e838 (./xashds)
 21: 000000fb
 22: 00000000
 23: 3f800000
 24: ffcabe74
 25: ffcabe80
 26: ffcabef0
 27: 64b10c9e (./xashds)
 28: ffcabef0
 29: ffcabe80
 30: ffcabe74
 31: 64c2e838 (./xashds)

======================================


@Antom91
Copy link
Author

Antom91 commented Feb 15, 2025

Image

Yes, last time the server was crashed on map changing

@tyabus
Copy link
Owner

tyabus commented Feb 15, 2025

Can you provide the output of the "memlist" command after a few changelevels?

@tyabus
Copy link
Owner

tyabus commented Feb 15, 2025

Pushed a commit so that it now shows the failure code on POSIX platforms, would be also great if you compiled the engine with DEBUG_RESOLVE define.

@Antom91
Copy link
Author

Antom91 commented Feb 16, 2025

hi @tyabus , thank you for your response.

Here is memlist after ~12h server working. FYI ~ after 15-20 hours the server will be crashed (according to the previous cases)

[08:01:05] memory pool list:
  size                    name

[08:01:05]   348k (  349k actual) models/player/gordon/gordon.mdl (+356232 byte change)

[08:01:05]    23k (   23k actual) models/metalplategibs_green.mdl (+23272 byte change)

[08:01:05]  3322k ( 3381k actual) maps/de_dust.bsp (+3401491 byte change)

[08:01:05]     1k (   64k actual) sprites/richo1.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/animglow01.spr (+84 byte change)

[08:01:05]     1k (   64k actual) sprites/muzzleflash3.spr (+52 byte change)

[08:01:05]     1k (   64k actual) sprites/muzzleflash2.spr (+52 byte change)

[08:01:05]     1k (   64k actual) sprites/muzzleflash1.spr (+36 byte change)

[08:01:05]    36k (   36k actual) models/agibs.mdl (+35860 byte change)

[08:01:05]    70k (   70k actual) models/hgibs.mdl (+71168 byte change)

[08:01:05]     1k (   64k actual) sprites/smoke.spr (+68 byte change)

[08:01:05]     1k (   64k actual) sprites/rifle_smoke3.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/rifle_smoke2.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/rifle_smoke1.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/pistol_smoke2.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/pistol_smoke1.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/fast_wallpuff1.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/black_smoke4.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/black_smoke3.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/black_smoke2.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/black_smoke1.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/wall_puff4.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/wall_puff3.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/wall_puff2.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/wall_puff1.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/shadow_circle.spr (+36 byte change)

[08:01:05]    79k (   79k actual) models/w_shield.mdl (+80336 byte change)

[08:01:05]    92k (   92k actual) models/p_shield.mdl (+93388 byte change)

[08:01:05]    24k (   24k actual) models/p_famas.mdl (+24368 byte change)

[08:01:05]    25k (   25k actual) models/p_galil.mdl (+25152 byte change)

[08:01:05]    24k (   24k actual) models/p_xm1014.mdl (+23832 byte change)

[08:01:05]    26k (   26k actual) models/p_elite.mdl (+26088 byte change)

[08:01:05]    22k (   22k actual) models/p_tmp.mdl (+22388 byte change)

[08:01:05]    24k (   24k actual) models/w_smokegrenade.mdl (+24104 byte change)

[08:01:05]    40k (   40k actual) models/p_sg552.mdl (+40116 byte change)

[08:01:05]    22k (   22k actual) models/p_scout.mdl (+22032 byte change)

[08:01:05]    38k (   38k actual) models/p_p90.mdl (+38716 byte change)

[08:01:05]    39k (   40k actual) models/p_ump45.mdl (+39888 byte change)

[08:01:05]    28k (   28k actual) models/p_mp5.mdl (+28180 byte change)

[08:01:05]    44k (   44k actual) models/p_mac10.mdl (+44532 byte change)

[08:01:05]    23k (   23k actual) models/p_m4a1.mdl (+23332 byte change)

[08:01:05]    23k (   23k actual) models/p_m3.mdl (+23008 byte change)

[08:01:05]    23k (   23k actual) models/p_m249.mdl (+22912 byte change)

[08:01:05]    24k (   24k actual) models/p_g3sg1.mdl (+23760 byte change)

[08:01:05]    40k (   40k actual) models/p_sg550.mdl (+40288 byte change)

[08:01:05]    24k (   24k actual) models/w_hegrenade.mdl (+24104 byte change)

[08:01:05]    24k (   24k actual) models/w_flashbang.mdl (+24104 byte change)

[08:01:05]    94k (   94k actual) models/shield/p_shield_knife.mdl (+95612 byte change)

[08:01:05]    63k (   63k actual) models/p_knife.mdl (+63632 byte change)

[08:01:05]   100k (  100k actual) models/shield/p_shield_fiveseven.mdl (+101736 byte change)

[08:01:05]    22k (   22k actual) models/p_fiveseven.mdl (+21600 byte change)

[08:01:05]   116k (  117k actual) models/shield/p_shield_usp.mdl (+118672 byte change)

[08:01:05]    38k (   38k actual) models/p_usp.mdl (+38536 byte change)

[08:01:05]   102k (  102k actual) models/shield/p_shield_smokegrenade.mdl (+103664 byte change)

[08:01:05]    26k (   26k actual) models/p_smokegrenade.mdl (+25836 byte change)

[08:01:05]   100k (  100k actual) models/shield/p_shield_p228.mdl (+101732 byte change)

[08:01:05]    22k (   22k actual) models/p_p228.mdl (+21660 byte change)

[08:01:05]    92k (   92k actual) models/shield/p_shield_glock18.mdl (+93720 byte change)

[08:01:05]    14k (   14k actual) models/p_glock18.mdl (+13588 byte change)

[08:01:05]   102k (  102k actual) models/shield/p_shield_hegrenade.mdl (+103664 byte change)

[08:01:05]    26k (   26k actual) models/p_hegrenade.mdl (+25836 byte change)

[08:01:05]   102k (  102k actual) models/shield/p_shield_flashbang.mdl (+103664 byte change)

[08:01:05]    26k (   26k actual) models/p_flashbang.mdl (+25836 byte change)

[08:01:05]   100k (  101k actual) models/shield/p_shield_deagle.mdl (+102312 byte change)

[08:01:05]    22k (   22k actual) models/p_deagle.mdl (+22180 byte change)

[08:01:05]    24k (   24k actual) models/w_c4.mdl (+23992 byte change)

[08:01:05]    26k (   26k actual) models/p_c4.mdl (+25760 byte change)

[08:01:05]    23k (   23k actual) models/p_awp.mdl (+23316 byte change)

[08:01:05]    39k (   39k actual) models/p_aug.mdl (+39792 byte change)

[08:01:05]    39k (   39k actual) models/p_ak47.mdl (+39204 byte change)

[08:01:05]  2275k ( 2275k actual) models/player/urban/urban.mdl (+2329144 byte change)

[08:01:05]  2286k ( 2286k actual) models/player/terror/terror.mdl (+2340680 byte change)

[08:01:05]  2333k ( 2334k actual) models/player/sas/sas.mdl (+2388900 byte change)

[08:01:05]  2340k ( 2340k actual) models/player/arctic/arctic.mdl (+2395944 byte change)

[08:01:05]  2287k ( 2288k actual) models/player/guerilla/guerilla.mdl (+2341764 byte change)

[08:01:05]  2280k ( 2280k actual) models/player/gsg9/gsg9.mdl (+2333832 byte change)

[08:01:05]  2125k ( 2125k actual) models/player/vip/vip.mdl (+2175676 byte change)

[08:01:05]  2275k ( 2275k actual) models/player/gign/gign.mdl (+2329328 byte change)

[08:01:05]  2346k ( 2346k actual) models/player/leet/leet.mdl (+2401992 byte change)

[08:01:05]  2275k ( 2275k actual) models/player.mdl (+2329328 byte change)

[08:01:05]     1k (   64k actual) sprites/explode1.spr (+100 byte change)

[08:01:05]     7k (    7k actual) models/grenade.mdl (+6656 byte change)

[08:01:05]     1k (   64k actual) sprites/laserdot.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/ledglow.spr (+44 byte change)

[08:01:05]     1k (   64k actual) sprites/c-tele1.spr (+228 byte change)

[08:01:05]     1k (   64k actual) sprites/b-tele1.spr (+228 byte change)

[08:01:05]     1k (   64k actual) sprites/radio.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/fexplo1.spr (+180 byte change)

[08:01:05]     1k (   64k actual) sprites/fexplo.spr (+268 byte change)

[08:01:05]     1k (   64k actual) sprites/eexplo.spr (+228 byte change)

[08:01:05]     1k (   64k actual) sprites/smokepuff.spr (+108 byte change)

[08:01:05]     1k (   64k actual) sprites/blood.spr (+100 byte change)

[08:01:05]     1k (   64k actual) sprites/bloodspray.spr (+108 byte change)

[08:01:05]     1k (   64k actual) sprites/bubble.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/steam1.spr (+156 byte change)

[08:01:05]     1k (   64k actual) sprites/WXplo1.spr (+148 byte change)

[08:01:05]     1k (   64k actual) sprites/zerogxplode.spr (+148 byte change)

[08:01:05]    30k (   30k actual) models/w_weaponbox.mdl (+30432 byte change)

[08:01:05]    23k (   23k actual) models/w_famas.mdl (+22916 byte change)

[08:01:05]   232k (  232k actual) models/v_famas.mdl (+237108 byte change)

[08:01:05]    24k (   24k actual) models/w_galil.mdl (+23668 byte change)

[08:01:05]   239k (  239k actual) models/v_galil.mdl (+244052 byte change)

[08:01:05]    18k (   18k actual) models/w_backpack.mdl (+18104 byte change)

[08:01:05]   190k (  190k actual) models/v_c4.mdl (+193812 byte change)

[08:01:05]   318k (  318k actual) models/shield/v_shield_smokegrenade.mdl (+325256 byte change)

[08:01:05]   241k (  241k actual) models/v_smokegrenade.mdl (+245788 byte change)

[08:01:05]   318k (  318k actual) models/shield/v_shield_hegrenade.mdl (+325256 byte change)

[08:01:05]   241k (  241k actual) models/v_hegrenade.mdl (+245788 byte change)

[08:01:05]   318k (  318k actual) models/shield/v_shield_flashbang.mdl (+325256 byte change)

[08:01:05]   241k (  241k actual) models/v_flashbang.mdl (+245788 byte change)

[08:01:05]    24k (   24k actual) models/w_elite.mdl (+23584 byte change)

[08:01:05]   276k (  277k actual) models/v_elite.mdl (+282524 byte change)

[08:01:05]    21k (   21k actual) models/w_tmp.mdl (+20780 byte change)

[08:01:05]   231k (  231k actual) models/v_tmp.mdl (+235904 byte change)

[08:01:05]    25k (   25k actual) models/w_mp5.mdl (+24884 byte change)

[08:01:05]   272k (  272k actual) models/v_mp5.mdl (+277576 byte change)

[08:01:05]   297k (  297k actual) models/shield/v_shield_glock18.mdl (+303636 byte change)

[08:01:05]    12k (   12k actual) models/w_glock18.mdl (+11980 byte change)

[08:01:05]   244k (  244k actual) models/v_glock18.mdl (+249084 byte change)

[08:01:05]    36k (   36k actual) models/w_knife.mdl (+35960 byte change)

[08:01:05]   482k (  483k actual) models/shield/v_shield_knife.mdl (+493444 byte change)

[08:01:05]   434k (  434k actual) models/v_knife.mdl (+443472 byte change)

[08:01:05]   296k (  296k actual) models/shield/v_shield_p228.mdl (+302296 byte change)

[08:01:05]    20k (   20k actual) models/w_p228.mdl (+20084 byte change)

[08:01:05]   230k (  230k actual) models/v_p228.mdl (+234624 byte change)

[08:01:05]    21k (   21k actual) models/w_deagle.mdl (+20572 byte change)

[08:01:05]   304k (  305k actual) models/shield/v_shield_deagle.mdl (+311280 byte change)

[08:01:05]   233k (  234k actual) models/v_deagle.mdl (+238528 byte change)

[08:01:05]    37k (   37k actual) models/w_p90.mdl (+37108 byte change)

[08:01:05]   271k (  271k actual) models/v_p90.mdl (+276704 byte change)

[08:01:05]   306k (  307k actual) models/shield/v_shield_fiveseven.mdl (+313236 byte change)

[08:01:05]    20k (   20k actual) models/w_fiveseven.mdl (+19992 byte change)

[08:01:05]   242k (  242k actual) models/v_fiveseven.mdl (+247348 byte change)

[08:01:05]    38k (   38k actual) models/w_ump45.mdl (+38280 byte change)

[08:01:05]   313k (  313k actual) models/v_ump45.mdl (+320172 byte change)

[08:01:05]    42k (   43k actual) models/w_mac10.mdl (+42956 byte change)

[08:01:05]   238k (  238k actual) models/v_mac10.mdl (+242784 byte change)

[08:01:05]     8k (    8k actual) models/pshell.mdl (+7404 byte change)

[08:01:05]   321k (  321k actual) models/shield/v_shield_usp.mdl (+328464 byte change)

[08:01:05]    37k (   37k actual) models/w_usp.mdl (+36924 byte change)

[08:01:05]   316k (  316k actual) models/v_usp.mdl (+323336 byte change)

[08:01:05]     3k (   64k actual) models/w_shotbox.mdl (+2524 byte change)

[08:01:05]    22k (   22k actual) models/w_xm1014.mdl (+22224 byte change)

[08:01:05]   243k (  243k actual) models/v_xm1014.mdl (+248212 byte change)

[08:01:05]     7k (    7k actual) models/shotgunshell.mdl (+6328 byte change)

[08:01:05]    21k (   22k actual) models/w_m3.mdl (+21456 byte change)

[08:01:05]   255k (  255k actual) models/v_m3.mdl (+260208 byte change)

[08:01:05]    38k (   38k actual) models/w_sg550.mdl (+38648 byte change)

[08:01:05]   341k (  341k actual) models/v_sg550.mdl (+348444 byte change)

[08:01:05]    38k (   38k actual) models/w_aug.mdl (+38184 byte change)

[08:01:05]   230k (  230k actual) models/v_aug.mdl (+235288 byte change)

[08:01:05]    38k (   38k actual) models/w_sg552.mdl (+38508 byte change)

[08:01:05]   318k (  318k actual) models/v_sg552.mdl (+325240 byte change)

[08:01:05]    22k (   22k actual) models/w_m4a1.mdl (+21780 byte change)

[08:01:05]   369k (  369k actual) models/v_m4a1.mdl (+377212 byte change)

[08:01:05]    21k (   21k actual) models/w_m249.mdl (+21272 byte change)

[08:01:05]   252k (  252k actual) models/v_m249.mdl (+257268 byte change)

[08:01:05]    20k (   21k actual) models/w_scout.mdl (+20480 byte change)

[08:01:05]   287k (  287k actual) models/v_scout.mdl (+293688 byte change)

[08:01:05]    37k (   37k actual) models/w_ak47.mdl (+37596 byte change)

[08:01:05]   289k (  289k actual) models/v_ak47.mdl (+295128 byte change)

[08:01:05]    10k (   10k actual) models/rshell.mdl (+9772 byte change)

[08:01:05]    22k (   22k actual) models/w_g3sg1.mdl (+22120 byte change)

[08:01:05]   305k (  306k actual) models/v_g3sg1.mdl (+312200 byte change)

[08:01:05]     2k (   64k actual) models/w_9mmclip.mdl (+1772 byte change)

[08:01:05]    10k (   10k actual) models/rshell_big.mdl (+9804 byte change)

[08:01:05]    22k (   22k actual) models/w_awp.mdl (+21676 byte change)

[08:01:05]   309k (  309k actual) models/v_awp.mdl (+315856 byte change)

[08:01:05]     8k (    8k actual) models/w_thighpack.mdl (+7752 byte change)

[08:01:05]    21k (   21k actual) models/w_assault.mdl (+21272 byte change)

[08:01:05]     7k (    7k actual) models/w_longjump.mdl (+6500 byte change)

[08:01:05]     2k (   64k actual) models/w_security.mdl (+1976 byte change)

[08:01:05]     2k (   64k actual) models/w_antidote.mdl (+1956 byte change)

[08:01:05]     5k (    5k actual) models/w_battery.mdl (+4640 byte change)

[08:01:05]    21k (   21k actual) models/w_kevlar.mdl (+21272 byte change)

[08:01:05]     1k (   64k actual) sprites/voiceicon.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/arrow1.spr (+36 byte change)

[08:01:05]     1k (   64k actual) sprites/laserbeam.spr (+36 byte change)

[08:01:05]     5k (   64k actual) Server Strings (+4478 byte change)

[08:01:05]   869k (  932k actual) Server Edicts Zone (+889168 byte change)

[08:01:05]     0k (    1k actual) Network Pool

[08:01:05]     0k (    1k actual) Studio Cache

[08:01:05]     1k (   64k actual) cstrike/tswad.wad (+928 byte change)

[08:01:05]     6k (    6k actual) cstrike/torntextures.wad (+5184 byte change)

[08:01:05]     1k (   64k actual) cstrike/prodigy.wad (+64 byte change)

[08:01:05]     1k (   64k actual) cstrike/n0th1ng.wad (+256 byte change)

[08:01:05]     4k (   64k actual) cstrike/itsitaly.wad (+3168 byte change)

[08:01:05]     8k (    8k actual) cstrike/decals.wad (+7200 byte change)

[08:01:05]     1k (   64k actual) cstrike/de_vertigo.wad (+608 byte change)

[08:01:05]     3k (   64k actual) cstrike/de_storm.wad (+2368 byte change)

[08:01:05]     5k (    6k actual) cstrike/de_piranesi.wad (+5120 byte change)

[08:01:05]     1k (   64k actual) cstrike/de_aztec.wad (+768 byte change)

[08:01:05]     3k (   64k actual) cstrike/de_airstrip.wad (+2208 byte change)

[08:01:05]     4k (   64k actual) cstrike/cstrike.wad (+3936 byte change)

[08:01:05]     1k (   64k actual) cstrike/cstraining.wad (+768 byte change)

[08:01:05]     4k (   64k actual) cstrike/cs_office.wad (+3264 byte change)

[08:01:05]     4k (   64k actual) cstrike/cs_havana.wad (+3904 byte change)

[08:01:05]     1k (   64k actual) cstrike/cs_dust.wad (+896 byte change)

[08:01:05]     2k (   64k actual) cstrike/cs_cbble.wad (+1952 byte change)

[08:01:05]     5k (    5k actual) cstrike/cs_bdog.wad (+4224 byte change)

[08:01:05]     1k (   64k actual) cstrike/cs_assault.wad (+704 byte change)

[08:01:05]     5k (    5k actual) cstrike/cs_747.wad (+4576 byte change)

[08:01:05]     5k (    5k actual) cstrike/chateau.wad (+4352 byte change)

[08:01:05]     1k (   64k actual) cstrike/cached.wad (+64 byte change)

[08:01:05]     1k (   64k actual) cstrike/ajawad.wad (+32 byte change)

[08:01:05]     9k (    9k actual) valve/xeno.wad (+8448 byte change)

[08:01:05]     1k (   64k actual) valve/spraypaint.wad (+448 byte change)

[08:01:05]     1k (   64k actual) valve/liquids.wad (+1024 byte change)

[08:01:05]    98k (   98k actual) valve/halflife.wad (+99712 byte change)

[08:01:05]     1k (   64k actual) valve/gfx.wad (+224 byte change)

[08:01:05]     1k (   64k actual) valve/fonts.wad (+96 byte change)

[08:01:05]     7k (    8k actual) valve/decals.wad (+7104 byte change)

[08:01:05]     1k (   64k actual) valve/cached.wad (+64 byte change)

[08:01:05]     0k (    1k actual) SoundLib Pool

[08:01:05]   270k (  332k actual) FileSystem Pool (+275500 byte change)

[08:01:05] 101611k (101697k actual) Zone Engine (+104048968 byte change)

[08:01:05] 216 memory pools, totalling: 139.83 Mb

[08:01:05] Total allocated size: 144.23 Mb

What do you mean DEBUG_RESOLVE ? i need to provide some variables to cmake compiler? or what? Or just compile last commit?

@Antom91
Copy link
Author

Antom91 commented Feb 16, 2025

So, launched a server with

cmake -DHL_SDK_DIR=../hlsdk -DXASH_SDL=no -DXASH_DEDICATED=yes -DXASH_VGUI=no -DCMAKE_C_FLAGS="-m32 -DDEBUG_RESOLVE" -DCMAKE_CXX_FLAGS="-m32 -DDEBUG_RESOLVE" -DCMAKE_EXE_LINKER_FLAGS="-m32" ../

and latest commit f7542214f2a6234bdbc38eaae313964c7cc9a72f

Let`s wait until the server will crash

@tyabus , not sure about DDEBUG_RESOLVE option in cmake

@tyabus
Copy link
Owner

tyabus commented Feb 18, 2025

Hello, are there any updates on this issue?

@tyabus
Copy link
Owner

tyabus commented Feb 18, 2025

@tyabus , not sure about DDEBUG_RESOLVE option in cmake

Yep, all good;
You can confirm by seeing the [resolve thread] messages in the output

@Antom91
Copy link
Author

Antom91 commented Feb 18, 2025

Hello, are there any updates on this issue?

The server has been working without crashes for the last two days
I noticed one peculiarity, all this time my server was under DDoS attack, maybe it was related to crashes?. But I had not seen such messages before the server crashed.
Image
The server is still working with recommended settings for debugging, if something happens - I will leave a message here

You can confirm by seeing the [resolve thread] messages in the output

Yes, I have such messages

@Antom91
Copy link
Author

Antom91 commented Feb 18, 2025

@tyabus looks like no, this issue is not related to DDOS

here is the latest crash log

[05:39:25] [resolve thread] exiting thread
[05:39:25] Error: unexpected master server info query packet (wrong challenge!)
[05:44:25] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[05:44:25] [resolve thread] getaddrinfo success
[05:44:25] [resolve thread] returning result
[05:44:25] [resolve thread] exiting thread
[05:44:25] [resolve thread] starting resolve for mentality.rip with getaddrinfo
[05:44:25] [resolve thread] getaddrinfo success
[05:44:25] [resolve thread] returning result
[05:44:25] [resolve thread] exiting thread
[05:44:25] [resolve thread] starting resolve for ms2.mentality.rip with getaddrinfo
[05:44:25] [resolve thread] getaddrinfo success
[05:44:25] [resolve thread] returning result
[05:44:25] [resolve thread] exiting thread
[05:44:25] [resolve thread] starting resolve for ms3.mentality.rip with getaddrinfo
[05:44:25] [resolve thread] getaddrinfo success
[05:44:25] [resolve thread] returning result
[05:44:25] [resolve thread] exiting thread
[05:44:25] [resolve thread] starting resolve for ms3.mentality.rip with getaddrinfo
[05:44:25] [resolve thread] getaddrinfo success
[05:44:25] [resolve thread] returning result
[05:44:25] [resolve thread] exiting thread
[05:44:25] Error: unexpected master server info query packet (wrong challenge!)
[05:44:33] server: Changing maps because time limit has been met
Failed to allocate 8 megabytes of memory. Closing down.
Sys_Crash: signal 6, err 0 with code -6 at 00000009 00000000
Stack backtrace:
 1: eb0f1579 <__kernel_vsyscall+9> (linux-gate.so.1)
Stack dump:
 0: ff82199c
 1: 00000000
 2: ff82199c
 3: eadfc416 <gsignal+198> (/lib/i386-linux-gnu/libc.so.6)
 4: ff821e50
 5: ff821de0
 6: ff821dd4
 7: 00000000
 8: 00000000
 9: 5dc9ce24 (./xashds)
 10: ff821a18
 11: 5dbebfa5 (./xashds)
 12: 5dd09838 (./xashds)
 13: 000008eb
 14: 00000000
 15: 00000000
 16: ff821e14
 17: ff821ae0
 18: ff821e90
 19: 5dbebd6e (./xashds)
 20: ff821e90
 21: ff821ae0
 22: ff821e14
 23: 5dd09838 (./xashds)
 24: 5dd09838 (./xashds)
 25: 000008ea
 26: c317f800
 27: c317f800
 28: ff821dd4
 29: 606aa9e0
 30: 602b6408
 31: 5dbebd6e (./xashds)
======================================
Xash Error: Sys_Crash: signal 6, err 0 with code -6 at 00000009 00000000
Stack backtrace:
 1: eb0f1579 <__kernel_vsyscall+9> (linux-gate.so.1)
Stack dump:
 0: ff82199c
 1: 00000000
 2: ff82199c
 3: eadfc416 <gsignal+198> (/lib/i386-linux-gnu/libc.so.6)
 4: ff821e50
 5: ff821de0
 6: ff821dd4
 7: 00000000
 8: 00000000
 9: 5dc9ce24 (./xashds)
 10: ff821a18
 11: 5dbebfa5 (./xashds)
 12: 5dd09838 (./xashds)
 13: 000008eb
 14: 00000000
 15: 00000000
 16: ff821e14
 17: ff821ae0
 18: ff821e90
 19: 5dbebd6e (./xashds)
 20: ff821e90
 21: ff821ae0
 22: ff821e14
 23: 5dd09838 (./xashds)
 24: 5dd09838 (./xashds)
 25: 000008ea
 26: c317f800
 27: c317f800
 28: ff821dd4
 29: 606aa9e0
 30: 602b6408
 31: 5dbebd6e (./xashds)

======================================

@tyabus
Copy link
Owner

tyabus commented Feb 18, 2025

Can you also please provide the output of following commands:
meta list
meta version
Also, please compile the engine with -DCMAKE_BUILD_TYPE="RelWithDebInfo" and with the libunwind crashhandler

@tyabus
Copy link
Owner

tyabus commented Feb 18, 2025

To install required the unwind library on debian/ubuntu execute "apt install libunwind-dev:i386"

@tyabus
Copy link
Owner

tyabus commented Feb 18, 2025

Would also be great if you ran the server under gdb with breakpoint set to Sys_Crash and sent the full backtrace here

@Antom91
Copy link
Author

Antom91 commented Feb 18, 2025

got it will do little bit later, @tyabus please can you give me short instructions about using gdb ?

i just want to do everything is right for you

@Antom91
Copy link
Author

Antom91 commented Feb 19, 2025

cmake

root@xash-build:/tmp/xash3d/build# cmake -DHL_SDK_DIR=../hlsdk -DXASH_SDL=no -DXASH_DEDICATED=yes -DXASH_VGUI=no -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_C_FLAGS="-m32 -DDEBUG_RESOLVE" -DCMAKE_CXX_FLAGS="-m32 -DDEBUG_RESOLVE" -DCMAKE_EXE_LINKER_FLAGS="-m32" ../
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Target architecture: i386
-- Building for 32 Bit
-- looking for libunwind
-- looking for liblzma
-- liblzma found
-- libunwind found
-- git hash: f9e332df
-- Disabled PIE for xash
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    HL_SDK_DIR


-- Build files have been written to: /tmp/xash3d/build
root@xash-build:/tmp/xash3d/build#

gdb:

gdb ./xashds
break Sys_Crash
run -game cstrike +map de_dust2 +sv_lan 0 +public 1 +maxplayers 28 +port 27015

#After crash
backtrace full

I don't have a meta mod:
meta info:

[07:17:07] You're launched a standalone version of YaPB. Metamod is not installed or not enabled!

Let's wait until server will crash.

@tyabus
Copy link
Owner

tyabus commented Feb 19, 2025

Also, whats your yapb version?

@Antom91
Copy link
Author

Antom91 commented Feb 19, 2025

@tyabus

#0  __memcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:144
No locals.
#1  0x56560a1e in memcpy (__len=2057288, __src=0xe16f1030, __dest=0x0) at /usr/include/bits/string_fortified.h:34
No locals.
#2  COM_LoadFileForMe (filename=0xf7c5afdc <cr::Singleton<cr::StringBuffer>::instance()::__instance+13824> "maps/de_dust2.bsp", pLength=0xffffbd40) at /tmp/xash3d/engine/common/common.c:365
        name = "maps/de_dust2.bsp\000\377\377\210\066\305\367\024\276\377\377\020\276\377\000\001\200\255\373\334\257\305\367\334\257\305\367\334\257\305\367\334\257\305\367\355\257\305\367\333\262\305\367\334\257\305\367\333\262\305\367", '\000' <repeats 20 times>, "\064\274\377\377\200\000\000\000\210\066\305\367\000\000\000\000\000\000\000\000\210\066\305\367\301\302\270\367`\000\000\000\377\377\377\377\000\000\000\000\240\302\270\367\000\000\000\000\377\377\377\377\000\000\000\000\000\000\000\367Hd\037", '\000' <repeats 29 times>, "\200\227\347\367\000\000\000\000\033\000\000\000 \335\300\367\210\066\305\367"...
        file = 0x0
        pfile = 0xe16f1030 "\036"
        iLength = 2057288
#3  0xf7bbb475 in cr::Lambda<unsigned char* (char const*, int*)>::LambdaFunctor<BotConfig::setupMemoryFiles()::$_0>::invoke(char const*&&, int*&&) const () from cstrike/addons/yapb/bin/yapb.so
No symbol table info available.
#4  0xf7be6601 in BotGraph::getBspSize() () from cstrike/addons/yapb/bin/yapb.so
No symbol table info available.
#5  0xf7bf43ad in BotGraph::loadGraphData() () from cstrike/addons/yapb/bin/yapb.so
No symbol table info available.
#6  0xf7bdbb15 in Game::levelInitialize(edict_t*, int) () from cstrike/addons/yapb/bin/yapb.so
No symbol table info available.
#7  0xf7bff3e3 in GetEntityAPI::$_7::__invoke(edict_t*, int, int) () from cstrike/addons/yapb/bin/yapb.so
No symbol table info available.
#8  0x565fa01d in SV_ActivateServer () at /tmp/xash3d/engine/server/sv_init.c:302
        i = <optimized out>
        numFrames = <optimized out>
        plservercfgfile = <optimized out>
#9  0x565fa485 in SV_ActivateServer () at /tmp/xash3d/engine/server/sv_init.c:287
        i = <optimized out>
        numFrames = <optimized out>
        plservercfgfile = <optimized out>
        mapchangecfgfile = <optimized out>
#10 0x5660ee72 in SV_ChangeLevel (loadfromsavedgame=false, mapname=0x56af42d8 "game.cfg", start=0x0) at /tmp/xash3d/engine/server/sv_save.c:1984
        level = "de_dust2\000\377\377\377\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377\260\355eV\024\306\377\377\320\306\377\377\330\277lV\364\215[V\340\315\323V\377\377\377\377\000\000\000\000\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361\000\000\000\000\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV\242\003\000\000\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377\260\355eV\024\306\377\377\320\306\377\377\330\277lV\364\215[V\270\315\323V\304\004\000\000\000\000\000\000\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361\000\000\000\000"...
        oldlevel = "de_aztec\000\306\377\377\330\277lV\364\215[V\260\315\323V\254\004\000\000\000\000\000\000\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361\270n\302D\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV\234\003\000\000\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377\260\355eV\000\000\000\000\320\306\377\377\000\303\377\377\000\000\000\000\250\315\323V\000\000\200?\000\000\000\000P\345\000X\207wA\305\003t\236C\000\374\225\303\000G\313\361\000\000\000\000\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV"...
        _startspot = "\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361 >\rE\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV\232\003\000\000\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377\260\355eV\024\306\377\377\320\306\377\377\330\277lV\364\215[V\300\310\323V\204\004\000\000\000\000\000\000\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361\000\000\000\000\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV\376\002\000\000\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377Xi\256V\230\307\377\377"...
        startspot = <optimized out>
        pSaveData = <optimized out>
#11 0x565e3f97 in SV_ChangeLevel_f () at /tmp/xash3d/engine/server/sv_cmds.c:707
        spawn_entity = <optimized out>
        mapname = 0x56af42d8 "game.cfg"
        flags = <optimized out>
        c = <optimized out>
#12 0x5655f752 in Cmd_ExecuteString (text=<optimized out>, src=src_command) at /tmp/xash3d/engine/common/cmd.c:1082
        cmd = 0x56af06a8
        a = 0x0
        cvar = 0x0
        command = "\324\a\000\000i+\264\367\320\306\377\377 \313\377\377\364\215[V\330\260\323V\000\000\000\000\\+\264\367\f\000\000\000i+\264\367\034\313\377\377\220\306\377\377\000G\313\361e\266A\305\220\306\377\377\035\212[V\260\355eVT\306\377\377`\306\377\377\330\277lV\364\215[V\330\277lV\001\000\000\000\000\000\000\000\000\000\200?T\306\377\377`\306\377\377\320\306\377\377\300\234\067\367\210h\256V\320\306\377\377\260\355eVhh\256V\320\260\323V\230j\256V\200\331\217V\000\000\200?\024\306\377\377 \306\377\377\220\306\377\377\000G\313\361\000\000\000\000\000\000\000\000\035\212[VP\034\210VP\034\210V\024\307\377\377\260\355eV\214\231[V\330\277lV"...
        pcmd = <optimized out>
        len = <optimized out>
#13 0x5655fb45 in Cbuf_Execute () at /tmp/xash3d/engine/common/cmd.c:359
        i = <optimized out>
        text = <optimized out>
        line = "changelevel de_dust2", '\000' <repeats 61 times>, "G\313\361\000\000\000\000\000\000\000\000\315RaV\260\355eVhh\256V\210h\256VP\320\377\377HVaVP\320\377\377\b\320\377\377\220h\256V\324\036\070\367\210h\256V\200\331\217VP\320\377\377hh\256V\b\320\377\377\000\000\000\000\204\225kV", '\000' <repeats 97 times>...
        quotes = <optimized out>
        comment = <optimized out>
#14 0x565770f8 in Host_InputFrame () at /tmp/xash3d/engine/common/dedicated.c:185
No locals.
#15 0x5658f12b in Host_Frame (time=0.0138643952) at /tmp/xash3d/engine/common/host.c:776
No locals.
#16 0x5658f195 in Host_RunFrame () at /tmp/xash3d/engine/common/host.c:277
        oldtime = 2336469.1753998399
        newtime = 2336469.1892642351
#17 0x56590c42 in Host_FrameLoop () at /tmp/xash3d/engine/common/host.c:287
No locals.
#18 Host_Main (argc=<optimized out>, argv=0xffffd394, progname=<optimized out>, bChangeGame=<optimized out>, func=0x56598d40 <Launcher_ChangeGame>) at /tmp/xash3d/engine/common/host.c:1418
No locals.
#19 0x5655a2a2 in main (argc=<optimized out>, argv=<optimized out>) at /tmp/xash3d/engine/common/launcher.c:105
        gamedir_buf = '\000' <repeats 64 times>
        gamedir = <optimized out>

Here is backtrace full after crash

YAPB version is :

[18:36:32] YaPB v4.4.957 (ID 957:9b9d4b6)
[18:36:32]    by YaPB Project ([email protected])
[18:36:32]    https://yapb.jeefo.net/

@tyabus
Copy link
Owner

tyabus commented Feb 19, 2025

Can you try again with the latest commit?

@Antom91
Copy link
Author

Antom91 commented Feb 21, 2025

@tyabus

console log:

[03:52:35] Unable to open Practice file for writing (filename: 'cstrike/addons/yapb/data/train/cs_assault.prc').
[03:52:35] SV_Shutdown: Server restarted
[New Thread 0xff80cb40 (LWP 649805)]
[03:52:35] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[03:52:35] [resolve thread] getaddrinfo success
[03:52:35] [resolve thread] returning result
[03:52:35] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 649805) exited]
[03:52:35] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[03:52:35] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[New Thread 0xff80cb40 (LWP 649806)]
[03:52:35] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[03:52:35] [resolve thread] getaddrinfo success
[03:52:35] [resolve thread] returning result
[03:52:35] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 649806) exited]
[03:52:35] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[03:52:35] Spawn Server: cs_italy
[03:52:35] Mem_Alloc: out of memory (alloc at /tmp/xash3d/engine/common/filesystem.c:2810)
======================================
Xash Error: Mem_Alloc: out of memory (alloc at /tmp/xash3d/engine/common/filesystem.c:2810)

======================================
[03:52:35] Shutting down...
[03:52:35] SV_Shutdown: Server shutdown
[New Thread 0xff80cb40 (LWP 649807)]
[03:52:35] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[03:52:35] [resolve thread] getaddrinfo success
[03:52:35] [resolve thread] returning result
[03:52:35] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 649807) exited]
[03:52:35] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[03:52:35] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[New Thread 0xff80cb40 (LWP 649808)]
[03:52:35] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[03:52:35] [resolve thread] getaddrinfo success
[03:52:35] [resolve thread] returning result
[03:52:35] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 649808) exited]
[New Thread 0xff80cb40 (LWP 649809)]
[03:52:35] [resolve thread] starting resolve for mentality.rip with getaddrinfo
[03:52:35] [resolve thread] getaddrinfo success
[03:52:35] [resolve thread] returning result
[03:52:35] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 649809) exited]
[03:52:37] Sys_DestroyConsole: Exiting!

================================================================================
        Xash3D-NG (build 3613) stopped with error at Feb21 2025 [03:52.37]
================================================================================
--Type <RET> for more, q to quit, c to continue without paging--
[Inferior 1 (process 628258) exited with code 01]
(gdb) backtrace full

backtrace full:

(gdb) backtrace full
No stack.

Started it again

@tyabus
Copy link
Owner

tyabus commented Feb 21, 2025

Looks like the commit I've made helped with the COM_LoadFileForMe, can you add breakpoint to the Sys_Error and go onto the FS_LoadFile frame and see which file it tries to load?

@tyabus
Copy link
Owner

tyabus commented Feb 21, 2025

I'll also spin another test server with YaPB and try to replicate this on my end, last time it didnt crash after ~2 days so, I kinda lost the interest on it.
Also, are you using regamedll_CS by any chance?

@Antom91
Copy link
Author

Antom91 commented Feb 21, 2025

No, server without regamedll_CS

Not sure about the correct gdb commands, please correct me if there is mistake someone

gdb ./xashds
(gdb) break Sys_Error
(gdb) run -game cstrike +map de_dust2 +sv_lan 0 +public 1 +maxplayers 28 +port 27015
# When xash crash on Sys_Error
(gdb) backtrace
# Find frame with FS_LoadFile
(gdb) frame <number of framework>
(gdb) print (char *)filename
(gdb) continue

Not sure about this one

(gdb) frame <number of framework>
(gdb) print (char *)filename
(gdb) continue

@tyabus Please help me, everything is correct here? I novice in gdb

@Antom91
Copy link
Author

Antom91 commented Feb 22, 2025

@tyabus the server was crashed, it looks like on mapchange

[01:43:34] ResList size: 1.87 Kb
[01:43:34] Count res: 428
[01:43:34] ResList size: 1.92 Kb
[01:43:34] Count res: 428
[01:43:34] ResList size: 1.91 Kb
[01:43:35] Count res: 428
[01:43:35] ResList size: 1.93 Kb
[01:43:35] Count res: 428
[01:43:35] ResList size: 1.92 Kb
[01:43:35] Count res: 428
[01:43:35] ResList size: 547 bytes
[01:46:40] server: Changing maps due to maximum rounds have been met
[01:46:50] server: CHANGE LEVEL: de_inferno
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Error: NET_CompareBaseAdr: bad address type
[01:46:50] Unable to open Practice file for writing (filename: 'cstrike/addons/yapb/data/train/de_dust.prc').
[01:46:50] SV_Shutdown: Server restarted
[New Thread 0xff80cb40 (LWP 686543)]
[01:46:50] [resolve thread] starting resolve for ms.tyabus.co.uk with getaddrinfo
[01:46:50] [resolve thread] getaddrinfo success
[01:46:50] [resolve thread] returning result
[01:46:50] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 686543) exited]
[New Thread 0xff80cb40 (LWP 686544)]
[01:46:50] [resolve thread] starting resolve for mentality.rip with getaddrinfo
[01:46:50] [resolve thread] getaddrinfo success
[01:46:50] [resolve thread] returning result
[01:46:50] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 686544) exited]
[New Thread 0xff80cb40 (LWP 686545)]
[01:46:50] [resolve thread] starting resolve for ms2.mentality.rip with getaddrinfo
[01:46:50] [resolve thread] getaddrinfo success
[01:46:50] [resolve thread] returning result
[01:46:50] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 686545) exited]
[New Thread 0xff80cb40 (LWP 686546)]
[01:46:50] [resolve thread] starting resolve for ms3.mentality.rip with getaddrinfo
[01:46:50] [resolve thread] getaddrinfo success
[01:46:50] [resolve thread] returning result
[01:46:50] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 686546) exited]
[New Thread 0xff80cb40 (LWP 686547)]
[01:46:50] [resolve thread] starting resolve for ms3.mentality.rip with getaddrinfo
[01:46:50] [resolve thread] getaddrinfo success
[01:46:50] [resolve thread] returning result
[01:46:50] [resolve thread] exiting thread
[Thread 0xff80cb40 (LWP 686547) exited]
[01:46:50] Spawn Server: de_inferno
--Type <RET> for more, q to quit, c to continue without paging--

backtrace

--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "xashds" hit Breakpoint 1, Sys_Error (format=0x56625974 "Mem_Alloc: out of memory (alloc at %s:%i)\n") at /tmp/xash3d/engine/common/system.c:665
665     {
(gdb) 
(gdb) backtrace
#0  Sys_Error (format=0x56625974 "Mem_Alloc: out of memory (alloc at %s:%i)\n") at /tmp/xash3d/engine/common/system.c:665
#1  0x565d0b9e in _Mem_Alloc (poolptr=0x57cdf6d0 "\r���\020p*�\020��W7hS", size=2392832, filename=0x5661ece8 "/tmp/xash3d/engine/common/model.c", fileline=1907) at /tmp/xash3d/engine/common/zone.c:142
#2  0x565a4e62 in Mod_LoadSurfaces (l=0xff80d06c, l=0xff80d06c) at /tmp/xash3d/engine/common/model.c:1907
#3  Mod_LoadBrushModel (mod=mod@entry=0x566cbee0 <cm_models>, buffer=buffer@entry=0xff80d030, loaded=loaded@entry=0xffffbd28) at /tmp/xash3d/engine/common/model.c:2775
#4  0x565a7f16 in Mod_LoadModel (crash=true, mod=0x566cbee0 <cm_models>) at /tmp/xash3d/engine/common/model.c:2975
#5  Mod_LoadModel (mod=0x566cbee0 <cm_models>, crash=true) at /tmp/xash3d/engine/common/model.c:2924
#6  0x565a8500 in Mod_ForName (crash=true, name=0x56906c50 <sv+624> "maps/de_inferno.bsp") at /tmp/xash3d/engine/common/model.c:3018
#7  Mod_LoadWorld (name=0x56906c50 <sv+624> "maps/de_inferno.bsp", checksum=0x56a7f508 <sv+1542952>, multiplayer=true) at /tmp/xash3d/engine/common/model.c:3071
#8  0x565fb10f in SV_SpawnServer (mapname=0xffffbe7c "de_inferno", startspot=0x0) at /tmp/xash3d/engine/server/sv_init.c:590
#9  0x5660ee7c in SV_ChangeLevel (loadfromsavedgame=false, mapname=0x56af4628 "de_inferno", start=0x0) at /tmp/xash3d/engine/server/sv_save.c:1966
#10 0x565e3fc7 in SV_ChangeLevel_f () at /tmp/xash3d/engine/server/sv_cmds.c:707
#11 0x5655f752 in Cmd_ExecuteString (text=<optimized out>, src=src_command) at /tmp/xash3d/engine/common/cmd.c:1082
#12 0x5655fb45 in Cbuf_Execute () at /tmp/xash3d/engine/common/cmd.c:359
#13 0x565770f8 in Host_InputFrame () at /tmp/xash3d/engine/common/dedicated.c:185
#14 0x5658f12b in Host_Frame (time=0.00109777157) at /tmp/xash3d/engine/common/host.c:776
#15 0x5658f195 in Host_RunFrame () at /tmp/xash3d/engine/common/host.c:277
#16 0x56590c42 in Host_FrameLoop () at /tmp/xash3d/engine/common/host.c:287
#17 Host_Main (argc=<optimized out>, argv=0xffffd0a4, progname=<optimized out>, bChangeGame=<optimized out>, func=0x56598d40 <Launcher_ChangeGame>) at /tmp/xash3d/engine/common/host.c:1418
#18 0x5655a2a2 in main (argc=<optimized out>, argv=<optimized out>) at /tmp/xash3d/engine/common/launcher.c:105
(gdb) frame 1
#1  0x565d0b9e in _Mem_Alloc (poolptr=0x57cdf6d0 "\r���\020p*�\020��W7hS", size=2392832, filename=0x5661ece8 "/tmp/xash3d/engine/common/model.c", fileline=1907) at /tmp/xash3d/engine/common/zone.c:142
142              if( mem == NULL ) Sys_Error( "Mem_Alloc: out of memory (alloc at %s:%i)\n", filename, fileline );
(gdb) print size
$1 = 2392832
(gdb) print filename
$2 = 0x5661ece8 "/tmp/xash3d/engine/common/model.c"
(gdb) print fileline
$3 = 1907
(gdb) info mem
Using memory regions provided by the target.
There are no memory regions defined.
(gdb) frame 7
#7  Mod_LoadWorld (name=0x56906c50 <sv+624> "maps/de_inferno.bsp", checksum=0x56a7f508 <sv+1542952>, multiplayer=true) at /tmp/xash3d/engine/common/model.c:3071
3071            worldmodel = Mod_ForName( name, true );
(gdb) 

@tyabus Please, let me know if I need to check something else in this crash report, I didn't reset the streaming work of gdb

@tyabus
Copy link
Owner

tyabus commented Feb 22, 2025

Honestly, I have no idea, the amount of memory it tries allocate is fine

Unable to open Practice file for writing (filename: 'cstrike/addons/yapb/data/train/de_dust.prc').
Please mark the folders inside the yapb/data executable (chmod +x) and this should resolve the error

@tyabus
Copy link
Owner

tyabus commented Feb 22, 2025

I'm also still running the test server with 12 YaPB bots (Counter-Strike 1.6 Server YaPB Test), let's wait and see if it crashes.

@Antom91
Copy link
Author

Antom91 commented Feb 22, 2025

Okay, let's check.

Maybe something is wrong with my files? could you please share your server? maybe something is wrong in my side related to server files. I don't know

@tyabus
Copy link
Owner

tyabus commented Feb 22, 2025

I have downloaded latest linux HLDS using steamcmd and copied over valve, cstrike folders

@Antom91
Copy link
Author

Antom91 commented Feb 22, 2025

and the latest version of cs16_client?

@tyabus
Copy link
Owner

tyabus commented Feb 22, 2025

What? We're talking about a dedicated server, not a client

@Antom91
Copy link
Author

Antom91 commented Feb 22, 2025

yes, about a dedicated server, I'm not sure where I got this server and server file from, maybe the problem is in them, I'll try to rebuild everything from scratch again

I mean cs16_client https://github.com/Velaron/cs16-client

@tyabus
Copy link
Owner

tyabus commented Feb 24, 2025

My server has finally crashed

[05:22:18] server(ai): Firing: (game_playerleave)
[05:22:18] SV_ConnectionlessPacket: 220.205.252.62:57523 : info
[05:22:20] SV_ConnectionlessPacket: 220.205.252.62:57523 : info
[05:22:21] SV_ConnectionlessPacket: 186.174.6.153:59232 : info
[05:22:21] SV_ConnectionlessPacket: 186.174.6.153:59232 : info
Failed to allocate 8 megabytes of memory. Closing down.

Thread 1 "xash" received signal SIGABRT, Aborted.
0xf7fc7559 in __kernel_vsyscall ()
(gdb) bt
#0  0xf7fc7559 in __kernel_vsyscall ()
#1  0xf7cf9407 in ?? () from /lib/i386-linux-gnu/libc.so.6
#2  0xf7ca8111 in raise () from /lib/i386-linux-gnu/libc.so.6
#3  0xf7c9126a in abort () from /lib/i386-linux-gnu/libc.so.6
#4  0xf7b68611 in cr::ThreadPool::enqueue(cr::Lambda<void ()>&&)
    () from cstrike/addons/yapb/bin/yapb.so

As a temporary workaround i suggest you adding YAPB_SINGLE_THREADED=1 to the env.

@Antom91
Copy link
Author

Antom91 commented Feb 25, 2025

So, you say that the reason with crashes is YAPB bots?

@tyabus YAPB_SINGLE_THREADED=1 Where exactly do I need to add? what environment?

@Antom91
Copy link
Author

Antom91 commented Feb 26, 2025

it's not helped

[10:47:22] Loaded Bots Graph data v2 (Memory: 0.26MB).
Failed to allocate 8 megabytes of memory. Closing down.
Sys_Crash: signal 6, err 0 with code -6 at 000b1cc8 00000000
�?F��?@C�?�CStack backtrace:
 1: f7f24b49 <__kernel_vsyscall+9> (linux-gate.so.1)
Stack dump:
 0: ffe4b88c
 1: 00000000
 2: ffe4b88c
 3: f7c2c416 <gsignal+198> (/lib/i386-linux-gnu/libc.so.6)
 4: 00001000
 5: 0053b000
 6: f7de6000 (/lib/i386-linux-gnu/libc.so.6)
 7: 00000000
 8: 00000000
 9: 0053b000
 10: 00000003
 11: 00000022
 12: ffffffff
 13: 00000000
 14: fffff000
 15: fffff000
 16: 5a275ed0
 17: 00000001
 18: 0053a620
 19: 00000004
 20: 5a275a20
 21: ffe4bca0
 22: 0000000d
 23: f75286dc (/opt/xashds_public_fix/cstrike/addons/yapb/bin/yapb.so)
 24: 00000004
 25: 00000023
 26: 5a275ed0
 27: f7528000 (/opt/xashds_public_fix/cstrike/addons/yapb/bin/yapb.so)
 28: f752ecef (/opt/xashds_public_fix/cstrike/addons/yapb/bin/yapb.so)
 29: 5a275a20
 30: 0000000d
 31: f23c8008
[10:47:22] Sys_Crash: signal 6, err 0 with code -6 at 000b1cc8 00000000

======================================
Xash Error: Sys_Crash: signal 6, err 0 with code -6 at 000b1cc8 00000000

======================================
[10:47:22] Shutting down...
[10:47:22] SV_Shutdown: Server shutdown
[10:47:22] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[10:47:22] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[10:47:22] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[10:47:22] Error: NET_StringToSockaddr: failed to create thread! (Resource temporarily unavailable)
[10:47:23] Sys_DestroyConsole: Exiting!

================================================================================
        Xash3D-NG (build 3618) stopped at Feb26 2025 [10:47.23]
================================================================================

@tyabus
Copy link
Owner

tyabus commented Feb 28, 2025

I am sorry for my absence, it seems to be a new regression in the engine that is accelerated by the YaPB bots;
You need to pass YAPB_SINGLE_THREADED=1 to the system environment like this YAPB_SINGLE_THREADED=1 ./xash3d.
Maybe you can use another bot plugin in the time being

@tyabus
Copy link
Owner

tyabus commented Feb 28, 2025

The problem has been traced to the asynchronous ns resolver, please compile the engine with -DXASH_NO_ASYNC_NS_RESOLVE=1 and wait until the fix is pushed for it

@Antom91
Copy link
Author

Antom91 commented Mar 1, 2025

Okay, will do it on a week. Thank you for your help!

@tyabus
Copy link
Owner

tyabus commented Mar 2, 2025

No problem! Thank you also for catching the e38aa86.

Closing in favour of the #37

@tyabus tyabus closed this as completed Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containerization-vm-restricted Issue related to restricted environment (docker,lxc,virtual machine,selinux,seccomp,audit,bpf).
Projects
None yet
Development

No branches or pull requests

4 participants