IOError: [Errno 2] No such file or directory: '/proc/asound/cards'

Bug #626215 reported by Tomas Cassidy
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt
Lucid
Won't Fix
Low
Unassigned

Bug Description

Binary package hint: apport

I just attempted to report a bug against linux using "ubuntu-bug linux" when I got the following error:

***

Testing the upstream kernel can help isolate issues in Ubuntu kernel patches, discover a bug is fixed upstream, or confirm the issue exists upstream. It would be great if you could test with the upstream kernel and let us know your results by posting a comment in the bug report. For information on testing the upstream kernel, refer to https://wiki.ubuntu.com/KernelTeam/MainlineBuilds

Press any key to continue...

.hook /usr/share/apport/package-hooks//source_linux.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport/report.py", line 636, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/package-hooks//source_linux.py", line 122, in add_info
    attach_alsa(report)
  File "/usr/lib/python2.6/dist-packages/apport/hookutils.py", line 202, in attach_alsa
    for line in open('/proc/asound/cards'):
IOError: [Errno 2] No such file or directory: '/proc/asound/cards'
...

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: apport 1.13.3-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-24.41-server 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-server x86_64
Architecture: amd64
Date: Sun Aug 29 20:03:46 2010
PackageArchitecture: all
ProcEnviron:
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: apport

Revision history for this message
Tomas Cassidy (tomas-cassidy) wrote :
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

It looks like this bug affects systems that do not have a file: /proc/asound/cards. This is the case for many server deployments. The specific section of code in /usr/lib/python2.6/dist-packages/apport/hookutils.py is this for loop:

for line in open('/proc/asound/cards'):
        if ']:' in line:
            fields = line.lstrip().split()
            cards.append(int(fields[0]))

Maybe add a test for that file first?

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

Fixed in trunk.

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

This bug was fixed in the package apport - 1.17-0ubuntu1

---------------
apport (1.17-0ubuntu1) natty; urgency=low

  * New upstream release:
    - Better standard bug titles for Python crashes. Thanks Matt Zimmerman!
      (LP: #681574)
    - Add handler for uncaught Java exceptions. There is no integration for
      automatically intercepting all Java crashes yet, see java/README.
      Thanks Matt Zimmerman! (LP: #548877)
    - GTK frontend: Require GTK 3.0.
    - launchpad.py: Default to "production" instance, not "edge", since edge
      is obsolete now.
    - hookutils.py, attach_alsa(): Fix crash if /proc/asound/cards does not
      exist. (LP: #626215)
    - ui.py, format_filesize(): Fix to work with stricter locale.format() in
      Python 2.7. (LP: #688535). While we are at it, also change it to use
      base-10 units.
    - hookutils.py, package_versions(): Always include all requested package
      names even if they're unknown to us. Thanks Matt Zimmerman!
      (LP: #695188)
    - launchpad.py: When updating a bug, also add new tags. Thanks Brian
      Murray!
  * debian/apport.install: Install Java crash handler in
    /usr/share/apport/apport.jar.
  * debian/control: Add Java build dependency so that the Java crash handler
    will be built.
 -- Martin Pitt <email address hidden> Fri, 31 Dec 2010 16:15:06 +0100

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Does anybody have any thoughts about whether or not this should be fixed in Lucid? Its fairly easy to work around by commenting out 'attach_alsa(report') in /usr/share/apport/package-hooks/source_linux.py if necessary.

Revision history for this message
Peter Matulis (petermatulis) wrote :

Yes, let's fix this for Lucid.

Changed in apport (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in apport (Ubuntu Lucid):
status: Triaged → Won't Fix
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.