GNOME Bugzilla – Bug 793098
Running in an invalid locale causes critical warnings
Last modified: 2018-02-01 18:24:02 UTC
Running gnome-calculator as follows results in some warnings: CHARSET="Spanish Inquisition" gcalccmd -s 1+1 GLib: Cannot convert message: Conversion from character set “UTF-8” to “Spanish Inquisition” is not supported ** (process:14208): CRITICAL **: string_get_char: assertion 'self != NULL' failed ** (process:14208): CRITICAL **: string_get_char: assertion 'self != NULL' failed --- The first warning (from GLib) is expected and correct. The two critical warnings below it are not. They are probably the result of not handling potential of an error from a g_locale_to_utf8() call (or a g_utf8_to_locale() call). I guess that might be happening inside Vala. Originally reported as bug #685691.
Indeed, there was a call of string.locale_to_utf8 returning null, and calc was trying to .get(0). Fixed that with additional checks, no more warnings. This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.