If __libcpp_mbsrtowcs_l outputs zero wchar_t's for week days or month names (due to errors in the locale function setup), these are matched all the time in __time_get_storage::__analyze, ending up in an infinite loop, allocating more memory until killed.
Details
Details
- Reviewers
EricWF ldionne mclow.lists - Group Reviewers
Restricted Project - Commits
- rG1127ef789c02: [libcxx] Error out if __libcpp_mbsrtowcs_l fails in __time_get_storage
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
To test the issue itself, you'd need a platform with broken locale functions, and the issue is triggered by a number of the existing testcases.
The locale functions were broken in such a way on windows, triggering this issue, prior to D69505 - and that patch fixed around 11 of the previously broken tests.
Before the patch that fixed the windows issue, the symptom of the problem was libc++ getting stuck in infinite loops; with this patch it would error out much more cleanly, which would have made it a bit easier to locate the root cause behind D69505.
So this patch doesn't fix any issue, it just changes a bad failure case (infinite loop) into a more manageable one (throwing an error).