Skip to content

[Bug] Remote config thread crashes getting timezone on non-English Windows systems #1367

Closed
@triplef

Description

@triplef

[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:

// Convert time zone name to wide string
std::wstring_convert<std::codecvt_utf8<wchar_t>> to_utf16;
std::wstring windows_tz_utf16 = to_utf16.from_bytes(windows_tz_utf8);

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:

  1. 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
  2. Initialize Firebase Remote Config

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions