protobuf
protobuf copied to clipboard
Invalid argument to setlocale in stringprintf_unittest.cc
What version of protobuf and what language are you using? Version: 3.11.1 Language: C++
What operating system (Linux, Windows, ...) and version? Windows
What runtime / compiler are you using (e.g., python version or gcc version) Visual Studio 2019
What did you do? Compile - debug build run tests
What did you expect to see No test failures
What did you see instead? Stops due to debug assertion in setlocale call
Problem in src/google/protobuf/stubs/stringprintf_unittest.cc Two occurrences of code like this:
char* old_locale = setlocale(LC_CTYPE, nullptr);
setlocale(LC_CTYPE, "en_US.utf8"); // invalidates old_locale here
...
setlocale(LC_CTYPE, old_locale); // assertion failure
What debug assertion are you seeing?
Looks like this was fixed in #8735