From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUDhg-0000Km-KU for qemu-devel@nongnu.org; Tue, 25 Aug 2015 08:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUDhb-0001FS-Gl for qemu-devel@nongnu.org; Tue, 25 Aug 2015 08:51:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUDhb-0001FK-BN for qemu-devel@nongnu.org; Tue, 25 Aug 2015 08:51:47 -0400 From: Markus Armbruster References: <20150818235754.GA31625@igalia.com> <87r3mtq9wx.fsf@blackfin.pond.sub.org> <87oahwr4x1.fsf@blackfin.pond.sub.org> <55DB51DC.6070704@redhat.com> <87d1ybpzul.fsf@blackfin.pond.sub.org> Date: Tue, 25 Aug 2015 14:51:44 +0200 In-Reply-To: (Alberto Garcia's message of "Tue, 25 Aug 2015 10:15:30 +0200") Message-ID: <87pp2blee7.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] QEMU produces invalid JSON due to locale-dependent code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, Gerd Hoffmann Alberto Garcia writes: > On Tue 25 Aug 2015 09:54:42 AM CEST, Markus Armbruster wrote: > >> Switching back to C locale whenever some unwanted locale-dependency >> breaks the code is problematic, because it involves finding all the >> places that break, iteratively (euphemism for "we debug one breakage >> after the other, adding temporary locale switches as we go). >> >> I'd feel much better about confining GTK in its own thread, and >> setting only that thread's locale. > > FWIW GTK+ is not thread safe, all GTK+ code must run in the same thread, > so that should already be happening. I assume however that it's the same > thread that runs the monitor, so that might not be a solution in the > end. If we use thread-local locale for the GTK UI, then anything running in that thread must either not depend on locale, or be properly internationalized. Neither holds for the monitor (or pretty much any non-trivial part of QEMU). Can we give the GTK UI code its very own thread?