failed to import snack

Bug #1092117 reported by Mitsuya Shibata
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
newt (Ubuntu)
High
Unassigned

Bug Description

Couldn't import snack on raring. No error on 12.10.

How to reproduce:
$ python
Python 2.7.3 (default, Dec 12 2012, 19:00:09)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import snack
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/snack.py", line 44, in <module>
    import _snack
ImportError: /usr/lib/python2.7/dist-packages/_snack.so: undefined symbol: _Py_RefTotal
>>>

Result of 12.10 is following:
$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import snack
>>>

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: python-newt 0.52.14-11ubuntu4
ProcVersionSignature: Ubuntu 3.7.0-7.15-generic 3.7.0
Uname: Linux 3.7.0-7-generic x86_64
ApportVersion: 2.7-0ubuntu2
Architecture: amd64
Date: Wed Dec 19 22:33:31 2012
InstallationDate: Installed on 2012-12-15 (3 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20121214)
MarkForUpload: True
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=ja_JP.UTF-8
 SHELL=/bin/bash
SourcePackage: newt
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :
Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

In raring:
$ readelf -s /usr/lib/python2.7/dist-packages/_snack.so | grep Py_Ref
    83: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _Py_RefTotal

$ ldd /usr/lib/python2.7/dist-packages/_snack.so
        linux-vdso.so.1 => (0x00007fffe9fa0000)
        libnewt.so.0.52 => /lib/x86_64-linux-gnu/libnewt.so.0.52 (0x00007fde55fe5000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fde55c23000)
        libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007fde55892000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fde5568e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fde5641d000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fde5538d000)

--------------

In 12.10:
$ readelf -s /usr/lib/python2.7/dist-packages/_snackmodule.so | grep Py_Ref

$ ldd /usr/lib/python2.7/dist-packages/_snackmodule.so
        linux-vdso.so.1 => (0x00007fffbabff000)
        libnewt.so.0.52 => /lib/libnewt.so.0.52 (0x00007f33c1ecf000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f33c1b10000)
        libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f33c177f000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f33c157b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f33c2308000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f33c127f000)

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

_Py_RefTotal is defined in libpython2.7.so for Python/C API.
http://docs.python.org/2/c-api/refcounting.html

However according to Objects/object.c in python2.7, it seems that
this symbol is defined debug build only.:
---
#ifdef Py_REF_DEBUG
Py_ssize_t _Py_RefTotal;
---

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

Rebuild newt, removed _Py_RefTotal symbol.
But install it, other problem occur.

---
Python 2.7.3 (default, Dec 12 2012, 19:00:09)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import snack
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/snack.py", line 310, in <module>
    for o,c in [ (ord(c),c) for c in string.ascii_letters+string.digits ]:
NameError: name 'string' is not defined
>>>
---

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

In upstream, add new code depended on string module.
Needs to modify patch for porting python3.

http://git.fedorahosted.org/cgit/newt.git/commit/snack.py?id=2a61dd02bfe7f131a96d71cb6e668c896f65bb46

Sent request to merge.

tags: added: patch
Changed in newt (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Changed in newt (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package newt - 0.52.14-11ubuntu5

---------------
newt (0.52.14-11ubuntu5) raring; urgency=low

  * Modified python3.patch (LP: #1092117).
    - New snack.py depends on string modules.
 -- Mitsuya Shibata <email address hidden> Sun, 23 Dec 2012 17:52:33 +0900

Changed in newt (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers