Created attachment 224718 [details]
.c that illustrates the bug
Compile and run the attached program.
The second newlocale() overwrites LC_COLLATE of the object created by the first newlocale(); the objects should be completely independent
It's not really destroyed, rather this is a corner case for 3 locales - C, POSIX, C.UTF-8 - using the same static (as in "not loaded from file") collate object, and using newlocale() simply overwrites the name.
I had considered the possibility that POSIX and C would have the same collating sequence. But before I filed the report, I tried a third locale, which happened to be C.UTF-8. I couldn't imagine that it would have the same collating sequence as the other two, and still don't.
\xC0\x80 is a legal sequence in the first two locales, but not in the third. Are you ignoring input validity in collation?