godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.88k stars 21.04k forks source link

4.3.dev build crash MultiplayerAPI::has_multiplayer_peer #88263

Closed brennennen closed 7 months ago

brennennen commented 7 months ago

Tested versions

System information

Godot v4.3.dev (f317cc713) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 (NVIDIA; 31.0.15.4601) - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 Threads)

Issue description

Ran into an engine crash testing the high level multiplayer api on master. I've been running into some walls around using MultiplayerSpawner/MultiplayerSynchronizer and figured building from source and trying to debug things might be a good place to look. However, with no code changes, just a clean master pull, I'm getting the crash below.

The goal of this repo was to setup a simple multiplayer prototype for a game I'm working on. This little prototype is unfinished and I'm sure has some mistakes with how I'm using the MultiplayerSpawner and MultiplayerSynchronizer, however, I don't think any orientation of these nodes should result in an engine crash. I started the project following the networking model presented in the blogpost from last year: https://godotengine.org/article/multiplayer-in-godot-4-0-scene-replication/ with some tweaks to make the players have direct control over their own movement because of latency issues in running input on the server between players on different continents. I'm planning to make a casual co-op game, the extra layer of security/correctness involved in only running input on the server is not really what I'm looking for.

The project has a "main" scene, which loads a "MainMenu" scene with a host/join button which lead to a level scene "MultiplayerSandbox" when the host/join buttons are pressed. In trying to make the high level multiplayer api work in a way that lets players have authority over their own peers, I moved the "MultiplayerSynchronizer" from the level and into the "main" scene (as seen in this repo: https://github.com/devloglogan/MultiplayerFPSTutorial), this is when the crashing started.

I tried to re-create the issue on 4.2.1.stable and I can't get the crash report, but the popped out play windows just exit right away. Are crashes/backtraces only logged on dev builds?

Backtrace

PS C:\repos\godot> scons platform=windows target=editor dev_build=yes tests=yes
...
PS C:\repos\godot> .\bin\godot.windows.editor.dev.x86_64.exe
PS C:\repos\godot> Godot Engine v4.3.dev.custom_build.f317cc713 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 546.01 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1080

Editing project: C:/repos/GodotMultiplayerProto2024
Godot Engine v4.3.dev.custom_build.f317cc713 - https://godotengine.org
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080
WARNING: Invalid/corrupt pipelines cache.
     at: RenderingDeviceDriverVulkan::pipeline_cache_create (drivers\vulkan\rendering_device_driver_vulkan.cpp:2248)

ERROR: Condition "p_value.get_type() != Variant::BOOL" is true. Returning: false
   at: SceneReplicationConfig::_set (modules\multiplayer\scene_replication_config.cpp:59)
Godot Engine v4.3.dev.custom_build.f317cc713 - https://godotengine.org
Godot Engine v4.3.dev.custom_build.f317cc713 - https://godotengine.org
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080
WARNING: Invalid/corrupt pipelines cache.
     at: RenderingDeviceDriverVulkan::pipeline_cache_create (drivers\vulkan\rendering_device_driver_vulkan.cpp:2248)
WARNING: Invalid/corrupt pipelines cache.
     at: RenderingDeviceDriverVulkan::pipeline_cache_create (drivers\vulkan\rendering_device_driver_vulkan.cpp:2248)

2024-02-13T00:17:44|Info |1|open_main_menu
2024-02-13T00:17:44|Info |1|change_scene_to_file: 'res://Maps/Menus/MainMenu.tscn'

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.dev.custom_build (f317cc713aa4dbcee2efa10db764473a56680be7)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
2024-02-13T00:17:44|Info |2|open_main_menu
2024-02-13T00:17:44|Info |2|change_scene_to_file: 'res://Maps/Menus/MainMenu.tscn'

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.dev.custom_build (f317cc713aa4dbcee2efa10db764473a56680be7)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] MultiplayerAPI::has_multiplayer_peer (C:\repos\godot\scene\main\multiplayer_api.h:75)
[1] MultiplayerSpawner::_node_added (C:\repos\godot\modules\multiplayer\multiplayer_spawner.cpp:228)
[2] call_with_variant_args_helper<MultiplayerSpawner,Node *,0> (C:\repos\godot\core\variant\binder_common.h:309)
[3] call_with_variant_args<MultiplayerSpawner,Node *> (C:\repos\godot\core\variant\binder_common.h:419)
[4] CallableCustomMethodPointer<MultiplayerSpawner,Node *>::call (C:\repos\godot\core\object\callable_method_pointer.h:99)
[5] Callable::callp (C:\repos\godot\core\variant\callable.cpp:57)
[6] Object::emit_signalp (C:\repos\godot\core\object\object.cpp:1128)
[7] Node::emit_signalp (C:\repos\godot\scene\main\node.cpp:3763)
[8] Node::_propagate_enter_tree (C:\repos\godot\scene\main\node.cpp:274)
[9] Node::_set_tree (C:\repos\godot\scene\main\node.cpp:3012)
[10] Node::_add_child_nocheck (C:\repos\godot\scene\main\node.cpp:1409)
[11] Node::add_child (C:\repos\godot\scene\main\node.cpp:1437)
[12] call_with_variant_args_helper<Node,Node *,bool,enum Node::InternalMode,0,1,2> (C:\repos\godot\core\variant\binder_common.h:309)
[13] call_with_variant_args_dv<Node,Node *,bool,enum Node::InternalMode> (C:\repos\godot\core\variant\binder_commo[n0.h]: 4M5u2l)t
iplayerAPI::has_multi[p1l4a]y eMre_tpheoedrB i(nCd:T\<rNeopdoes,\Nogdoed o*t,\bsocoeln,ee\nmauimn \Nmoudlet:i:pIlnatyeerrn_aalpMio.dhe:>7:5:)c
all (C:\repos\g[o1d]ot \Mcuolrtei\polbajyeecrtS\pmaewtnheor:d:__bnionded_.ahd:d3e37d)
(C:\repos\godot\mod[u1l5e]s \GmDuSlctriippltaFuyencrt\miuoln:ti:cpallaly e(rC_:s\praewpnoesr.\cgpopd:o2t2\8m)o
dules\gdscr[i2p]t \cgadlslc_rwiiptth__vvma.rcipapn:t1_8a3r0g)s
_helper<MultiplayerSpawner,Node *,0> (C:\re[p1o6s]\ gGoDdSoctr\icpotrIen\svtaarnicaen:t:\cbailnldpe r(_cCo:m\mroenp.ohs:\3g0o9d)o
t\modules\gd[s3c] rciapltl\_gwdistchr_ivpatr.icapnpt:_1a9r2g9s)<
Multiplayer[S1p7a]w nOebrj,eNcotd:e: c*a>l l(pC :(\Cr:e\proesp\ogso\dgootd\octo\rceo\rvea\roibajnetc\tb\ionbdjeerc_tc.ocmpmpo:n7.5h3:)4
19)
[4] CallableCustomMethodPointer<MultiplayerSpawner,Node *>::call (C:\repos\godot\core\object\callable_method_pointer.h:99)
[5] Callable::callp (C:\repos\godot\core\variant\callable.cpp:57)
[6] Object::emit_signalp (C:\repos\godot\core\object\object.cpp:1128)
[18][ 7V]a rNioadnet::::ecmailtl_ps i(gCn:a\lrpe p(oCs:\\groedpoots\\cgoordeo\tv\asrcieannet\\mvaairni\annotd_ec.aclplp.:c3p7p6:31)2
08)
[19] [G8D]S cNroidpet:F:u_npcrtoipoang:a:tcea_leln t(eCr:_\trreepeo s(\Cg:o\droetp\omso\dguoldeost\\gsdcsecnrei\pmta\ignd\sncordiep.tc_pvpm:.2c7p4p):
1735)
[[290]]  NGoDdSec:r:i_psteItn_sttraenec e(:C::c\arlelppo s(\Cg:o\droetp\ossc\egnoed\omta\imno\dnuoldees.c\pgpd:s3c0r1i2p)t
\gdscript.cpp:[11902]9 )N
ode:[:2_1a]d dO_bcjheicltd:_:ncoachlelcpk  ((CC::\\rreeppooss\\ggooddoott\\csocreen\eo\bmjaeicnt\\noobdjee.cctp.pc:p1p:470593))

[22] V[a1r1i]a nNto:d:ec:a:laldpd _(cCh:i\lrd e(pCo:s\\rgeopdoost\\gcoodroet\\vsacreinaen\tm\avianr\inaondte_.ccaplpl:.1c4p3p:71)2
08)
[23] GDScr[i1p2t]F ucnacltli_owni:t:hc_avlal r(iCa:n\tr_eaprogss\_ghoedlopte\rm<oNdoudlee,sN\ogddes c*r,ibpoto\lg,desncurmi pNto_dvem:.:cIpnpt:e1r7n3al5M)o
de,0,1[,224>]  (GCD:S\crreippotsI\ngsotdaontc\ec:o:rcea\lvlapr i(aCn:t\\rbeipnodse\rg_ocdoomtm\omno.dhu:l3e0s9\)g
dscript\gdscript[.1c3p]p :c1a9l2l9_)w
ith_variant_arg[s25_]d vN<oNdoed:e:,_Ngoddvei r*t,ubaolo_l_,reenaudmy _Ncoadlel:<:0I>n t(eCr:n\arleMpoodse\>g o(dCo:t\\rsecpeonse\\gmoadiont\\ncoodree.\hv:a3r2i3a)n
t\binder_co[m2m6o]n .Nho:d4e5:2:)_
notification (C:\[r1e4p] oMse\tghooddoBti\nsdcTe<nNeo\dmea,iNno\dneo *d,eb.ocoplp,:e1n8u8m)
Node::InternalMode>::call (C:\repos\godot\core\object\method_bind.h:337)
[15] GDScriptFunction::call (C:\repos\godot\modules\gdscript\gdscript_vm.cpp:1830)
[16] GDScriptInstance::callp (C:\repos\godot\modules\gdscript\gdscript.cpp:1929)
[17] Object::callp (C:\repos\godot\core\object\object.cpp:753)
[27] Node::_notificationv (C:\repos\godot\scene\main\node.h:49)
[28] Object::notification (C:\repos\godot\core\object\object.cpp:840)
[29] Node::_propagate_ready (C:\repos\godot\scene\main\node.cpp:237)
[30] Node::_propagate_ready (C:\repos\godot\scene\[m1a8i]n \Vnaordiea.nctp:p::c2a2l8l)p
 (C:\rep[o3s1\]g oNdoodte\:c:o_rsee\tv_atrrieaen t(\Cv:a\rrieapnots_\cgaoldlo.tc\pscpe:n1e2\0m8a)i
n\node[.1c9p]p :G3D0S1c6r)i
ptFunction::call (C:\repos\godot\modules\gdscript[\3g2d]s cSrciepnte_Tvrme.ec:p:pi:n1i7t3i5a)l
ize (C[:2\0r]e pGoDsS\cgroidpottI\nsscteannec\em:a:icna\lslcpe n(eC_:t\rreeep.ocsp\pg:o4d5o0t)\
modules\gdscript\gdscri[p3t3.]c pOpS:_1W9i2n9d)o
ws::[r2u1n]  (OCb:j\ercetp:o:sc\agloldpo t(\Cp:l\artefpoorsm\\gwoidnodto\wcso\roes\_owbijnedcotw\so.bcjpepc:t1.4c7p4p):
753)
[3[42]2 ]w iVdaercihaanrt_:m:acianl l(pC (:C\:r\erpeopso\sg\ogdoodto\tp\lcaotrfeo\rvma\rwiinadnowts\\vgaordioatn_tw_icnadlolw.sc.pcpp:p1:20188)2
)
[23][ 3G5D]S c_rmiapitnF u(nCc:t\iroenp:o:sc\aglold o(tC\:p\lraetpfoosr\mg\owdiontd\omwosd\ugloedso\tg_dwsicnrdiopwts\.gcdpspc:r2i0p4t)_
vm.cp[p3:61]7 3m5a)i
n (C:[\2r4e]p oGsD\Sgcordioptt\Ipnlsattafnocrem:\:wcianldlopw s(\Cg:o\droetp_owsi\ngdoodwost.\cmpopd:u2l1e8s)\
gdscri[p3t7\]g dWsicnrMiapitn. c(pCp::\1r9e2p9o)s
\godot\platform\w[i2n5d]o wNso\dgeo:d:o_tg_dwviinrdtouwasl._c_prpe:a2d3y2_)c
all<0> (C:\r[e3p8o]s \_g_osdcortt\_sccoemnmeo\nm_amiani\nn_osdeeh. h(:D3:2\3a)\
_work\1\s\s[r2c6\]v cNtoodoel:s:\_cnrto\tvicfsitcaarttiuopn\ s(rCc:\\srteaprotsu\pg\oedxoet_\csocmmeonne.\imnali:n2\8n8o)d
e.cp[p3:91]8 8<)c
ouldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================
[27] Node::_notificationv (C:\repos\godot\scene\main\node.h:49)
[28] Object::notification (C:\repos\godot\core\object\object.cpp:840)
[29] Node::_propagate_ready (C:\repos\godot\scene\main\node.cpp:237)
[30] Node::_propagate_ready (C:\repos\godot\scene\main\node.cpp:228)
[31] Node::_set_tree (C:\repos\godot\scene\main\node.cpp:3016)
[32] SceneTree::initialize (C:\repos\godot\scene\main\scene_tree.cpp:450)
[33] OS_Windows::run (C:\repos\godot\platform\windows\os_windows.cpp:1474)
[34] widechar_main (C:\repos\godot\platform\windows\godot_windows.cpp:182)
[35] _main (C:\repos\godot\platform\windows\godot_windows.cpp:204)
[36] main (C:\repos\godot\platform\windows\godot_windows.cpp:218)
[37] WinMain (C:\repos\godot\platform\windows\godot_windows.cpp:232)
[38] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[39] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

Steps to reproduce

Minimal reproduction project (MRP)

https://github.com/brennennen/GodotMultiplayerProto2024/tree/multiplayer_api_crash GodotMultiplayerProto2024.zip

brennennen commented 7 months ago

Ahh, nevermind, i'm running into the MultipalyerSpawner "change_scene_to_file" issue that is well documented. My bad, this can be ignored.