Page MenuHomeFeedback Tracker

DayZ Linux - Curl crashes server
Assigned, NormalPublic

Description

Curl web requests are crashing the game server

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Linux x64
Operating System Version
Debian 11
Category
General
Additional Information
=====================================================================
== DayZServer
== ./DayZServer -config=serverDZ.cfg -port=2302 -profiles=profiles -adminlog -mod=@gamelabs 
=====================================================================
Exe timestamp: 2021/09/08 16:31:12
Current time:  2021/09/09 18:36:26

Version 1.14.154166
18:36:26 [Inputs] Loading inputs default "bin/constants.xml"
18:36:26 [Inputs] Loading inputs default "bin/specific.xml"
18:36:26 [Inputs] Loading inputs cfg "profiles/users/Survivor\Server.core.xml"
18:36:26 !!! [Inputs] Cannot read inputs cfg "profiles/users/Survivor\Server.core.xml", parser error
18:36:26 [Inputs] Loading inputs cfg "bin/core.xml"
18:36:26 !!! [Inputs] Cannot load input preset "user", file does not exist
18:36:26 [Inputs] Exporting inputs cfg "profiles/users/Survivor\Server.core.xml"
	stack dump [1]  ./DayZServer() [0xd164fe]
	stack dump [2]  /lib/x86_64-linux-gnu/libpthread.so.0 : +0x14140 [0x7fbd449db140]
	stack dump [3]  /lib/x86_64-linux-gnu/libc.so.6 : +0x15b00a [0x7fbd4463000a]
	stack dump [4]  ./DayZServer() [0xd859f5]
	stack dump [5]  ./DayZServer : OBJ_NAME_add+0x66 [0xda12c6]
	stack dump [6]  /lib/x86_64-linux-gnu/libcrypto.so.1.1 : +0x17533e [0x7fbd4420b33e]
	stack dump [7]  /lib/x86_64-linux-gnu/libcrypto.so.1.1 : +0x1909c9 [0x7fbd442269c9]
	stack dump [8]  /lib/x86_64-linux-gnu/libpthread.so.0 : +0x1134f [0x7fbd449d834f]
	stack dump [9]  /lib/x86_64-linux-gnu/libcrypto.so.1.1 : CRYPTO_THREAD_run_once+0x9 [0x7fbd44291d59]
	stack dump [10]  /lib/x86_64-linux-gnu/libcrypto.so.1.1 : OPENSSL_init_crypto+0x24b [0x7fbd44226f7b]
	stack dump [11]  /lib/x86_64-linux-gnu/libssl.so.1.1 : OPENSSL_init_ssl+0x31 [0x7fbd443c0011]
	stack dump [12]  /lib/x86_64-linux-gnu/libcurl.so.4 : +0x6a8a0 [0x7fbd44a6f8a0]
	stack dump [13]  /lib/x86_64-linux-gnu/libcurl.so.4 : +0x1d523 [0x7fbd44a22523]
	stack dump [14]  /lib/x86_64-linux-gnu/libcurl.so.4 : curl_easy_init+0x28 [0x7fbd44a22768]
	stack dump [15]  ./DayZServer() [0xbd13a5]
	stack dump [16]  ./DayZServer() [0xbeb134]
	stack dump [17]  ./DayZServer() [0xbeb2d8]
	stack dump [18]  ./DayZServer() [0xbeb8f1]
	stack dump [19]  ./DayZServer() [0xbede2a]
	stack dump [20]  ./DayZServer() [0x855b87]
	stack dump [21]  ./DayZServer() [0x85630a]
	stack dump [22]  ./DayZServer() [0x8585b7]
	stack dump [23]  ./DayZServer() [0x836b6a]
	stack dump [24]  ./DayZServer() [0x838974]
	stack dump [25]  ./DayZServer() [0x838c15]
	stack dump [26]  ./DayZServer() [0x858679]
	stack dump [27]  ./DayZServer() [0x836a48]
	stack dump [28]  ./DayZServer() [0x836d0c]
	stack dump [29]  ./DayZServer() [0x839996]
	stack dump [30]  ./DayZServer() [0x107b9c8]
	stack dump [31]  ./DayZServer() [0x1080b3d]
	stack dump [32]  ./DayZServer() [0xf46eb7]
	stack dump [33]  ./DayZServer() [0xf564ae]
	stack dump [34]  ./DayZServer() [0xc89db1]
	stack dump [35]  ./DayZServer() [0xc8afdc]
	stack dump [36]  ./DayZServer() [0xf5b2ed]
	stack dump [37]  ./DayZServer() [0x5d4fc3]
	stack dump [38]  ./DayZServer() [0x5d5284]
	stack dump [39]  ./DayZServer() [0x5e238c]
	stack dump [40]  ./DayZServer() [0x9f213d]
	stack dump [41]  ./DayZServer() [0x5e2539]
	stack dump [42]  ./DayZServer() [0x55ed25]
	stack dump [43]  /lib/x86_64-linux-gnu/libc.so.6 : __libc_start_main+0xea [0x7fbd444fbd0a]
	stack dump [44]  ./DayZServer() [0x5d3eda]

Event Timeline

philippjoos edited Additional Information. (Show Details)
gOOvER added a subscriber: gOOvER.Sep 9 2021, 9:23 PM
dedmen claimed this task.Sep 10 2021, 2:47 PM
dedmen triaged this task as Normal priority.
dedmen set Ref Ticket to DZ-8321.
dedmen changed the task status from New to Assigned.Sep 13 2021, 10:41 AM
dedmen added a comment.EditedSep 13 2021, 2:15 PM

Cannot reproduce?
Try this

/// add to CustomMission class
override void OnClientReadyEvent(PlayerIdentity identity, PlayerBase player) {
        super.OnClientReadyEvent(identity, player);
        RestApi restApi = CreateRestApi();
        restApi.EnableDebug(false);
        RestContext restContext = restApi.GetRestContext("https://api.cftools.cloud/gamelabs/dz");
        restContext.SetHeader("application/json");
        restContext.POST_now("/v1/trace", "test");
    }

I guess the important difference might be that this request is done after the Hive is initialized

Actually no its not that.
On my server it works in init.c
in main() before hive init
in main() after hive init
in OnClientReadyEvent

cannot reproduce any crashing

Actually this crash seems to just be a generic memory allocation crash. Not related to web requests itself.

MarioE added a subscriber: MarioE.Wed, Sep 29, 2:02 PM

It pretty much sounds like you ref'd the RestCallback instance somewhere... you should not use refs on them under any circumstance

That's it, refing it all the time.

dihan added a subscriber: dihan.Sat, Oct 9, 7:33 PM