[Bug 221700] lang/python: subprocess does not use closefrom, calls close(2) hundreds of thousands of times

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 21 19:54:11 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221700

            Bug ID: 221700
           Summary: lang/python: subprocess does not use closefrom, calls
                    close(2) hundreds of thousands of times
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: python at FreeBSD.org
          Reporter: emaste at freebsd.org
            Blocks: 221696
          Assignee: python at FreeBSD.org
             Flags: maintainer-feedback?(python at FreeBSD.org)

% python --version
Python 2.7.13
% pkg info python | grep Version
Version        : 2.7_3,2


% ktrace -i python -c 'import subprocess; subprocess.call("/usr/bin/true",
close_fds=True);'
% kdump -s | egrep -c 'CALL.*close'
939647

excerpt from kdump:
  1958 python2.7 CALL  close(0x3)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0x5)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0x6)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0x7)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0x8)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0x9)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
...
  1958 python2.7 CALL  close(0xe5628)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0xe5629)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0xe562a)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor
  1958 python2.7 CALL  close(0xe562b)
  1958 python2.7 RET   close -1 errno 9 Bad file descriptor

This has both a performance impact and an impact on the ability to debug
problems with python programs.


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221696
[Bug 221696] sysutils/py-diffoscope: Tests run significantly slower on FreeBSD
than on other platforms
-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-python mailing list