(NUI) Loadingscreen duplicates and doesn't terminate

This might be a terrible bug report in regards to reproduction steps and additional info, so reports from others if this is reproducible for them could be helpful.

When disconnecting from a server and rejoining the same server (not closing FiveM) the loadingscreen ‘duplicates’ and is displayed multiple times, which also results in no automatic loadingscreen shutdown when the game finishes initializing.

What I could gather is that when this issue occurs prints placed inside the loadingscreen are also duplicated and NUI devtools shows multiple loadingscreen iframes.

(Tested on both stable and canary channel, no difference. Seems to also occur on any server that has a loadingscreen present.)

Already been reported at least once but there’s no repro steps and it seems to actually be due to some other behavior: Loading screen doubles during reconnect

Mainly, this, indicating this is with a render process crash (already shouldn’t happen!) and recreating the render process somehow creating frames twice (impossible to repro without reproducing the render process crash itself):

‘just join and disconnect from any server with a load screen’ is definitely not sufficient and without naming a specific server or resource to try this is an extremely incomplete repro even if it were sufficient.

Sorry for the late response, but further tries to narrow down the actual cause somewhat failed.

This isn’t reproducible on every server, as trying to invoke this behavior on a ‘vanilla’ server with only the loading screen being addon failed (So I was wrong).

Comparing the output Chromium gave me shows only two differences between normal and ‘bugged’ behavior.

After disconnecting and during game shutdown I get these prints:

CEF Output
[0203/223113.046:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = nui://vending_prp/vending/html/prop_glass_02_sprop_glass_04_a.html, status = 4, exit_code = 258
[0203/223113.071:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = nui://vending_prp/vending/html/p_v_vend_snak_01.html, status = 4, exit_code = 258
[0203/223113.114:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8910/_qVEnMQAFEKQJENdLWw6HA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.133:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/0822/83axdSaAS02J-Z0e1df-jw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.151:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/0893/oeWgDf7GN0CkLszt8JRjfQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.156:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/7980/JwAm0wWMbkmHa_TKIoau7w/2_0.jpg, status = 4, exit_code = 258
[0203/223113.162:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3941/A7jqgI-h9k2au7dj7gRsmw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.174:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8573/0sQw52xaekGDJIglmG8TUw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.182:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4061/BnJdo30Ppkaknghd3xD00A/2_0.jpg, status = 4, exit_code = 258
[0203/223113.187:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4998/vyTABS5xR06--t_w6e9t0w/2_0.jpg, status = 4, exit_code = 258
[0203/223113.193:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4870/WAyVbig6OkSMbD7lapk84w/2_0.jpg, status = 4, exit_code = 258
[0203/223113.204:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/9262/g9pM0C_DoUan2t_kzpL0lA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.211:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/2013/0shqLVDjd0qVDv-CHUv8ew/2_0.jpg, status = 4, exit_code = 258
[0203/223113.217:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/0126/DaHBvkP7dEKCdy1qPA78Ew/2_0.jpg, status = 4, exit_code = 258
[0203/223113.223:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3134/JrbYCpLGdUuU2rhvsSW2wQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.240:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6518/tQArg4sDt0-ATPwkAa4UcA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.247:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/5499/akcrtIfrH0ioverkdkdD0A/2_0.jpg, status = 4, exit_code = 258
[0203/223113.252:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3054/B6r3Irqu8UuE5CyqpI512A/2_0.jpg, status = 4, exit_code = 258
[0203/223113.257:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3981/rtNlyMjwx02EehGBGELmFA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.271:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8523/159dEmF19k69-8RrYQSXbg/2_0.jpg, status = 4, exit_code = 258
[0203/223113.276:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/2314/mZ0PcmK-lUusdC3d_db6CA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.281:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/5403/8PrF1PzohUGVERk5IH68Ew/2_0.jpg, status = 4, exit_code = 258
[0203/223113.287:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/9015/xHqN1GOv1E2mcmcpaKOJHQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.296:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8469/8EC28lyqjUC4QbYzyAs7_Q/2_0.jpg, status = 4, exit_code = 258
[0203/223113.301:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4151/zQMPw-QFBkWXsA5yrEHiBg/2_0.jpg, status = 4, exit_code = 258
[0203/223113.306:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6062/-DkdoRcQK0SZ04rrxvOjlA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.311:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3874/ddHtd5ObCUulYYRG6CnSzw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.318:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/2688/od2MHwZ-z0y_oxYOCJiadw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.339:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8354/vLWtKE-4yUed3CDCX_Ry8Q/2_0.jpg, status = 4, exit_code = 258
[0203/223113.346:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/9899/zZYDkgMl70OUOKlj9BsLtA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.352:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4846/YmiHpz6bBU2g78fo4GrJng/2_0.jpg, status = 4, exit_code = 258
[0203/223113.361:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/7862/j9KIsGgp0keTks4rjlqoTg/2_0.jpg, status = 4, exit_code = 258
[0203/223113.364:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/5811/e-ICTCVrgUSCdDjRyg3x9w/2_0.jpg, status = 4, exit_code = 258
[0203/223113.369:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6252/3imRTH7ehEWmDwW2-mncmg/2_0.jpg, status = 4, exit_code = 258
[0203/223113.374:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6477/kxV5YVMQSEKY04MseoEmFA/2_0.jpg, status = 4, exit_code = 258
[0203/223113.378:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/2525/Y-Vv0cIN2Uqxx3xR2PALag/2_0.jpg, status = 4, exit_code = 258
[0203/223113.398:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8023/mPCp2HY4VUOpJOo3XNyLJQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.482:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8349/rN2-NtpRNEuCccGeEW7I5g/2_0.jpg, status = 4, exit_code = 258
[0203/223113.527:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/7474/2Y2HGHWTb0i_raVNjGnoXg/2_0.jpg, status = 4, exit_code = 258
[0203/223113.635:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/3793/o8yNzLS0O02Ld5w_h8CKtw/2_0.jpg, status = 4, exit_code = 258
[0203/223113.649:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6681/s8A3DDORE0CN5zUKPB4dLQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.656:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/4061/BnJdo30Ppkaknghd3xD00A/2_0.jpg, status = 4, exit_code = 258
[0203/223113.660:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/8098/JnlKjCjByEmNdTbWvzppZQ/2_0.jpg, status = 4, exit_code = 258
[0203/223113.670:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = https://prod.cloud.rockstargames.com/ugc/gta5mission/6684/eV8RvueYtUyboNpN_7UWag/2_0.jpg, status = 4, exit_code = 258

(Which show some similarity to the logs included in the bug report before mine)

After reconnecting and during game init this print probably shows something is wrong:

[0203/223158.445:INFO:CONSOLE(0)] "Autofocus processing was blocked because a document already has a focused element.", source: nui://game/ui/root.html (0)

(but doesn’t give any helpful context)

As this probably won’t help anyone with further investigating this and no dumps show anything obvious (and no crash dumps are produced in relation to this) I’ve sent you a server IP via PM where this behavior is constantly reproducible (This is a test server as I just assumed you don’t wanna join any random Discord guilds to be able to join a server)

I have a theory of what might be happening here, will check it later (hopefully! posting here so I don’t forget):

  • DUI processes somehow don’t get cleanly terminated when disconnecting (switching context?) but instead trigger a render process crash
  • the ‘on render process crash’ handler runs the same code whether it’s the main root.html being terminated or another render process, leading to two DUI processes being processed and therefore root.html being created twice… as well as frame creations

… nope, it’s not that at least: NUIClient::OnRenderProcessTerminated doesn’t get invoked at all. Curious.

Checking one more thing and then I’ll have to leave my desk again (random nausea, fun) for a bit - hopefully that guess matches.

Might be fixed with fix(nui): RecreateFrames dupe-recreation · citizenfx/fivem@b623033 · GitHub, but the build infrastructure is a bit weird due to an oversight so I’m not sure if/when this’ll build.