undefined symbol: PyOS_mystricmp

Bug #594919 reported by skyang
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PylibLZMA
Invalid
High
Barry Warsaw
python-lzma (Debian)
Fix Released
Unknown
python-lzma (Ubuntu)
Fix Released
Medium
Stefano Rivera

Bug Description

python setup.py build -> success
python setup.py test -> failed
# python setup.py test
running test
running egg_info
writing pyliblzma.egg-info/PKG-INFO
writing top-level names to pyliblzma.egg-info/top_level.txt
writing dependency_links to pyliblzma.egg-info/dependency_links.txt
reading manifest file 'pyliblzma.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyliblzma.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-i686-2.6/lzma.so ->
Traceback (most recent call last):
  File "setup.py", line 81, in <module>
    test_suite = 'tests',
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/site-packages/distribute-0.6.13-py2.6.egg/setuptools/command/test.py", line 137, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib/python2.6/site-packages/distribute-0.6.13-py2.6.egg/setuptools/command/test.py", line 117, in with_project_on_sys_path
    func()
  File "/usr/lib/python2.6/site-packages/distribute-0.6.13-py2.6.egg/setuptools/command/test.py", line 146, in run_tests
    testLoader = loader_class()
  File "/usr/lib/python2.6/unittest.py", line 816, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs
    self.createTests()
  File "/usr/lib/python2.6/unittest.py", line 849, in createTests
    self.module)
  File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.6/unittest.py", line 587, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python2.6/site-packages/distribute-0.6.13-py2.6.egg/setuptools/command/test.py", line 34, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib/python2.6/unittest.py", line 584, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'test_liblzma'

how to resolve this problem?

Tags: patch python27

Related branches

Revision history for this message
Per Øyvind Karlsen (proyvind) wrote :

hmm, I'm unable to reproduce..

I'm able to run the test suite just fine here:
running test
running egg_info
writing pyliblzma.egg-info/PKG-INFO
writing top-level names to pyliblzma.egg-info/top_level.txt
writing dependency_links to pyliblzma.egg-info/dependency_links.txt
reading manifest file 'pyliblzma.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'COPYING'
writing manifest file 'pyliblzma.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-2.6/lzma.so ->
test_crc32empty (tests.test_liblzma.ChecksumTestCase) ... ok
test_crc32start (tests.test_liblzma.ChecksumTestCase) ... ok
test_crc64empty (tests.test_liblzma.ChecksumTestCase) ... ok
test_crc64start (tests.test_liblzma.ChecksumTestCase) ... ok
test_penguins32 (tests.test_liblzma.ChecksumTestCase) ... ok
test_penguins64 (tests.test_liblzma.ChecksumTestCase) ... ok
test_compress_large_stream (tests.test_liblzma.TestLZMA) ... ^Cinterrupted
[peroyvind@localhost pyliblzma]$

Revision history for this message
Matthias Klose (doko) wrote :
Changed in python-lzma (Ubuntu):
status: New → Confirmed
tags: added: python2.7
Matthias Klose (doko)
tags: added: python27
removed: python2.7
Revision history for this message
Stefano Rivera (stefanor) wrote :

Here's the issue:
PYTHONPATH=build/lib.linux-x86_64-2.7 python2.7 -c 'import lzma'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /tmp/buildd/python-lzma-0.5.3/build/lib.linux-x86_64-2.7/lzma.so: undefined symbol: PyOS_mystricmp

src/liblzma.h includes Python.h, so I assume it wants to be linked to libpython?

Here's a patch, linking the extension with libpythonXX. I assume it's the correct thing to do?

Changed in python-lzma (Ubuntu):
assignee: nobody → Stefano Rivera (stefanor)
importance: Undecided → Medium
status: Confirmed → In Progress
Revision history for this message
Stefano Rivera (stefanor) wrote :
Revision history for this message
Stefano Rivera (stefanor) wrote :

Hmm: Depends:... libpython2.6 (>= 2.6), libpython2.7 (>= 2.7),...

That seems wrong.

tags: added: patch
Revision history for this message
Barry Warsaw (barry) wrote :

I'll note that this appears to be an upstream bug, as a 'pip install pyliblzma' in a virtualenv with Python 2.7 fails exactly the same way.

summary: - test failed on PylibLZMA
+ undefined symbol: PyOS_mystricmp
Changed in pyliblzma:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
Barry Warsaw (barry)
Changed in pyliblzma:
status: Confirmed → In Progress
Revision history for this message
Barry Warsaw (barry) wrote :

Stefano: I've verified that your patch works for Python 2.7 and doesn't hurt for Python 2.6. I've submitted a branch, and will add a merge proposal to the upstream trunk with your change. I'll also put together a source package with the fix for natty.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-lzma - 0.5.3-1ubuntu1

---------------
python-lzma (0.5.3-1ubuntu1) natty; urgency=low

  [ Stefano Rivera ]
  * Fix shared library linkage when building with Python 2.7. (LP: #594919)
 -- Barry Warsaw <email address hidden> Mon, 13 Dec 2010 15:58:54 -0500

Changed in python-lzma (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Stefano Rivera (stefanor) wrote :

I'll happily upload it myself, (and btw, we should use ubuntu1, not build4, as there is a change). I just wanted confirmation that this fix was appropriate, thanks.

Changed in python-lzma (Debian):
status: Unknown → New
Changed in pyliblzma:
status: In Progress → Invalid
Changed in python-lzma (Debian):
status: New → Fix Released
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.