[Bug 685650] New: GStreamer should not set the locale

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Oct 7 03:38:42 PDT 2012


https://bugzilla.gnome.org/show_bug.cgi?id=685650
  GStreamer | gstreamer (core) | git

           Summary: GStreamer should not set the locale
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: holgerar at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


The function init_pre() in gstreamer/gst/gst.c calls setlocale(LC_ALL, ""),
which sets the locale to the values specified in the environment.  This is
wrong for two reasons:

1. It is absolutely not the task of a library to decide on the correct locale
for a program.  Some programs change the locale for various (good or bad)
reasons, and libraries should respect that.  Programs where GStreamer's
overwriting of the locale causes bugs include Emacs [1, 2], Sublime Text [3],
and Lua [4].

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12392
[2] http://bugzilla.novell.com/show_bug.cgi?id=779426
[3] http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8543
[4] https://github.com/pavouk/lgi/issues/19

Note that setting the locale can cause problems for programs that are not even
linked against GStreamer.  In the case of Emacs, for example, GStreamer seems
to be initialized through GTK via libcanberra.

2. Setting the locale is not thread-safe, and therefore should not be done in a
library.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list