Package: libpython3.4-dev
Version: 3.4.2-1
Severity: normal

Dear Maintainer,

My answers to the template questions:

   * What led up to the situation?

   I'm trying to embed Python into our product written in C and C++.
   Our build bot rejects the example from python.org because of
   memory leaks. You can find the example in section 1.1 here:
   https://docs.python.org/3.4/extending/embedding.html

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

   I compiled a file called "py_mem_leak.c" as per shell script below.

   * What was the outcome of this action?

   When you run the resulting application called "py_mem_leak", the leak
   sanitizer reports a bunch of memory leaks in libpython3.4m.so.1.0

   * What outcome did you expect instead?

   I expected the program to exit without any issues.


-- Shell script to re-create py_mem_leak.c and py_mem_leak:

#/usr/bin/env bash

set -e
set -u

cat > py_mem_leak.c <<EOT
#include <Python.h>

int main() {
  Py_SetProgramName(L"test");
  Py_Initialize();
  Py_Finalize();
  return 0;
}
EOT

/usr/bin/clang-3.6 --version

/usr/bin/clang-3.6 \
  -Werror \
  -Wall \
  -Wextra \
  -pipe \
  -ggdb3 \
  -pthread \
  -U_FORTIFY_SOURCE \
  -D_FORTIFY_SOURCE=1 \
  -fstack-protector \
  -fPIE \
  -fcolor-diagnostics \
  -fno-omit-frame-pointer \
  '-fsanitize=address' \
  -g \
  -DNDEBUG \
  -ffunction-sections \
  -fdata-sections \
  -O3 \
  -std=gnu99 \
  -no-canonical-prefixes \
  -Wno-builtin-macro-redefined \
  -isystem /usr/include/python3.4m \
  '-D__DATE__="redacted"' \
  '-D__TIMESTAMP__="redacted"' \
  '-D__TIME__="redacted"' \
  -MD -MF py_mem_leak.d \
  -fPIC \
  -c \
  -o py_mem_leak.pic.o \
  py_mem_leak.c

/usr/bin/clang-3.6 \
  -o py_mem_leak \
  -pthread \
  -pipe \
  -pie \
  -Wl,-z,relro,-z,now \
  -no-canonical-prefixes \
  '-Wl,--build-id=md5' \
  '-Wl,--hash-style=gnu' \
  -Wl,--warn-execstack \
  -Wl,--detect-odr-violations \
  '-fsanitize=address' \
  '-fuse-ld=gold' \
  -Wl,--gc-sections \
  py_mem_leak.pic.o \
  /usr/lib/x86_64-linux-gnu/libpython3.4m.so \
  -lrt -lpthread -lm -lstdc++


-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 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 libpython3.4-dev depends on:
ii  libexpat1-dev        2.1.0-6+deb8u1
ii  libpython3.4         3.4.2-1
ii  libpython3.4-stdlib  3.4.2-1
ii  multiarch-support    2.19-18+deb8u1

Versions of packages libpython3.4-dev recommends:
ii  libc6-dev [libc-dev]  2.19-18+deb8u1

libpython3.4-dev suggests no packages.

-- no debconf information

Reply via email to