Repository: godot
Issue: Various crashes when running editor from VS debugger with large project.
Labels: bug,topic:core,topic:thirdparty,crash

### Godot version

4.2

### System information

Windows 10

### Issue description

I get different exceptions depending on what scenes were already open in my project's editor when opening it with VS . 
It does however work fine when opening it with compiled non-VS versions.

---

*with no scenes open (closing all scenes before opening the editor with VS):*

crash:
`Unhandled exception at 0x7A2DD408 (nvoglv32.dll) in godot.windows.editor.dev.x86_32.exe: Fatal program exit requested.`
callstack:
```
>	nvoglv32.dll!7a2dd408()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for nvoglv32.dll]	
 	nvoglv32.dll!7a4f83fd()	Unknown
 	nvoglv32.dll!7a4f835c()	Unknown
 	nvoglv32.dll!79ed99fb()	Unknown
 	nvoglv32.dll!79ed9bd5()	Unknown
 	nvoglv32.dll!79f8c9e9()	Unknown
 	nvoglv32.dll!79efe521()	Unknown
 	nvoglv32.dll!79f00e89()	Unknown
 	nvoglv32.dll!79eaf107()	Unknown
 	DXCore.dll!6299991c()	Unknown
 	ntdll.dll!7706f0fa()	Unknown
 	ntdll.dll!7706ee42()	Unknown
 	ntdll.dll!7706eb89()	Unknown
 	ntdll.dll!77045700()	Unknown
 	ntdll.dll!7704564f()	Unknown
 	ntdll.dll!77045fc4()	Unknown
 	kernel32.dll!763afcc9()	Unknown
 	ntdll.dll!77077c6e()	Unknown
 	ntdll.dll!77077c3e()	Unknown
```

not sure the cause of the error above...

---

*with my main scene open:*

crash:
`Unhandled exception at 0x03EDEEBC in godot.windows.editor.dev.x86_32.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x07602FFC).`

full callstack is too long so here is the end of it:
```
 	>	[Inline Frame] godot.windows.editor.dev.x86_32.exe!try_get_FlsGetValue() Line 377	C++
 	godot.windows.editor.dev.x86_32.exe!__acrt_FlsGetValue(unsigned long fls_index) Line 472	C++
 	[Inline Frame] godot.windows.editor.dev.x86_32.exe!try_get_ptd_head() Line 207	C++
 	[Inline Frame] godot.windows.editor.dev.x86_32.exe!internal_get_ptd_head() Line 228	C++
 	[Inline Frame] godot.windows.editor.dev.x86_32.exe!internal_getptd_noexit() Line 268	C++
 	godot.windows.editor.dev.x86_32.exe!__acrt_getptd() Line 284	C++
 	godot.windows.editor.dev.x86_32.exe!_LocaleUpdate::_LocaleUpdate(__crt_locale_pointers * const locale) Line 1874	C++
 	godot.windows.editor.dev.x86_32.exe!common_vsprintf<__crt_stdio_output::standard_base,char>(const unsigned __int64 options, char * const buffer, const unsigned int buffer_count, const char * const format, __crt_locale_pointers * const locale, char * const arglist) Line 156	C++
 	godot.windows.editor.dev.x86_32.exe!__stdio_common_vsprintf(unsigned __int64 options, char * buffer, unsigned int buffer_count, const char * format, __crt_locale_pointers * locale, char * arglist) Line 239	C++
 	godot.windows.editor.dev.x86_32.exe!vsnprintf(char * const _Buffer, const unsigned int _BufferCount, const char * const _Format, char * _ArgList) Line 1439	C++
 	godot.windows.editor.dev.x86_32.exe!WindowsTerminalLogger::logv(const char * p_format, char * p_list, bool p_err) Line 47	C++
 	godot.windows.editor.dev.x86_32.exe!Logger::logf_error(const char * p_format, ...) Line 116	C++
 	godot.windows.editor.dev.x86_32.exe!Logger::log_error(const char * p_function, const char * p_file, int p_line, const char * p_code, const char * p_rationale, bool p_editor_notify, Logger::ErrorType p_type) Line 88	C++
 	godot.windows.editor.dev.x86_32.exe!WindowsTerminalLogger::log_error(const char * p_function, const char * p_file, int p_line, const char * p_code, const char * p_rationale, bool p_editor_notify, Logger::ErrorType p_type) Line 87	C++
 	godot.windows.editor.dev.x86_32.exe!CompositeLogger::log_error(const char * p_function, const char * p_file, int p_line, const char * p_code, const char * p_rationale, bool p_editor_notify, Logger::ErrorType p_type) Line 257	C++
 	godot.windows.editor.dev.x86_32.exe!OS::print_error(const char * p_function, const char * p_file, int p_line, const char * p_code, const char * p_rationale, bool p_editor_notify, Logger::ErrorType p_type) Line 88	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, const char * p_message, bool p_editor_notify, ErrorHandlerType p_type) Line 88	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, bool p_editor_notify, ErrorHandlerType p_type) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!Memory::alloc_static(unsigned int p_bytes, bool p_pad_align) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!CowData<char32_t>::resize<0>(int p_size) Line 291	C++
 	godot.windows.editor.dev.x86_32.exe!String::resize(int p_size) Line 218	C++
 	godot.windows.editor.dev.x86_32.exe!String::parse_utf8(const char * p_utf8, int p_len, bool p_skip_cr) Line 1879	C++
 	godot.windows.editor.dev.x86_32.exe!String::utf8(const char * p_utf8, int p_len) Line 1784	C++
 	godot.windows.editor.dev.x86_32.exe!EditorLog::_error_handler(void * p_self, const char * p_func, const char * p_file, int p_line, const char * p_error, const char * p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) Line 52	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, const char * p_message, bool p_editor_notify, ErrorHandlerType p_type) Line 97	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, bool p_editor_notify, ErrorHandlerType p_type) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!Memory::alloc_static(unsigned int p_bytes, bool p_pad_align) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!CowData<char32_t>::resize<0>(int p_size) Line 291	C++
 	godot.windows.editor.dev.x86_32.exe!String::resize(int p_size) Line 218	C++
 	godot.windows.editor.dev.x86_32.exe!String::parse_utf8(const char * p_utf8, int p_len, bool p_skip_cr) Line 1879	C++
 	godot.windows.editor.dev.x86_32.exe!String::utf8(const char * p_utf8, int p_len) Line 1784	C++
 	godot.windows.editor.dev.x86_32.exe!EditorLog::_error_handler(void * p_self, const char * p_func, const char * p_file, int p_line, const char * p_error, const char * p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) Line 52	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, const char * p_message, bool p_editor_notify, ErrorHandlerType p_type) Line 97	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, bool p_editor_notify, ErrorHandlerType p_type) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!Memory::alloc_static(unsigned int p_bytes, bool p_pad_align) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!CowData<char32_t>::resize<0>(int p_size) Line 291	C++
 	godot.windows.editor.dev.x86_32.exe!String::resize(int p_size) Line 218	C++
 	godot.windows.editor.dev.x86_32.exe!String::parse_utf8(const char * p_utf8, int p_len, bool p_skip_cr) Line 1879	C++
 	godot.windows.editor.dev.x86_32.exe!String::utf8(const char * p_utf8, int p_len) Line 1784	C++
 	godot.windows.editor.dev.x86_32.exe!EditorLog::_error_handler(void * p_self, const char * p_func, const char * p_file, int p_line, const char * p_error, const char * p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) Line 52	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, const char * p_message, bool p_editor_notify, ErrorHandlerType p_type) Line 97	C++
 	godot.windows.editor.dev.x86_32.exe!_err_print_error(const char * p_function, const char * p_file, int p_line, const char * p_error, bool p_editor_notify, ErrorHandlerType p_type) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!Memory::alloc_static(unsigned int p_bytes, bool p_pad_align) Line 77	C++
 	godot.windows.editor.dev.x86_32.exe!CowData<char32_t>::resize<0>(int p_size) Line 291	C++



loops on a lot... can't get the beginning of the call stack because "The maximum number of stack frames supported by Visual Studio has been exceeded."
```

I think the call in stdio.h at  line 1439: 
```
int const _Result = __stdio_common_vsprintf(
            _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
            _Buffer, _BufferCount, _Format, NULL, _ArgList);
```
Can't handle the size of something in my project.




I only want to address these two cases at the moment.


### Steps to reproduce

You might be able to produce similar results it if you have a really large project to open in the editor with VS debugger but overall I can't say what the exact cause could be.

### Minimal reproduction project

N/A