[Bug 1362920] Re: OSError: [Errno 9] Bad file descriptor

Launchpad Bug Tracker 1362920 at bugs.launchpad.net
Fri Sep 12 19:34:40 UTC 2014


This bug was fixed in the package ubiquity - 2.19.8

---------------
ubiquity (2.19.8) utopic; urgency=medium

  [ Colin Watson ]
  * Avoid closing /dev/urandom persistent FD on oem-config startup (thanks,
    Jamin W. Collins; LP: #1362920).

  [ Chris Bainbridge ]
  * Fix Windows UEFI detection. (LP: #1265192)
 -- Stephane Graber <stgraber at ubuntu.com>   Fri, 12 Sep 2014 14:35:57 -0400

** Changed in: ubiquity (Ubuntu)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubiquity in Ubuntu.
https://bugs.launchpad.net/bugs/1362920

Title:
  OSError: [Errno 9] Bad file descriptor

Status in “ubiquity” package in Ubuntu:
  Fix Released

Bug description:
  After working around https://bugs.launchpad.net/ubuntu/+source/oem-
  config/+bug/1361595, oem-config still does not properly run on server
  based installs.

  Code that had previously worked under python 2.x (used in 12.04 LTS,
  AFAICT) is now too aggressive under python 3.x (used in 14.04 LTS).
  This is resulting the the file descriptor for /dev/urandom being
  closed prematurely in open_terminal(), due to the following section:

          for i in range(tty):
              if i != 2:
                  os.close(i)

  However, as reported here: http://bugs.python.org/issue21207, once the
  urandom persistent fd is closed it wasn't being reopend.  Given this
  report is from April of 2014, I'm pretty sure the version of python
  shipped with 14.04 LTS has the same behavior.

  Sure enough, if I prevent oem-config from closing the fd for
  /dev/urandom, oem-config is finally able to at least run.

  The following is how I've solved the problem so far.

          # need to avoid closing the FD for /dev/urandom
          # http://bugs.python.org/issue21207
          urand_inode = os.stat('/dev/urandom').st_ino
          for i in range(tty):
              if i != 2:
                  inode = os.fstat(i).st_ino
                  if inode != urand_inode:
                      os.close(i)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1362920/+subscriptions



More information about the foundations-bugs mailing list