[Bug 1856753] Re: python 2.7.17-1~18.04 causes ImportError in ujson.so

Dimitri John Ledkov launchpad at surgut.co.uk
Thu Dec 19 18:35:44 UTC 2019


Buffer_ is not a symbol name prefix used by python.

readelf -a ./libpython2.7/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 | grep PyBuffer_      
0000004e2b08  037400000006 R_X86_64_GLOB_DAT 0000000000540a40 PyBuffer_Type + 0
   408: 0000000000175c90   381 FUNC    GLOBAL DEFAULT   12 PyBuffer_FromReadWriteObj
   416: 0000000000175c10   122 FUNC    GLOBAL DEFAULT   12 PyBuffer_FromMemory
   816: 0000000000175960   381 FUNC    GLOBAL DEFAULT   12 PyBuffer_FromObject
   884: 0000000000540a40   392 OBJECT  GLOBAL DEFAULT   23 PyBuffer_Type
   889: 0000000000052260   135 FUNC    GLOBAL DEFAULT   12 PyBuffer_GetPointer
  1024: 0000000000052170    82 FUNC    GLOBAL DEFAULT   12 PyBuffer_Release
  1084: 00000000001758c0   154 FUNC    GLOBAL DEFAULT   12 PyBuffer_New
  1334: 000000000005ad00   297 FUNC    GLOBAL DEFAULT   12 PyBuffer_FromContiguous
  1345: 0000000000175b90   122 FUNC    GLOBAL DEFAULT   12 PyBuffer_FromReadWriteMem
  1382: 00000000000522f0   678 FUNC    GLOBAL DEFAULT   12 PyBuffer_IsContiguous
  1412: 000000000005ae30   297 FUNC    GLOBAL DEFAULT   12 PyBuffer_ToContiguous
  1472: 00000000000521d0   132 FUNC    GLOBAL DEFAULT   12 PyBuffer_FillContiguousSt
  1520: 0000000000053640   182 FUNC    GLOBAL DEFAULT   12 PyBuffer_FillInfo

If it was PyBuffer_ then maybe it would have come from python itself.

ujson appears to be compiled extension, did you missbuilt it?

And it itself defines this

FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnchecked (char *outputOffset, unsigned short value)
{
  *(outputOffset++) = g_hexChars[(value & 0xf000) >> 12];
  *(outputOffset++) = g_hexChars[(value & 0x0f00) >> 8];
  *(outputOffset++) = g_hexChars[(value & 0x00f0) >> 4];
  *(outputOffset++) = g_hexChars[(value & 0x000f) >> 0];
}

Which is possibly now inlined, instead of being an exported symbol?
Compiler can choose to do that.

BTW. python-ujson is available on ubuntu bionic
$ sudo apt install python-ujson
$ python2 -c 'import ujson; print ujson'
<module 'ujson' from '/usr/lib/python2.7/dist-packages/ujson.x86_64-linux-gnu.so'>

I am afraid this is a bug with pip's ujson, not with ubuntu's python2.

The one that we provide is the same version 1.35. Maybe you can remove
your self-built / pip install ujson and install our distro provided one
instead with sudo apt install python-ujson?

** Changed in: python2.7 (Ubuntu)
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python2.7 in Ubuntu.
https://bugs.launchpad.net/bugs/1856753

Title:
  python 2.7.17-1~18.04 causes ImportError in ujson.so

Status in python2.7 package in Ubuntu:
  Invalid

Bug description:
  With python 2.7.17, ujson==1.35 does not install from PyPI properly.
  This was not a problem with 2.7.15-4ubuntu4~18.04.2.

  The root cause is likely during the `bdist_wheel` operation, as a whl
  built with python 2.7.15 will install and function under 2.7.17.

  Steps to reproduce are as follows; I have been reproducing this in the
  ubuntu/bionic Docker container:

   apt-get update && apt-get -y install python-pip python2.7-dev
   pip install ujson
   python -c "import ujson"

  The resulting error is:

   ImportError: /usr/local/lib/python2.7/dist-packages/ujson.so:
  undefined symbol: Buffer_AppendShortHexUnchecked

  A diff of dpkg-query -W between working and failing containers
  follows. (this is from the full environment, not the MCVE above --
  therefore unrelated packages are shown in the diff).

  --- packages.ok	2019-12-17 13:31:58.782715627 -0600
  +++ packages.fail	2019-12-17 13:28:36.060153358 -0600
  @@ -34,8 +34,8 @@
   gcc-7-base:amd64	7.4.0-1ubuntu1~18.04.1
   gcc-8-base:amd64	8.3.0-6ubuntu1~18.04.1
   gir1.2-glib-2.0:amd64	1.56.1-1
  -git	1:2.17.1-1ubuntu0.4
  -git-man	1:2.17.1-1ubuntu0.4
  +git	1:2.17.1-1ubuntu0.5
  +git-man	1:2.17.1-1ubuntu0.5
   gnupg	2.2.4-1ubuntu1.2
   gnupg-l10n	2.2.4-1ubuntu1.2
   gnupg-utils	2.2.4-1ubuntu1.2
  @@ -150,10 +150,10 @@
   libpython-all-dev:amd64	2.7.15~rc1-1
   libpython-dev:amd64	2.7.15~rc1-1
   libpython-stdlib:amd64	2.7.15~rc1-1
  -libpython2.7:amd64	2.7.15-4ubuntu4~18.04.2
  -libpython2.7-dev:amd64	2.7.15-4ubuntu4~18.04.2
  -libpython2.7-minimal:amd64	2.7.15-4ubuntu4~18.04.2
  -libpython2.7-stdlib:amd64	2.7.15-4ubuntu4~18.04.2
  +libpython2.7:amd64	2.7.17-1~18.04
  +libpython2.7-dev:amd64	2.7.17-1~18.04
  +libpython2.7-minimal:amd64	2.7.17-1~18.04
  +libpython2.7-stdlib:amd64	2.7.17-1~18.04
   libpython3-dev:amd64	3.6.7-1~18.04
   libpython3-stdlib:amd64	3.6.7-1~18.04
   libpython3.6:amd64	3.6.9-1~18.04
  @@ -249,9 +249,9 @@
   python-six	1.11.0-2
   python-wheel	0.30.0-0.2
   python-xdg	0.25-4ubuntu1
  -python2.7	2.7.15-4ubuntu4~18.04.2
  -python2.7-dev	2.7.15-4ubuntu4~18.04.2
  -python2.7-minimal	2.7.15-4ubuntu4~18.04.2
  +python2.7	2.7.17-1~18.04
  +python2.7-dev	2.7.17-1~18.04
  +python2.7-minimal	2.7.17-1~18.04
   python3	3.6.7-1~18.04
   python3-asn1crypto	0.24.0-1
   python3-cffi-backend	1.11.5-1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1856753/+subscriptions



More information about the foundations-bugs mailing list