Post

Replies

Boosts

Views

Activity

Reply to libsystem_c.dylib: Assertion failed: (p->val == key), function lookup_substsearch, file collate.c, line 596.
I work on supporting the Perl5 programming language. We've gotten reports with this failure. I can add that this bug seems to have been introduced sometime in MacOS 15. Our response has been to turn off locale collation support on any MacOS 15, and higher. That means that collation always uses the C locale built-in rules, skipping the broken Apple code. Thanks for filing this report. I've grown cynical about Apple's commitment to fixing their bugs. The fact that when I click on the link about your ticket, and get "Feedback Not Found" only increases that cynicism. The cynicism started with our reporting 10 years ago that /usr/share/locale/zh_CN.GB18030/LC_COLLATE is a broken link, and that report has not resulted in any fix, though the fix is trivial. I have read the Apple libc implementation of locales. It appears to have been taken 20 years ago from FreeBSD, and not updated to include the FreeBSD fixes that have been made since. As a result, querylocale() has races, nl_langinfo() is broken, as is the POSIX 2008 LC_NUMERIC handling (See https://github.com/Perl/perl5/issues/21556). Apple's implementation of locales is the worst of any major OS. We've had to cripple our normal support for locales when running on Darwin.
Topic: Programming Languages SubTopic: General Tags:
Jun ’25