setlocale卡在Windows上

setlocale(LC_ALL,“uk-UA”)有时会因为未知原因而挂起/死锁.调用堆栈是:
ntdll.dll!_ZwWaitForSingleObject@12()   Unknown
ntdll.dll!_RtlpWaitOnCriticalSection@8()    Unknown
ntdll.dll!_RtlEnterCriticalSection@4()  Unknown
ntdll.dll!_LdrpLoadDll@28() Unknown
ntdll.dll!_LdrLoadDll@16()  Unknown
KernelBase.dll!_LoadLibraryExW@12() Unknown
ucrtbased.dll!__crt_findfile_traits::get_invalid_value(void)    Unknown
ucrtbased.dll!__acrt_lock_and_call<class <lambda_a463b7b0560cfcaf9b17f27c6ef46564> >(enum __acrt_lock_id,class <lambda_a463b7b0560cfcaf9b17f27c6ef46564> &&)    Unknown
ucrtbased.dll!__acrt_lock_and_call<class <lambda_a463b7b0560cfcaf9b17f27c6ef46564> >(enum __acrt_lock_id,class <lambda_a463b7b0560cfcaf9b17f27c6ef46564> &&)    Unknown
ucrtbased.dll!___acrt_can_use_vista_locale_apis()   Unknown
ucrtbased.dll!__expandlocale()  Unknown
ucrtbased.dll!__wsetlocale()    Unknown
ucrtbased.dll!__crt_call_and_cleanup<class <lambda_565169b3e3b494427ce1bebdd17b54ac>,class <lambda_f51fe5fd7c79a33db34fc9310f277369> >(class <lambda_565169b3e3b494427ce1bebdd17b54ac> &&,class <lambda_f51fe5fd7c79a33db34fc9310f277369> &&)   Unknown
ucrtbased.dll!__crt_seh_guarded_call<void>::operator()<class <lambda_0f92d0c5a8007722f95b3b6c71cd8e3e>,class <lambda_321f9d61c14d59ff00145e45db1313e0> &,class <lambda_3298c911d7b53f44106027a7fde9a80a> >(class <lambda_0f92d0c5a8007722f95b3b6c71cd8e3e> &&,class <lambda_3298c911d7b53f44106027a7fde9a80a> &&) Unknown
ucrtbased.dll!__acrt_lock_and_call<class <lambda_321f9d61c14d59ff00145e45db1313e0> >(enum __acrt_lock_id,class <lambda_321f9d61c14d59ff00145e45db1313e0> &&)    Unknown
ucrtbased.dll!__crt_call_and_cleanup<class <lambda_565169b3e3b494427ce1bebdd17b54ac>,class <lambda_f51fe5fd7c79a33db34fc9310f277369> &&)   Unknown
ucrtbased.dll!__crt_seh_guarded_call<void>::operator()<class <lambda_507d9fd6b66e39451a8852ba73f804a7>,class <lambda_565169b3e3b494427ce1bebdd17b54ac> &,class <lambda_f51fe5fd7c79a33db34fc9310f277369> &>(class <lambda_507d9fd6b66e39451a8852ba73f804a7> &&,class <lambda_f51fe5fd7c79a33db34fc9310f277369> &) Unknown
ucrtbased.dll!__crt_call_and_cleanup<class <lambda_565169b3e3b494427ce1bebdd17b54ac>,class <lambda_f51fe5fd7c79a33db34fc9310f277369> &&)   Unknown
ucrtbased.dll!__wsetlocale()    Unknown
ucrtbased.dll!___acrt_update_multibyte_info()   Unknown
ucrtbased.dll!_setlocale()  Unknown

有时它有效,但有时它永远不会从它返回.我无法确定原因.我使用Visual Studio 2015和Windows 7.

这是Universal CRT的TH1版本(10.0.10240)中的一个错误.该错误已在Windows 10 November Update(TH2)版本(10.0.10586)中修复.

您可以从https://dev.windows.com/en-us/downloads/windows-10-sdk下载并安装更新的Windows 10 SDK.此SDK包含静态通用CRT库,调试通用CRT DLL(ucrtbased.dll等),以及用于应用程序本地重新分发的零售通用CRT DLL.

您可以从https://www.microsoft.com/en-us/download/details.aspx?id=50410下载更新的Universal CRT可再发行组件.这些组件包含更新的零售Universal CRT,用于在系统目录中进行集中部署.

相关文章

(1)when you ping a computer from itsafe,the ping command should return the local IP address. (...
1、点击win菜单,点击设置图标 2、选择系统选项 3、选择应用与程序选项 4、拉到最下方,选择程序与功能...
目前一直直接往Windows 2008 R2 Server中复制文件(暂时还没有搭建ftp服务),突然不能复制了,于是百度...
windows下使用vscode配合xebug调试php脚本 要下载有php_xebug.dll扩展的版本,最新版可能没有这个扩展,p...
在控制面板的程序与功能里启用和关闭windows功能打开,适用于linux的windows子系统
效果演示 推荐一个非常牛的文档网站生成器:docsify 我通过这个工具,成功将码云上的个人学习笔记发布到...