taking screenshots with mirscreencast fails if env locale does not exist

Bug #1423359 reported by Leo Arias
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
New
Undecided
Unassigned
autopkgtest (Ubuntu)
Fix Released
Low
Martin Pitt
mir (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

From autopilot we see this when there is a failed test.

21:40:25.138 ERROR testcase:387 - Taking screenshot failed: Command '['mirscreencast', '-m', '/run/mir_socket', '-n', '1', '-f', '/tmp/ap-screenshot-data-1424295625.rgba']' returned non-zero exit status 1

I tried setting the LC_ALL env var to C, and it works.

Revision history for this message
Leo Arias (elopio) wrote :

Is there a reason adt-run is not setting that env var?

We can work this around in our tests, so I'm not sure if this is an autopkgteste bug.

Revision history for this message
Martin Pitt (pitti) wrote :

autopkgtest defaults to setting LANG=C.UTF-8, unless you use --leave-lang or --set-lang. What is the particular error message from mirscreencast, and why is it specific to the locale? That sounds like a bug in mirscreencast.

Changed in autopkgtest (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

BTW, setting LC_ALL to "C" is a wontfix. If something doesn't work with UTF-8 it is just plain broken. In Ubuntu we have never supported any encoding other than UTF-8, and "C" is not an appropriate locale for any user/session.

Revision history for this message
Leo Arias (elopio) wrote :

Well, setting LC_ALL to UTF-8 works too. Is that a better option?

Here is the error without the env var:

phablet@ubuntu-phablet:~$ mirscreencast -m /run/mir_socket -n 1 -f /tmp/screenshot
[1424364638.640752] Loader: Loading modules from: /usr/lib/arm-linux-gnueabihf/mir/client-platform/
Failed to connect to server. Error was :locale::facet::_S_create_c_locale name not valid

It doesn't take the screenshot.

With the env var it also shows errors, but it takes the screenshot.

phablet@ubuntu-phablet:~$ LC_ALL=C.UTF-8 mirscreencast -m /run/mir_socket -n 1 -f /tmp/screenshot
[1424364644.571105] Loader: Loading modules from: /usr/lib/arm-linux-gnueabihf/mir/client-platform/
[1424364644.574196] Loader: Loading module: /usr/lib/arm-linux-gnueabihf/mir/client-platform/android.so
[1424364644.576286] Loader: Loading module: /usr/lib/arm-linux-gnueabihf/mir/client-platform/mesa.so
[1424364644.577963] Loader: Loading module: /usr/lib/arm-linux-gnueabihf/mir/client-platform/dummy.so
[1424364644.631667] <ERROR> mircommon: Caught exception at Mir/EGL driver boundary (in setSwapInterval): /build/buildd/mir-0.11.0+15.04.20150209.1/src/client/buffer_stream.cpp(283): Throw in function virtual void mir::client::BufferStream::request_and_wait_for_configure(MirSurfaceAttrib, int)
Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorISt11logic_errorEEEE
std::exception::what: Attempt to set swap interval on screencast is invalid

phablet@ubuntu-phablet:~$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=eo.UTF-8
LC_TIME=eo.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=eo.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=eo.UTF-8
LC_NAME=eo.UTF-8
LC_ADDRESS=eo.UTF-8
LC_TELEPHONE=eo.UTF-8
LC_MEASUREMENT=eo.UTF-8
LC_IDENTIFICATION=eo.UTF-8
LC_ALL=

Changed in autopkgtest (Ubuntu):
status: Incomplete → New
Revision history for this message
Martin Pitt (pitti) wrote :

Ah, this is our old friend https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391964 again: It's a mis-feature that ssh (which runs behind phablet-shell) is blindly transfering the host's locale to the remote target even if the target doesn't support that locale.

We can work around that in adt-run by pruning the locale settings more aggressively.

Changed in autopkgtest (Ubuntu):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Adding Mir task, mirscreencast shouldn't completely fail on an invalid locale.

Changed in mir (Ubuntu):
status: New → Triaged
Changed in autopkgtest (Ubuntu):
importance: Undecided → Low
assignee: nobody → Martin Pitt (pitti)
tags: added: screencast
Martin Pitt (pitti)
Changed in autopkgtest (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 3.9.7

---------------
autopkgtest (3.9.7) unstable; urgency=medium

  * Include "Package-Type: deb" marked packages for testing. Fixes regression
    with testing paramiko.
  * adt-virt-qemu: Robustify setupup of shared /autopkgtest directory.
  * VirtSubProc.expect(): Read data without delay as long as we have some.
  * adt-virt-qemu: Add --show-boot option to show boot messages from serial
    console.
  * adt-setup-vm: Configure "console=ttyS0" boot option in grub on non-i386
    architectures too, to fix serial consoles with systemd images. Create
    /etc/default/grub.d/ if necessary.
  * adt-setup-vm: Only configure grub if update-grub is available.
    (Closes: #778907)
  * adt-virt-qemu: Increase reboot and dpkg-reconfigure timeouts; on loaded
    machines these might take longer than 5s.
  * adt-run: Unless --leave-lang is given, unset $LANGUAGE and all $LC_* for
    tests, to avoid clobbering the testbed locale with the host's.
    (LP: #1423359)

 -- Martin Pitt <email address hidden> Sun, 22 Feb 2015 13:30:35 +0100

Changed in autopkgtest (Ubuntu):
status: Fix Committed → Fix Released
Dave Morley (davmor2)
tags: added: qa-manual-testing
summary: - taking screenshots with mirscreencast fails
+ taking screenshots with mirscreencast fails if locale is not C.
Martin Pitt (pitti)
summary: - taking screenshots with mirscreencast fails if locale is not C.
+ taking screenshots with mirscreencast fails if env locale does not exist
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.