Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_versioned_symbol breaks when looking at symbols it doesn't need to #41

Closed
ehashman opened this issue Jun 3, 2016 · 0 comments · Fixed by #43

Comments

@ehashman
Copy link
Member

@ehashman ehashman commented Jun 3, 2016

After building some python-kadmin wheels on the manylinux docker image, I encountered an exception when running auditwheel on the wheels:

$ auditwheel -vv repair wheelhouse/python_kadmin-0.1.1-cp26-cp26m-linux_x86_64.whl -w /io/wheelhouse
...<snip>
Traceback (most recent call last):
  File "/usr/local/bin/auditwheel", line 11, in <module>
    sys.exit(main())
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/auditwheel/main.py", line 49, in main
    rval = args.func(args, p)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/auditwheel/main_repair.py", line 60, in execute
    wheel_abi = analyze_wheel_abi(args.WHEEL_FILE)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/auditwheel/wheel_abi.py", line 59, in analyze_wheel_abi
    get_wheel_elfdata(wheel_fn)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/auditwheel/wheel_abi.py", line 48, in get_wheel_elfdata
    max_versioned_symbol(versioned_symbols), uses_ucs2_symbols)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/auditwheel/policy/versioned_symbols.py", line 22, in max_versioned_symbol
    set_if_greater(max_required_ver, name, Version(ver))
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/pip/_vendor/distlib/version.py", line 32, in __init__
    self._parts = parts = self.parse(s)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/pip/_vendor/distlib/version.py", line 273, in parse
    result = _normalized_key(s)
  File "/opt/_internal/cpython-3.5.1/lib/python3.5/site-packages/pip/_vendor/distlib/version.py", line 194, in _pep_440_key
    raise UnsupportedVersionError('Not a valid version: %s' % s)

pip._vendor.distlib.version.UnsupportedVersionError: Not a valid version: MIT

(full Travis log)

Taking a look at the version symbols inside krb5, we find:

$ readelf -V ./lib/krb5/libkrb5.so
...<snip>
Version definition section '.gnu.version_d' contains 3 entries:
  Addr: 0x000000000000bcc0  Offset: 0x00bcc0  Link: 4 (.dynstr)  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: libkrb5.so.3
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: krb5_3_MIT
  0x0038: Rev: 1  Flags: none  Index: 3  Cnt: 1  Name: HIDDEN

Version needs section '.gnu.version_r' contains 5 entries:
 Addr: 0x000000000000bd18  Offset: 0x00bd18  Link: 4 (.dynstr)
  000000: Version: 1  File: libcom_err.so.3  Cnt: 1
  0x0010:   Name: com_err_3_MIT  Flags: none  Version: 10
  0x0020: Version: 1  File: libresolv.so.2  Cnt: 2
  0x0030:   Name: GLIBC_2.2.5  Flags: none  Version: 13
  0x0040:   Name: GLIBC_2.9  Flags: none  Version: 9
  0x0050: Version: 1  File: libk5crypto.so.3  Cnt: 1
  0x0060:   Name: k5crypto_3_MIT  Flags: none  Version: 7
  0x0070: Version: 1  File: libkrb5support.so.0  Cnt: 1
  0x0080:   Name: krb5support_0_MIT  Flags: none  Version: 6
  0x0090: Version: 1  File: libc.so.6  Cnt: 7
  0x00a0:   Name: GLIBC_2.14  Flags: none  Version: 15
  0x00b0:   Name: GLIBC_2.8  Flags: none  Version: 14
  0x00c0:   Name: GLIBC_2.16  Flags: none  Version: 12
  0x00d0:   Name: GLIBC_2.4  Flags: none  Version: 11
  0x00e0:   Name: GLIBC_2.3.4  Flags: none  Version: 8
  0x00f0:   Name: GLIBC_2.2.5  Flags: none  Version: 5
  0x0100:   Name: GLIBC_2.3  Flags: none  Version: 4

So I believe the issue here is that we are attempting to determine the max symbol version on all included version symbols, even though we only care about the ones in policy.json (GLIBC, CXXABI, etc.). While there are conventions for the numeric versioning for the GLIBC etc. symbols, this is not generally true, which is why we're running into the issue with e.g. k5crypto_3_MIT having a version read as MIT. A fix would be to filter out any symbols we don't care about per policy before running max_versioned_symbol on them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.