Date: Thu, 01 Sep 2016 20:00:37 +0000 From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: maintainer-approval requested: [Bug 212310] devel/glib20: Error messages with trailing garbage when uninstalling devel/gnome-vfs : [Attachment 174298] glib.diff Message-ID: <bug-212310-6497-46TIwoDZiA@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-212310-6497@https.bugs.freebsd.org/bugzilla/> References: <bug-212310-6497@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
Tobias Kortkamp <t@tobik.me> has asked gnome@FreeBSD.org for maintainer-approval: Bug 212310: devel/glib20: Error messages with trailing garbage when uninstalling devel/gnome-vfs https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212310 Attachment 174298: glib.diff https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174298&action=edit --- Comment #1 from Tobias Kortkamp <t@tobik.me> --- Created attachment 174298 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174298&action=edit glib.diff The example can be a lot smaller: #include <errno.h> #include <glib.h> #include <locale.h> #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { setlocale(LC_ALL, ""); const gchar *err = g_strerror(ENOENT); printf("%lu: %s\n", strlen(err), err); return 1; } And it's also pretty clear that the problem is in devel/glib20 and in g_strerror. g_strerror is defined in glib/gstrfunc.c line 1254. We see this snippet in there if (!g_get_charset (NULL)) { msg = g_locale_to_utf8 (msg, -1, NULL, NULL, &error); if (error) g_print ("%s\n", error->message); } When g_get_charset returns FALSE (which it does when we setlocale(LC_ALL, "")) msg is a pointer to a local variable which is put into a GHashTable and returned. Adding else msg = g_strdup(buf); fixes the problem or at least prevents printing of garbage values. glib master has a similar patch for this: else if (msg == (const gchar *)buf) msg = g_strdup (buf); Also see https://git.gnome.org/browse/glib/commit/glib/gstrfuncs.c?id=f87e002313d566dcce 71a9aba040d22ddb5c1e80 I'm attaching a patch against devel/glib20 with a backport of this. Poudriere testport 9.3/amd64 ok
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212310-6497-46TIwoDZiA>
