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

std::locale::global is unsafe #114

Open
amirgon opened this issue Mar 27, 2024 · 0 comments
Open

std::locale::global is unsafe #114

amirgon opened this issue Mar 27, 2024 · 0 comments

Comments

@amirgon
Copy link

amirgon commented Mar 27, 2024

Tabulate code calls std::locale::global in several places.
std::locale::global is not thread-safe and makes tabulate unsafe to use inside a larger multithreaded application.
An application might change the locale at any time and conflict with tabulate calls to std::locale::global.
This is not a theoretical issue, I actually experienced application crashes until I removed all std::locale::global calls from tabulate.

I suggest removing all calls to std::locale::global and either pass locale directly to functions that accept locale as an argument, or use imbue to configure a stream to a locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant