After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702425 - ges-launch: make it portable to all locales.
ges-launch: make it portable to all locales.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
git master
Other Linux
: Normal major
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-17 07:38 UTC by Alban Browaeys
Modified: 2013-07-01 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ges-launch: make it portable to all locales. (1.46 KB, patch)
2013-06-17 07:38 UTC, Alban Browaeys
committed Details | Review

Description Alban Browaeys 2013-06-17 07:38:47 UTC
Created attachment 247001 [details] [review]
ges-launch: make it portable to all locales.

Call setlocale (LC_ALL, "") as per setlocale man page
to make ges-launch portable to all locales (instead of default
"C" one).

Fixes g_option_context_parse on:
$ ges-launch-1.0 --verbose -r -q /home/prahal/Vidéos/Test3.xges -o
file:///home/prahal/Test3.mpeg
Error initializing: Invalid byte sequence in conversion input

The accentuated character in "Vidéos" the french xdg user directory
for "Videos" is what is choked upon.
Comment 1 Sebastian Dröge (slomo) 2013-06-18 11:46:05 UTC
Isn't this also necessary for gst-launch and friends then?
Comment 2 Alban Browaeys 2013-06-18 15:13:02 UTC
I bet ges-launch is specific in that it does not call gettext .
A comment in gettext source code give a hint but no definitive answer:
http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/localename.c#n2667
that is that gettext uses setlocale to get the locale value .
Then on system where gettext would not find setlocale or setlocale with null argument support adding setlocale(LC_ALL, "") would be moot.
To sum up : ges-launch as non getttextized is the only affected one. Adding setlocale to all the programs before gettext calls would be cleaner but stuff for another less severe bug report.
Comment 3 Sebastian Dröge (slomo) 2013-06-19 09:12:55 UTC
But neither gst-launch nor ges-launch call gettext. What's the real difference between both in this regard?
Comment 4 Alban Browaeys 2013-06-20 07:40:39 UTC
By the way, I managed to get the backtrace:

(gdb) bt
  • #0 g_set_error_literal
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gerror.c line 592
  • #1 g_convert_with_iconv
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 763
  • #2 g_convert
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 885
  • #3 g_locale_to_utf8
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 1216
  • #4 parse_arg
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1160
  • #5 parse_short_option
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1425
  • #6 g_option_context_parse
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1926
  • #7 main
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/gst-editing-services/tools/ges-launch.c line 494
  • #3 g_locale_to_utf8
  • #0 g_set_error_literal
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gerror.c line 592
  • #1 g_convert_with_iconv
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 763
  • #2 g_convert
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 885
  • #3 g_locale_to_utf8
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 1216
  • #4 parse_arg
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1298
  • #5 parse_long_option
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1537
  • #6 g_option_context_parse
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1870
  • #7 main
    at gst-launch.c line 1001

Comment 5 Alban Browaeys 2013-06-20 07:42:35 UTC
bugzilla folded too much into the previous backtrace: after the first backtrace I wrote that (could be seen in the source of the previous trace):

which confirm the issue is with setlocale.



About gettext. Indeed gettext-runtime is not called , only glibc gettext implementation. I shinted to much.


About other gstreamer tools: only the arguments parsed via g_option_context_parse are breaking (the pipeline parser does not). Thus stressing gst-launch-1.0 via the only paramaters I found where oe could have accentuated characters (say a local plugin directory in a home subdirectory with a non ascii character in its name) i can reproduce:
Breakpoint 2, g_set_error_literal (err=0x7fffffffbfc8, domain=51, code=1, message=0x7ffff73e6ae0 "Invalid byte sequence in conversion input")
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gerror.c:592
592	  if (err == NULL)
(gdb) bt
  • #0 g_set_error_literal
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gerror.c line 592
  • #1 g_convert_with_iconv
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 763
  • #2 g_convert
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 885
  • #3 g_locale_to_utf8
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gconvert.c line 1216
  • #4 parse_arg
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1298
  • #5 parse_long_option
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1537
  • #6 g_option_context_parse
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/goption.c line 1870
  • #7 main
    at gst-launch.c line 1001

Comment 6 Sebastian Dröge (slomo) 2013-07-01 08:01:23 UTC
I see, thanks for all these explanations!
Comment 7 Sebastian Dröge (slomo) 2013-07-01 08:08:36 UTC
Can you open other bugs with patches for gst-inspect, etc?

commit 6a187e09ddd1de1941cbedec58ecb32ef9752ae1
Author: Alban Browaeys <prahal@yahoo.com>
Date:   Mon Jun 17 07:55:54 2013 +0200

    ges-launch: make it portable to all locales.
    
    Call setlocale (LC_ALL, "") as per setlocale man page
    to make ges-launch portable to all locales (instead of default
    "C" one).
    
    Fixes g_option_context_parse on:
    $ ges-launch-1.0 --verbose -r -q /home/prahal/Vidéos/Test3.xges -o
    file:///home/prahal/Test3.mpeg
    Error initializing: Invalid byte sequence in conversion input
    
    The accentuated character in "Vidéos" the french xdg user directory
    for "Videos" is what is choked upon.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702425