aptd crashed with OSError in release(): [Errno 9] Bad file descriptor

Bug #742935 reported by Maurizio
662
This bug affects 111 people
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Fix Released
High
Canonical Foundations Team
Natty
Fix Released
Medium
Unassigned
Oneiric
Fix Released
High
Canonical Foundations Team

Bug Description

Binary package hint: aptdaemon

ubuntu startup and after login appera error segnalation

ProblemType: Crash
DistroRelease: Ubuntu 11.04
Package: aptdaemon 0.41+bzr604-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-7.38-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
Architecture: amd64
Date: Fri Mar 25 21:39:13 2011
ExecutablePath: /usr/sbin/aptd
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110323)
InterpreterPath: /usr/bin/python2.7
ProcCmdline: /usr/bin/python /usr/sbin/aptd
ProcEnviron:

PythonArgs: ['/usr/sbin/aptd']
SourcePackage: aptdaemon
Title: aptd crashed with OSError in release(): [Errno 9] Bad file descriptor
UpgradeStatus: Upgraded to natty on 2011-03-25 (0 days ago)
UserGroups:

Revision history for this message
Maurizio (maurizio-andrenacci-gmail) wrote :
Revision history for this message
Maurizio (maurizio-andrenacci-gmail) wrote :

i insert a pen drive on usb port

tags: removed: need-duplicate-check
visibility: private → public
tags: added: bugpattern-needed
Changed in aptdaemon (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
importance: Undecided → High
Revision history for this message
Gareth Williams (gareththered) wrote :

I was running Update-Manger unattended. When I returned to my laptop, apport showed me that aptd had crashed. Update-Manager also showed updates as complete.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Just a quick note as I'm going through the code.
It might be worth having acquire() check if self.fd is set before acquiring a new lock. It shouldn't be a problem in any case, but it seems weird to me that I can call acquire() multiple times and get a different fd everytime. I'd expect it to return self.fd if it's set.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Except aptd crashing, did you notice anything weird on your machine after you got this error message ?

If someone can reproduce this issue, it'd be interesting to attach the output of "dmesg", "df" and "mount" just after it happened.
That's to make sure that the filesystem was remounted in read-only mode (happens on error with ext3) or is full for some reason.

Revision history for this message
Gareth Williams (gareththered) wrote :

I ran Ubuntu Software Centre and installed an application. After a while, it crashed again.

Attached, as requested, are my dmesg, mount and df results. Please ignore my rather unhappy wi-fi card in dmesg!

Revision history for this message
Stéphane Graber (stgraber) wrote :

Ok, so at least we know that it's not a partition being full or falling back to read-only mode :)

Can you also attach /var/log/dpkg.log and the output of "dpkg -l " ?

This way I should be able to pretty much replicate your installation in a VM and debug from there.

Thanks

Revision history for this message
Gareth Williams (gareththered) wrote :

Stéphane,

As requested, dpkg.log and the output of dpkg -l.

Sorry I missed you on chat before - I haven't figured out how to get chat to pop up and attract my attention yet! If you need anything else, you know where I am :-)

Revision history for this message
Stéphane Graber (stgraber) wrote :

Hi again,

I see that you are a version of python-aptdaemon behind of what we have in the archive.
Can you try updating your system and see if it makes any difference ?

Current version is 0.41+bzr646-0ubuntu2 uploaded 8 hours ago and fixes at least one crasher. I'm not convinced it's the same issue you're seeing, but still worth making sure you and I run the same version :)

Thanks

Revision history for this message
Gareth Williams (gareththered) wrote :

Strange - I only updated those a few hours ago. Or should I say - I thought I updated them a few hours ago!!

Anyway, I've updated now and installed 3 packages from the Ubuntu Software Centre without any issues. I think it's too early to get excited, so I'll keep an eye on it and let you know.

Revision history for this message
Gareth Williams (gareththered) wrote :

No luck - it must have crashed when I installed the three packages 38 minutes ago. Somehow, I didn't notice the apport crash reporting window appear! In my defence, I have had many windows open and been changing between them!

Revision history for this message
Stéphane Graber (stgraber) wrote :

Can you make sure it's the same crash ("Bad file descriptor") ?
In the mean time, I'll try installing some random software for a while in my VM and see if I can get the same crash ...

Revision history for this message
Stéphane Graber (stgraber) wrote :

oh, actually, seems like I missed something in your dpkg -l output that could explain what you're seeing.

"iU cnijfilter-common:i386" showing that this multi-arch (:i386) package is unpacked but not properly installed, that could explain the crashes.

Revision history for this message
Stéphane Graber (stgraber) wrote :

can you try running "sudo apt-get -f install" from a terminal and copy/paste the output here ?
Hopefully that should fix cnijfilter-common and possibly the aptdaemon issue you're seeing.

Revision history for this message
Gareth Williams (gareththered) wrote :

I've just looked in /var/crash/ and found an atpd crash from 23:03 (BST) which (if I read it correctly) says the crash was for:-

       NameError: global name 'trans' is not defined

which probably isn't the same bug/error.

I'm looking at the cnijfilter package now. It's the driver for my Canon inkjet printer and due to Canon's views on Linux the driver has to be installed in an 'unusual' way.

Revision history for this message
Gareth Williams (gareththered) wrote :

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

Not very useful! However...

The install instructions for the Canon iP1800 printer involves downloading a script which then fetches a couple of deb files and automatically installs them. If I change to the directory where these files are stored and execute:-

sudo dpkg -i ./cnijfilter-common_2.70-2_i386.deb

I get:-

dpkg: error processing ./cnijfilter-common_2.70-2_i386.deb (--install):
 package architecture (i386) does not match system (amd64)
Errors were encountered while processing:
 ./cnijfilter-common_2.70-2_i386.deb

which is strange considering that the printer works fine!

Are we risking taking this bug report off topic here?

Revision history for this message
Stéphane Graber (stgraber) wrote :

ok, so the issue is that the print driver you have on your system has been built for i386 and not for amd64.
It's surprising that it works at all :)

As it seems to work, you may try to do: "dpkg -i cnijfilter-common_2.70-2_i386.deb --force-architecture" to install it regardless of the architecture. It's not a recommended solution though, the proper way of doing it would be to get an amd64 package.

Can you either run that dpkg command above or remove the package from your system ? Then do:
sudo apt-get update
sudo apt-get dist-upgrade

To make sure the system is up to date and doesn't have any half-installed package remaining.

Then please attach the output of "dpkg -l" again so I can make sure you don't have any other broken package on your system. If that's all clean, then it'll be interesting to see if you still get crashes in software center.

Thanks

Revision history for this message
Gareth Williams (gareththered) wrote :

I've tried the --force-architecture option, but it complains about dependencies. I've tried --force-depends too and that doesn't work neither.

The file required to print installs, but it fails to configure, whatever that entails.

Anyway, I've now uninstalled it and upgraded as you requested. I'll leave it off for a while. By the way, I was previously using 10.04 and 10.11 on 64-bit with the Canon driver installed and never received an aptd error.

I've attached the output of dpkg -l

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Gareth: You have got a different problem. What was the error message in your case? What are the details in the software center error dialog when you try to install the package?

Stephan: Thank for the hint with the new fds.

Revision history for this message
Gareth Williams (gareththered) wrote :

Sebastian,

I haven't had a crash in the last day and have installed some applications in order to stress the system (consequently, I've got a strange selection of applications at the moment!!). It seems to be behaving since I removed the printer driver and updated.

I've looked through the log in /var/crash for a previous crash and found:-

           <type 'exceptions.NameError'>: global name 'trans' is not defined

Is that what you're after? If not, I can attach the whole of the crash log for you.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted aptdaemon into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in aptdaemon (Ubuntu Natty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote :

does anyone have a reproducible test case for this aptdaemon SRU bug?

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

Please see https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/781874/comments/11 for the current status of this, this needs a new upload to natty-proposed.

Changed in aptdaemon (Ubuntu Natty):
status: Fix Committed → Triaged
tags: removed: verification-needed
tags: removed: bugpattern-needed
tags: added: bugpattern-written
tags: added: rls-mgr-o-tracking
Revision history for this message
Michael Vogt (mvo) wrote :

This is fixed in oneiric already, the fix was added in r652 and oneiric has r695.

Changed in aptdaemon (Ubuntu Oneiric):
status: New → Fix Released
Michael Vogt (mvo)
Changed in aptdaemon (Ubuntu Natty):
importance: Undecided → Medium
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Hello Maurizio, or anyone else affected,

Accepted aptdaemon into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in aptdaemon (Ubuntu Natty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptdaemon - 0.41+bzr661-0ubuntu0.1

---------------
aptdaemon (0.41+bzr661-0ubuntu0.1) natty-proposed; urgency=low

  [ Michael Vogt ]
  * new bzr bugfix snapshot from the upstream branch
  * drop debian/patches/fix_lp_781874.patch,
    drop debian/patches/01_fix_locking.patch
    drop debian/patches/03_do_not_close_invalid_fd.patch
    drop/debian/patches/04_check_if_apport_enabled.patch:
    - this is included in the upstream bzr branch now
  * debian/patches/02_fix_crash_on_dpkg_disappear.patch:
    - use empty string when dpkg notices a disappearing package,
      this avoids string break

  [ Sebastian Heinlein ]
  * fix bug when canceling a transaction (LP: #781874)
  * fix FD leak (LP: #742935)
  * fix crash when dbus exceptions have unicode messages (LP: #761386)
  * add (empty) mapping the apt progress message that is triggered
    when a empty package disappears

  [ Gabor Kelemen ]
  * Add missing files to POTFILES.in, fixes LP: #786500

  [ Brian Murray ]
  * aptdaemon/crash.py:
    - title attachments Traceback to be consistent with apport
  * aptdaemon/crash.py:
    - only create crash reports if apport is enabled
 -- Michael Vogt <email address hidden> Tue, 19 Apr 2011 08:52:09 +0200

Changed in aptdaemon (Ubuntu Natty):
status: Fix Committed → Fix Released
Revision history for this message
向盛煌 (panchox163) wrote :

正预备替换 libc6:amd64 2.15-0ubuntu18 (使用 .../libc6_2.15-0ubuntu20_amd64.deb) ...
正在反配置 libc6:i386 ...

A copy of the C library was found in an unexpected directory:
  '/lib/x86_64-linux-gnu/libc-2.15.so'
It is not safe to upgrade the C library in this situation;
please remove that copy of the C library or get it out of
'/lib/x86_64-linux-gnu' and try again.

dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu20_amd64.deb (--unpack):
 子进程 新的 pre-installation 脚本 返回了错误号 1
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    正预备替换 libc6:i386 2.15-0ubuntu18 (使用 .../libc6_2.15-0ubuntu20_i386.deb) ...
正在反配置 libc6:amd64 ...

A copy of the C library was found in an unexpected directory:
  '/lib/i386-linux-gnu/ld-2.15.so'
It is not safe to upgrade the C library in this situation;
please remove that copy of the C library or get it out of
'/lib/i386-linux-gnu' and try again.

dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu20_i386.deb (--unpack):
 子进程 新的 pre-installation 脚本 返回了错误号 1
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    在处理时有错误发生:
 /var/cache/apt/archives/libc6_2.15-0ubuntu20_amd64.deb
 /var/cache/apt/archives/libc6_2.15-0ubuntu20_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Colin Watson (cjwatson) wrote :

向盛煌, that has nothing to do with this bug or with aptdaemon. Please file it separately, I suppose on the eglibc package.

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.