Package: libpython2.7
Version: 2.7.9-2
Severity: normal

Dear Maintainer,

Linking applications with the Python runtime on ARM-based (both v7 and v8)
systems sometimes results in the following fatal error at application
startup:

$ ./test0
Fatal Python error: exceptions bootstrapping error.
Aborted

See below for the test cases that reproduces the problem. The expected
behavior is that the test cases returns without printing anything on the
console.

The problem seems to be caused by a Debian-specific patch, link-opt.diff,
that enables the -Bsymbolic-functions linker optimizations. There are
plenty of cases where the runtime needs to compare function pointers, for
example compatible_for_assignment() in typeobject.c. When the offending
linker optimization is enabled, the same function has two different
pointers depending on where the pointer address was resolved. In some
cases, the pointer will point directly to the function's entry point. In
some other cases, it points to a linker table entry. This causes checks
that test for function pointer equivalence, like the ones in typeobject.c,
to fail.

Note: This could be affected/triggered by the following two binutils issues
that affect the behavior of said linker optimization several platforms
(including ARM):

https://sourceware.org/ml/binutils/2015-01/msg00246.html
https://sourceware.org/ml/binutils/2015-07/msg00282.html


** BEGIN test0.c **
/*  gcc -o test0 `python-config --libs --cflags` test0.c */
#include <Python.h>

void (*foo)(void *) = &PyObject_Free;

int
main(int argc, char *argv[])
{
  Py_Initialize();
  Py_Finalize();
  return 0;
}
** END test0.c **

-- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: arm64 (aarch64)

Kernel: Linux 3.18.1 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libpython2.7 depends on:
ii  libc6                2.19-18+deb8u1
ii  libpython2.7-stdlib  2.7.9-2
ii  multiarch-support    2.19-18+deb8u1
ii  zlib1g               1:1.2.8.dfsg-2+b1

libpython2.7 recommends no packages.

libpython2.7 suggests no packages.

-- no debconf information

Reply via email to