Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument to setlocale in stringprintf_unittest.cc #6993

Closed
VemundH opened this issue Dec 6, 2019 · 2 comments
Closed

Invalid argument to setlocale in stringprintf_unittest.cc #6993

VemundH opened this issue Dec 6, 2019 · 2 comments
Assignees
Labels
c++ platform related Any issue releated to specific platform or OS windows

Comments

@VemundH
Copy link

VemundH commented Dec 6, 2019

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
@elharo elharo added c++ platform related Any issue releated to specific platform or OS windows labels Sep 13, 2021
@jorgbrown
Copy link
Contributor

What debug assertion are you seeing?

@VemundH
Copy link
Author

VemundH commented Oct 23, 2022

Looks like this was fixed in #8735

@VemundH VemundH closed this as completed Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ platform related Any issue releated to specific platform or OS windows
Projects
None yet
Development

No branches or pull requests

3 participants