• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tahoe-lafs / tahoe-lafs / 18
95%

Build:
DEFAULT BRANCH: master
Ran 12 Sep 2014 08:31PM UTC
Jobs 2
Files 195
Run time 7min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
18

Pull #109

travis-ci

warner
Avoid Popen() of executables that don't exist

The stdlib 'subprocess' module in python-2.7.4 through 2.7.7 suffers
from http://bugs.python.org/issue18851 which causes unrelated file
descriptors to be closed when `subprocess.call()` fails the `exec()`,
such as when the executable being invoked does not actually exist. There
appears to be some randomness involved. This was fixed in python-2.7.8.

Tahoe's iputil.py uses subprocess.call on many different "ifconfig"-type
executables, most of which don't exist on any given platform (added in
git commit 8e31d66cd0b). This results in a lot of file-descriptor
closing, which (at least during unit tests) tends to clobber important
things like Tub TCP sockets. This seems to be the root cause behind
ticket:2121, in which normal code tries to close already-closed sockets,
crashing the unit tests. Since different platforms have different
ifconfigs, some platforms will experience more failed execs than others,
so this bug could easily behave differently on linux vs freebsd, as well
as working normally on python-2.7.8 or 2.7.4.

This patch inserts a guard to make sure that os.path.isfile() is true
before allowing Popen.call() to try executing the target. This ought to
be enough to avoid the bug. It changes both iputil.py and
allmydata.__init__ (which uses Popen for calling "lsb_release"), which
are all the places where 'subprocess' is used outside of unit tests.

Other potential fixes: use the 'subprocess32' module from PyPI (which is
a bug-free backport of the Python3 stdlib subprocess module, but would
introduce a new dependency), or require python >= 2.7.8 (but this would
rule out development/deployment on the current OS-X 10.9 release, which
ships with 2.7.5, as well as other distributions like Ubuntu 14.04 LTS).

I believe this closes ticket:2121, and given the apparent relationship
between 2121 and 2023, I think it also closes ticket:2023 (although
since 2023 doesn't have copies of the failing log files, it's h... (continued)
Pull Request #109: Avoid Popen() of executables that don't exist

21 of 21 new or added lines in 3 files covered. (100.0%)

49353 of 53495 relevant lines covered (92.26%)

1.84 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
src/allmydata/util/iputil.py
18
100.0
src/allmydata/__init__.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
src/allmydata/immutable/checker.py
3
100.0
src/allmydata/mutable/servermap.py
Jobs
ID Job ID Ran Files Coverage
1 18.1 12 Sep 2014 08:31PM UTC 0
92.25
Travis Job 18.1
2 18.2 12 Sep 2014 08:38PM UTC 0
92.24
Travis Job 18.2
Source Files on build 18
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #18
  • Pull Request #109
  • PR Base - master (#17)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc