LC_CTYPE=UTF causes libreadline applications to crash due to invalid locale on non-Ubuntu systems #840
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cool-retro-term, at least on macOS, sets LC_FTYPE to UTF-8, and no other locale information. This is an invalid locale (it should be unset, or set to 'C'), but it has a rather disastrous interaction with programs compiled against older versions of readline that have NLS enabled
This causes bash on illumos to crash when logging via SSH (https://github.com/omniosorg/omnios-build/issues/3537#event-12361550471), which took an extended effort to debug and find. The issue is in most versions of libreadline, but has been patched upstream at this point.
Ubuntu has a special script,
/etc/profile.d/01-locale-fix.sh
which resets the locale to something valid which prevents this issue from cropping up there.The problem in cool-retro-term is here:
63228027e1/src/ksession.cpp (L84)
On Linux, it should probably just accept whatever LC_* it gets from the login environment as is. That said, setting LC_CTYPE only affects the output of tolower() , toupper() and isalpha(), and a few other functions, and its usually errorous to set it without other locale information.