Closed
Description
[REQUIRED] Please fill in the following fields:
- Pre-built SDK from the website or open-source from this repo: open-source (self built)
- Firebase C++ SDK version: 11.2.0
- Problematic Firebase Component: Remote Config
- Other Firebase Components in use: Auth
- Platform you are using the C++ SDK on: Windows
- Platform you are targeting: desktop
[REQUIRED] Please describe the issue here:
We’re seeing the following crash on first launch when initializing remote config. This seems to happen only if the system language is not English (tested with German), and can be resolved by changing the time zone. Afterwards changing the timezone back works fine, possibly due to caching of remote config data.
I believe this is related to the changes in #1332 by @jonsimantov. The crash occurs in line 116 here:
firebase-cpp-sdk/app/src/locale.cc
Lines 114 to 116 in ab2fd00
Crash log:
OS Version: Windows 10.0.19045 (3086)
Report Version: 104
Crashed Thread: 8596
Application Specific Information:
Fatal Error: Unhandled C++ Exception / 0x7ffe65b6cf19
Thread 8596 Crashed:
0 KERNELBASE.dll 0x7ffe65b6cf19 RaiseException
1 VCRUNTIME140.dll 0x7ffe2948671f _CxxThrowException (throw.cpp:74)
2 MyApp.exe 0x7ff7611db2a1 std::_Throw_range_error (stdexcept:166)
3 MyApp.exe 0x7ff7611dc598 std::wstring_convert<T>::from_bytes (xlocbuf:396)
4 MyApp.exe 0x7ff761285361 [inlined] std::wstring_convert<T>::from_bytes (xlocbuf:366)
5 MyApp.exe 0x7ff761285361 firebase::internal::GetTimezone (locale.cc:116)
6 MyApp.exe 0x7ff7611f2edc firebase::remote_config::internal::RemoteConfigREST::SetupRestRequest (rest.cc:136)
7 MyApp.exe 0x7ff7611f26fa firebase::remote_config::internal::RemoteConfigREST::Fetch (rest.cc:71)
8 MyApp.exe 0x7ff76116f2c8 firebase::remote_config::internal::RemoteConfigInternal::FetchInternal (remote_config_desktop.cc:597)
9 MyApp.exe 0x7ff76116f648 <lambda>::<T> (remote_config_desktop.cc:175)
10 MyApp.exe 0x7ff761170261 [inlined] firebase::callback::CallbackVariadic<T>::RunInternal (callback.h:341)
11 MyApp.exe 0x7ff761170261 firebase::callback::CallbackVariadic<T>::Run (callback.h:332)
12 MyApp.exe 0x7ff7611623e7 firebase::scheduler::Scheduler::TriggerCallback (scheduler.cc:189)
13 MyApp.exe 0x7ff761162232 firebase::scheduler::Scheduler::WorkerThreadRoutine (scheduler.cc:169)
14 MyApp.exe 0x7ff76116ab8e [inlined] std::invoke (type_traits:1574)
15 MyApp.exe 0x7ff76116ab8e std::thread::_Invoke<T> (thread:55)
16 ucrtbase.dll 0x7ffe65731bb1 thread_start<T>
17 KERNEL32.DLL 0x7ffe668e7613 BaseThreadInitThunk
18 ntdll.dll 0x7ffe680826f0 RtlUserThreadStart
Steps to reproduce:
- Set system language to e.g. German:
- Open Windows 10 settings
- Select "Time & language" section
- Click "Add Language" and select "Deutsch (Deutschland)" / "German (Germany)"
- Make German the primary language by moving it to the top of the list of preferred languages
- Reboot
- Initialize Firebase Remote Config