obsproject / obs-websocket

Remote-control of OBS Studio through WebSocket
GNU General Public License v2.0
3.91k stars 706 forks source link

Unicode username causing OBS won't launch in normal mode #1244

Open Enderwonder opened 3 months ago

Enderwonder commented 3 months ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

30.2.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/forum/attachments/2024-08-03-21-42-24-txt.106458/

OBS Studio Crash Log URL

https://obsproject.com/forum/attachments/crash-2024-08-07-21-51-42-txt.106680/

Expected Behavior

Should start normally.

Current Behavior

only launch in safe mode

Thread 55E4: (Crashed) Stack EIP Arg0 Arg1 Arg2 Arg3 Address 00000076785BDF30 00007FFFDEFDFABC 00000076785BE090 00000204F2BCABA0 00000204F2CF02C0 00000204F2DAC801 kernelbase.dll!0x7fffdefdfabc 00000076785BE010 00007FFFC3B15267 0000000000000000 00000076785BE378 00000076785BE2C8 0000000000000055 vcruntime140.dll!0x7fffc3b15267 00000076785BE070 00007FFF04FC42F8 0000000000000459 00007FFFDEB4A838 0000020400000459 0000000000000000 obs-websocket.dll!0x7fff04fc42f8 00000076785BE0F0 00007FFF04FC445E 00000076785BE2C8 00000076785BE360 00000076785BE260 0000000000000070 obs-websocket.dll!0x7fff04fc445e 00000076785BE160 00007FFF0506B478 00000076785BE360 0000000000000000 00000076785BE360 00000076785BE3A9 obs-websocket.dll!0x7fff0506b478 00000076785BE340 00007FFF04FC5BEA 00000204F2CF0C80 00000204F2CF0C80 00000204F2D8F660 00000076785BE5A0 obs-websocket.dll!0x7fff04fc5bea 00000076785BE410 00007FFF04FC54F4 00000076785BE5A0 00000076785BE8B0 00000204F2D8F660 00000000FFFFFFFF obs-websocket.dll!0x7fff04fc54f4 00000076785BE550 00007FFF04FD1014 00000204F2BB8B80 0000000053B57BF7 00000204F2BB8B80 0000000000000001 obs-websocket.dll!0x7fff04fd1014 00000076785BE6F0 00007FFF1F8067F2 0000000000000000 0000000000000000 00000204ED891F60 0000000000000BD8 obs.dll!obs_init_module+0x52

Steps to Reproduce

start up OBS in unicode username path

Anything else we should know?

websocket plugins doesn't work in 30.2.2

SuslikV commented 1 month ago

Forum's links (all known cases I found for Windows platform): https://obsproject.com/forum/threads/keep-crashing-normal-and-admin-mode-fault-address-7ff9203fb699-kernelbase-dll-only-can-run-with-safe-mode-can-someone-help-me.177755/post-655398

Most recent one: https://obsproject.com/forum/threads/stratup-crash-with-kernelbase-dll-problem.180491/

(Version: 5.5.2 | RPC Version: 1)

SuslikV commented 5 days ago

re-implementation of the "SetJsonFileContent" routine: https://github.com/obsproject/obs-websocket/commit/bdf812dc09035459bf0f54fece984992443fb663 https://github.com/obsproject/obs-websocket/commit/42e7eb6c344ae62dce9d60baa906002015b85286 eliminated the UTF8 path handling on file saving that previously was done inside the "Utils::Platform::SetTextFileContent" (there UTF8 handling was based on Qt implementation of QString).

meanwhile, migration: https://github.com/obsproject/obs-websocket/commit/af31f1adcaa6f4ff26831af6bae051b6258f0c6a eliminated the OS dependent UTF8 path handling in "Config::Save()" that previously was done through the call: "config_save" -> "os_fopen" -> "os_utf8_to_wcs_ptr" -> "os_wfopen" and similar routines on Windows. Now it uses mentioned above re-implementation of the "SetJsonFileContent" that calls for "GetModuleConfigPath" to get the path string, that itself uses "obs_module_config_path" with proper slash ending but no UTF8 handling of the final string for Windows (at least, I didn't found where the conversion happens).

The "Config::Save()" called right after the password generated at first load of the plugin: https://github.com/obsproject/obs-websocket/blob/eed8a49933786383d11f4868a4e5604a9ee303c6/src/Config.cpp#L87 thus, in the regular log of OBS the last message before the crash is: 21:42:26.838: [obs-websocket] [Config::Load] (FirstLoad) Generating new server password.


In my opinion, the Qt route in conversion of the UTF8 path can be returned back until proper solution will be found.


@Enderwonder can you provide what "Unicode username path" causes the crash? So, the developers be able to reproduce the issue.