| Summary: | shutter does not start when not using C locale | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Alex Loginov <loginov_alex> |
| Component: | RPM Packages | Assignee: | QA Team <qa-bugs> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | cazzaniga.sandro, geiger.david68210, grio, guillomovitch, jquelin, loginov_alex, olivier.placais, pterjan, shlomif, sysadmin-bugs, thierry.vignaud, tmb, wilcal.int |
| Version: | 5 | Keywords: | Triaged, validated_update |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | MGA5TOO MGA5-64-OK MGA5-32-OK advisory | ||
| Source RPM: | shutter-0.93-4.1.mga5 | CVE: | |
| Status comment: | |||
|
Manuel Hiebel
2014-11-14 22:41:27 CET
Keywords:
(none) =>
Triaged I had never heard of this application, but it seems to be a 11k lines perl script, not really something I'd want to debug... Also, it actually starts but doesn't display a window. sorry you indeed only made one commit Hi Alex! I am getting similar warnings, but it starts fine here - does it display the system tray icon which you can click to bring the main window (or right click for options)? I'm using Mageia 5 with KDE 4. I tested Mageia 5 Cauldron KDE, LXDE, MATE: there is nothing in tray and no main window for shutter:( (In reply to Alex Loginov from comment #4) > I tested Mageia 5 Cauldron KDE, LXDE, MATE: there is nothing in tray and no > main window for shutter:( does it also happen in a new user? Please test. > does it also happen in a new user? Please test.
Yes, it does.
(In reply to Alex Loginov from comment #6) > > does it also happen in a new user? Please test. > > Yes, it does. shutter works fine inside a Mageia 5 i586 VM. You seem to have some strange problems. Seriously?
He did see a problem and report it.
Let's try it:
[tv@localhost gdb]$ sudo urpmi shutter
(...)
[tv@localhost gdb]$ shutter
defined(@array) is deprecated at /usr/bin/shutter line 3727.
(Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/bin/shutter line 3738.
(Maybe you should just omit the defined()?)
WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!
WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity!
Cannot decode string with wide characters at /usr/lib/perl5/5.20.1/x86_64-linux-thread-multi/Encode.pm line 215, <DATA> line 19.
[tv@localhost gdb]$ echo $?
255
Last thing it does is reading /usr/share/shutter/resources/icons/sel_window_menu.svg
Adding the following to Encode.pm @line 215:
use MDK::Common qw(backtrace); warn ">> HERE\n". backtrace(), "\n";
results in:
>> HERE
Encode::decode_utf8() called from /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm:226
Locale::gettext::_convert() called from /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm:126
Locale::gettext::get() called from /usr/share/shutter/resources/modules/Shutter/App/Menu.pm:597
Shutter::App::Menu::fct_ret_actions_menu() called from /usr/share/shutter/resources/modules/Shutter/App/Menu.pm:75
Shutter::App::Menu::create_menu() called from /usr/bin/shutter:558
Adding eval makes it go further:
my $string = eval {$utf8enc->decode( $octets, $check ) };
So yes it's broken.
Interestingly, it works fine with C locale, but not with another locale.
(. ~/.i18n.C; shutter ) => KOSummary:
shutter does not start =>
shutter does not start when not using C locale s/KO/OK/ And the string that causes the issue (for french locale) is: "_Renommerâ¦" Yet again a poorly written app that doesn't handle UTF-8 smoothly Thierry, thank you for tests and confirmed issue. You're welcome. Though I won't go further (too much stuff) (In reply to Thierry Vignaud from comment #11) > And the string that causes the issue (for french locale) is: > "_Renommerâ¦" > > Yet again a poorly written app that doesn't handle UTF-8 smoothly My locale is: <<<< shlomif@telaviv1:~$ locale LANG=en_GB.UTF-8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=en_GB.UTF-8 LC_TIME=en_GB.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_GB.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=en_GB.UTF-8 LC_ALL= shlomif@telaviv1:~$ >>>> and shutter works fine there. Can you give an example to an offending locale? Ah, I can reproduce the problem with this command: LC_ALL=es_ES.UTF-8 LANG=es_ES.UTF-8 LANGUAGE=es_ES:es shutter Hi all,
here's more of what I discovered.
With this program:
«
#!/usr/bin/perl
use strict;
use warnings;
#Gettext and filename parsing
use POSIX qw/setlocale/;
use Locale::gettext;
#Set LC_NUMERIC to C to prevent decimal commas (or anything else)
setlocale(LC_NUMERIC, "C");
setlocale( LC_MESSAGES, "" );
my $d = Locale::gettext->domain("shutter");
$d->dir('/usr/share/locale');
print $d->get("Session");
»
I am getting:
shlomif@telaviv1:~$ perl Test.pl
Sessionshlomif@telaviv1:~$
but:
«
shlomif@telaviv1:~$ LC_ALL=es_ES.UTF-8 LANG=es_ES.UTF-8 LANGUAGE=es_ES:es perl -MCarp::Always Test.pl
Cannot decode string with wide characters at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Encode.pm line 215.
Encode::decode_utf8("Sesio\x{301}n") called at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm line 226
Locale::gettext::_convert(Locale::gettext=HASH(0x1be3e78), "Sesio\x{301}n") called at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm line 126
Locale::gettext::get(Locale::gettext=HASH(0x1be3e78), "Session") called at Test.pl line 17
shlomif@telaviv1:~$
»
It doesn't happen on Ubuntu x86-64 and I also am unable to build the latest Locale::gettext module from source without its tests failing.
Regards,
-- Shlomi Fish
What do you mean? The latest release dates from 2005... Hi all,
after I built and installed the CPAN module (while ignoring its failed tests), I was able to start shutter fine while using this command line:
< SHELL >
shlomif@telaviv1:~$ LC_ALL=es_ES.UTF-8 LANG=es_ES.UTF-8 LANGUAGE=es_ES:es perl -MCarp::Always /usr/bin/shutter
defined(@array) is deprecated at /usr/bin/shutter line 3727.
(Maybe you should just omit the defined()?)
at /usr/bin/shutter line 3727.
defined(@array) is deprecated at /usr/bin/shutter line 3738.
(Maybe you should just omit the defined()?)
at /usr/bin/shutter line 3738.
WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity!
at /usr/bin/shutter line 9331.
main::fct_init_depend called at /usr/bin/shutter line 134
(shutter:23396): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1 char 43: ' ' is not a valid character following the characters '</'; ' ' may not begin an element name
(shutter:23396): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1 char 43: ' ' is not a valid character following the characters '</'; ' ' may not begin an element name
GLib-CRITICAL **: Source ID 238 was not found when attempting to remove it at /usr/bin/shutter line 7247.
main::fct_show_status_message(1, "\x{a1}Ajustes guardados correctamente!") called at /usr/bin/shutter line 4835
main::fct_save_settings(undef) called at /usr/bin/shutter line 3321
main::__ANON__() called at /usr/bin/shutter line 2884
eval {...} called at /usr/bin/shutter line 2884
shlomif@telaviv1:~$
shlomif@telaviv1:~$
shlomif@telaviv1:~$
< / SHELL >
So it seems to be a problem with our packaging of Locale::gettext . Reassigning.
Regards,
-- Shlomi FishCC:
(none) =>
jquelin (In reply to Thierry Vignaud from comment #17) > What do you mean? > The latest release dates from 2005... I ran "perl Makefile.PL" ; "make" ; "make test" ; "make install" inside the unpacked directory of this archive - https://cpan.metacpan.org/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz - from https://metacpan.org/release/gettext . It looks like using Locale::gettext::dgettext(domain, str) instead of $domain->get(str) works better.
eg this works fine:
print Locale::gettext::dgettext('shutter', "_Rename...");
whereas this doesn't:
my $d = Locale::gettext->domain("shutter");
print $d->get("_Rename...");
Anyway, I think it needs quite some patching in order to work as UTF-8 internally.
Meaning:
- initializing gtk:
Gtk2->set_locale
though using setlocale() should be OK too
- binding gettext to UTF-8:
Locale::gettext::bind_textdomain_codeset($_, 'UTF-8') foreach qw(shutter-upload-plugins shutter-plugins shutter);Source RPM:
perl-Locale-gettext-1.50.0-15.mga5.src.rpm =>
shutter Hi Thiery, (In reply to Thierry Vignaud from comment #20) > It looks like using Locale::gettext::dgettext(domain, str) instead of > $domain->get(str) works better. > > eg this works fine: > print Locale::gettext::dgettext('shutter', "_Rename..."); > > whereas this doesn't: > my $d = Locale::gettext->domain("shutter"); > print $d->get("_Rename..."); Well, $d->get is : sub get { my ($self, $msgid) = @_; $self->_convert(dgettext($self->{domain}, $msgid)); } sub _convert { my ($self, $str) = @_; return $str if ($self->{raw}); # thanks to the use of UTF-8 in bind_textdomain_codeset, the # result should always be valid UTF-8 when raw mode is not used. if ($self->{emulate}) { delete $self->{emulate}; $self->{raw} = 1; my $null = $self->get(""); if ($null =~ /charset=(\S+)/) { $self->{decode_from} = $1; $self->{raw} = 0; } #else matches the behaviour of glibc - no null entry # means no conversion is done } if ($self->{decode_from}) { return decode($self->{decode_from}, $str); } else { return decode_utf8($str); } } And it is expected to work properly instead of throwing a fit on every Unicode codepoint. And people may wish to run Locale::gettext apps from source. > > Anyway, I think it needs quite some patching in order to work as UTF-8 > internally. > Meaning: > - initializing gtk: > Gtk2->set_locale > though using setlocale() should be OK too > - binding gettext to UTF-8: > Locale::gettext::bind_textdomain_codeset($_, 'UTF-8') foreach > qw(shutter-upload-plugins shutter-plugins shutter); This gives me the same error: #!/usr/bin/perl use strict; use warnings; #Gettext and filename parsing use POSIX qw/setlocale/; use Locale::gettext; #Set LC_NUMERIC to C to prevent decimal commas (or anything else) setlocale(LC_NUMERIC, "C"); setlocale( LC_MESSAGES, "" ); Locale::gettext::bind_textdomain_codeset($_, 'UTF-8') foreach (qw(shutter-upload-plugins shutter-plugins shutter)); my $d = Locale::gettext->domain("shutter"); $d->dir('/usr/share/locale'); print $d->get("Session"); ===== Sessionshlomif@telaviv1:~$ LC_ALL=es_ES.UTF-8 LANG=es_ES.UTF-8 LANGUAGE=es_ES:esMCarp::Always Test.pl Cannot decode string with wide characters at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Encode.pm line 215. Encode::decode_utf8("Sesio\x{301}n") called at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm line 226 Locale::gettext::_convert(Locale::gettext=HASH(0x1259318), "Sesio\x{301}n") called at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Locale/gettext.pm line 126 Locale::gettext::get(Locale::gettext=HASH(0x1259318), "Session") called at Test.pl line 19 shlomif@telaviv1:~$ Example:
#!/usr/bin/perl
use Locale::gettext;
my $d = Locale::gettext->domain("test");
print $d->get("пÑовеÑка"), "\n";
returns "Error" with upstream gettext/encode and returns "OK" with Mageia gettext/encode.
Samuel Verschelde
2015-05-31 23:08:04 CEST
Whiteboard:
(none) =>
MGA5TOO
Olivier Placais
2015-08-14 21:31:32 CEST
CC:
(none) =>
olivier.placais
Grio Ru
2015-08-19 19:29:21 CEST
CC:
(none) =>
grio
Alex Loginov
2015-08-22 13:01:07 CEST
Source RPM:
shutter =>
shutter, gettext It was fixed for shutter-0.93.1-4.mga6. Reassign to maintainer of shutter to provide an update for mga5. Source RPM:
shutter, gettext =>
shutter (In reply to Alex Loginov from comment #23) > It was fixed for shutter-0.93.1-4.mga6. > Reassign to maintainer of shutter to provide an update for mga5. shutter-0.93.1-rel1-subrel1 was submitted to http://pkgsubmit.mageia.org/ for Mageia 5 and should be available in updates_testing soon. Please test. Assigning to the QA team. Assignee:
shlomif =>
qa-bugs Tested mga5_64 and mga5_32, Testing complete for new shutter-0.93.1-1.1.mga5, I confirm that the locale issue is now fixed for French system. ---------------------------------------- Before (impossible to use shutter): $ shutter WARNING: Image::ExifTool is missing --> writing Exif information will be disabled! WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity! Cannot decode string with wide characters at /usr/lib/perl5/5.20.1/x86_64-linux-thread-multi/Encode.pm line 215, <DATA> line 19. $ ---------------------------------------- After (now shutter starts, runs and uses French translation properly): $ shutter WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity! $
David GEIGER
2015-10-17 13:23:34 CEST
Whiteboard:
MGA5TOO =>
MGA5TOO MGA5-64-OK MGA5-32-OK
David GEIGER
2015-10-17 13:27:38 CEST
Source RPM:
shutter =>
shutter-0.93-4.1.mga5 Packages in 5/core/updates_testing: ======================== shutter-0.93.1-1.1.mga5.noarch.rpm Source RPM: ======================== shutter-0.93.1-1.1.mga5.src.rpm Advisory: ======================== Updated shutter package fixes utf8 for locales and shutter starts successfully. Before update shutter started using C locale only. ======================== Updated packages in core/updates_testing: ======================== shutter-0.93.1-1.1.mga5.noarch.rpm Source RPM: shutter-0.93.1-1.1.mga5.src.rpm Validating this update Keywords:
(none) =>
validated_update advisory uploaded CC:
(none) =>
tmb An update for this issue has been pushed to Mageia Updates repository. http://advisories.mageia.org/MGAA-2015-0161.html Status:
NEW =>
RESOLVED |
Description of problem: [user@localhost ~]$ shutter defined(@array) is deprecated at /usr/bin/shutter line 3727. (Maybe you should just omit the defined()?) defined(@array) is deprecated at /usr/bin/shutter line 3738. (Maybe you should just omit the defined()?) WARNING: gnome-web-photo is missing --> screenshots of websites will be disabled! WARNING: Image::ExifTool is missing --> writing Exif information will be disabled! WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity! Cannot decode string with wide characters at /usr/lib/perl5/5.20.1/i386-linux-thread-multi/Encode.pm line 215, <DATA> line 19. Version-Release number of selected component (if applicable): shutter-0.93-4.mga5 How reproducible: always Steps to Reproduce: 1. install shutter 2. run shutter Reproducible: Steps to Reproduce: