audio_settings crashed with AttributeError in store_audio_settings(): 'NoneType' object has no attribute 'group'

Bug #1201126 reported by Paulo Novais
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
checkbox (Ubuntu)
Fix Released
Medium
Daniel Manrique

Bug Description

I was running system test on ubunto 13.10

ProblemType: Crash
DistroRelease: Ubuntu 13.10
Package: checkbox 0.16.3
ProcVersionSignature: Ubuntu 3.10.0-2.11-generic 3.10.0
Uname: Linux 3.10.0-2-generic x86_64
ApportVersion: 2.10.2-0ubuntu4
Architecture: amd64
Date: Sun Jul 14 16:27:32 2013
ExecutablePath: /usr/lib/checkbox/bin/audio_settings
InstallationDate: Installed on 2013-07-05 (8 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64+mac (20130704)
InterpreterPath: /usr/bin/python3.3
MarkForUpload: True
ProcCmdline: /usr/bin/python3 /usr/share/checkbox/scripts/audio_settings store --file=/home/username/.cache/checkbox/pulseaudio_settings
PythonArgs: ['/usr/share/checkbox/scripts/audio_settings', 'store', '--file=/home/username/.cache/checkbox/pulseaudio_settings']
SourcePackage: checkbox
Title: audio_settings crashed with AttributeError in store_audio_settings(): 'NoneType' object has no attribute 'group'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Related branches

Revision history for this message
Paulo Novais (valeptb) wrote :
tags: removed: need-duplicate-check
Changed in checkbox (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in checkbox (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Manrique (roadmr) wrote :

The common factor seems to be that affected systems are using a non-english locale. Thus, our regex doesn't match. Here's sample pactl stat output from a system with spanish locale:

Actualmente en uso: 1 bloques conteniendo 63,9 KiB bytes en total.
Ubicados durante a lo largo del tiempo: 14093 bloques conteniendo 17,0 MiB bytes en total.
Tamaño del cache de muestra: 0 B
Cadena de servidor: /run/user/1000/pulse/native
Versión de protocolo de biblioteca: 28
Versión de protocolo de servidor: 28
Es local: yes
Índice de clientes: 146
Tamaño de tesela: 65472
Nombre de usuario: ubuntu
Nombre de anfitrión: 201103-7376
Nombre de servidor: pulseaudio
Versión de servidor: 4.0
Especificación de muestro predeterminado: s16le 2ch 44100Hz
Mapa de canales predeterminado: front-left,front-right
Destino predeterminado: alsa_output.pci-0000_00_1b.0.analog-stereo
Fuente predeterminada: alsa_input.pci-0000_00_1b.0.analog-stereo
Cookie: c2d5:230a

"Destino predeterminado" is the translated version of "Default Sink". The regex doesn't match:

default_pattern = "(?<=Default %s: ).*"

Thus, line 213 of the script produces the failure:

        default = default_regex.search(pactl_status).group()

We're not checking that default_regex.search suceeded (we just blindly assume it did).

There seems to be some code meant to ensure we always use a default (C) locale (see function unlocalized_env), but it doesn't seem to be working as expected. Work to do: see why this function is failing, and fix it.

In the meanwhile, steps to reproduce:
sudo apt-get install language-pack-es language-pack-gnome-es # feel free to replace for a language you understand
LANG=es_ES.UTF-8 LANGUAGE=es_ES //usr/share/checkbox/scripts/audio_settings store --file=/tmp/cache

Changed in checkbox (Ubuntu):
status: Confirmed → Triaged
Daniel Manrique (roadmr)
information type: Private → Public
Changed in checkbox (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Daniel Manrique (roadmr)
Changed in checkbox (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.16.7

---------------
checkbox (0.16.7) saucy; urgency=low

  * New upstream release(LP: #1236581):

  * Launchpad automated translation updates

  [ Daniel Manrique ]
  * Ensured that pactl commands are run on a properly unlocalized environment
    (LP: #1201126)
  * scripts/gpu_test: Better validation that glxgears windows were found, to
    avoid manipulation of nonexisting windows which causes threads to crash
    and the entire program to stall. (LP: #1232232)
  * parsers/udevadm: Added additional heuristics for mediatek bluetooth
    controllers (LP: #1210405)

  [ Jeff Lane ]
  * scripts/storage_test: test now exits with a warning if the drive is not
    mounted prior to testing (LP: #1224820)

  [ Brendan Donegan ]
  * scripts/fwts_test: Removed dmi_decode and smbios tests that are no longer present
    in fwts and change version dependency to latest version (LP: #1218993)
  * scripts/virtualization - change kvm command to qemu-system-x86_64 as the
    former is deprecated (LP: #1224854)
  * scripts/memory_test - use per-process memory limit if arch is ARM, except
    for arm64 (LP: #1184688)
 -- Daniel Manrique <email address hidden> Mon, 07 Oct 2013 14:50:49 -0400

Changed in checkbox (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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