Debian Bug report logs - #505999
python-numpy: memory leak in exponentiation

version graph

Package: python-numpy; Maintainer for python-numpy is Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>; Source for python-numpy is src:python-numpy.

Reported by: Jiri Baum <jiri@baum.com.au>

Date: Mon, 17 Nov 2008 16:48:09 UTC

Severity: minor

Found in version python-numpy/1:1.1.0-3

Fixed in version python-numpy/1:1.3.0-1

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://scipy.org/scipy/numpy/ticket/955

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#505999; Package python-numpy. (Mon, 17 Nov 2008 16:48:13 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jiri Baum <jiri@baum.com.au>:
New Bug report received and forwarded. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 17 Nov 2008 16:48:16 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Jiri Baum <jiri@baum.com.au>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: python-numpy: memory leak in exponentiation
Date: Tue, 18 Nov 2008 03:47:27 +1100
Package: python-numpy
Version: 1:1.1.0-3
Severity: minor

Raising zero to a negative power sometimes leaks memory, depending on the
types involved. While this is easy to work around (check for zero and deal
with it separately), it shouldn't happen.

In particular, with the following combinations of types (where the base is
0 and the exponent is -3 or -3.5), one object is leaked:

float ** numpy.float64
int ** numpy.float64
int ** numpy.int32
int ** numpy.int64
numpy.float32 ** numpy.float32
numpy.float64 ** float
numpy.float64 ** int
numpy.float64 ** numpy.float32
numpy.float64 ** numpy.float64
numpy.float64 ** numpy.int32
numpy.float64 ** numpy.int64
numpy.int32 ** int
numpy.int32 ** numpy.int32
numpy.int64 ** int
numpy.int64 ** numpy.int32
numpy.int64 ** numpy.int64

(In addition, float ** numpy.int32 raises an exception; however, strictly
speaking, that would be a separate issue.)

Code to reproduce this is enclosed below.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-numpy depends on:
ii  libblas3gf [libblas.so.3gf]   1.2-2      Basic Linear Algebra Subroutines 3
ii  libc6                         2.7-15     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.2-1  GCC support library
ii  libgfortran3                  4.3.2-1    Runtime library for GNU Fortran ap
ii  liblapack3gf [liblapack.so.3g 3.1.1-1    library of linear algebra routines
ii  python                        2.5.2-3    An interactive high-level object-o
ii  python-central                0.6.8      register and build utility for Pyt

python-numpy recommends no packages.

Versions of packages python-numpy suggests:
pn  python-numpy-dbg              <none>     (no description available)
pn  python-numpy-doc              <none>     (no description available)

-- no debconf information

-- Code to reproduce the problem:

#!/usr/bin/python

import gc, numpy

def mem():
    gc.collect()
    return len(gc.get_objects())

for zt in int, float, numpy.int32, numpy.int64, numpy.float32, numpy.float64:
    z = zt(0)
    for pt in int, float, numpy.int32, numpy.int64, numpy.float32, numpy.float64:
        if zt in (int, float) and pt in (int, float):
            continue
        p = pt(-3.5)
        try:
            before = mem()
            z**p
            if mem()>before:
                print 'leak: ', type(z), '**', type(p)
            else:
                print 'OK:   ', type(z), '**', type(p)
        except:
            print 'error:', type(z), '**', type(p)




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#505999; Package python-numpy. (Mon, 17 Nov 2008 17:12:14 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Ondrej Certik" <ondrej@certik.cz>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 17 Nov 2008 17:12:14 GMT) Full text and rfc822 format available.

Message #10 received at 505999@bugs.debian.org (full text, mbox):

From: "Ondrej Certik" <ondrej@certik.cz>
To: "Jiri Baum" <jiri@baum.com.au>, 505999@bugs.debian.org
Subject: Re: Bug#505999: python-numpy: memory leak in exponentiation
Date: Mon, 17 Nov 2008 18:06:34 +0100
On Mon, Nov 17, 2008 at 5:47 PM, Jiri Baum <jiri@baum.com.au> wrote:
> Package: python-numpy
> Version: 1:1.1.0-3
> Severity: minor
>
> Raising zero to a negative power sometimes leaks memory, depending on the
> types involved. While this is easy to work around (check for zero and deal
> with it separately), it shouldn't happen.

Thanks, I reported that upstream:

http://projects.scipy.org/pipermail/numpy-discussion/2008-November/038682.html

Ondrej




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#505999; Package python-numpy. (Thu, 20 Nov 2008 06:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Van der Walt <stefan@sun.ac.za>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Thu, 20 Nov 2008 06:24:03 GMT) Full text and rfc822 format available.

Message #15 received at 505999@bugs.debian.org (full text, mbox):

From: Stefan Van der Walt <stefan@sun.ac.za>
To: 505999@bugs.debian.org
Subject: Added to NumPy bugtracker
Date: Thu, 20 Nov 2008 08:22:43 +0200
This bug has been entered as

http://scipy.org/scipy/numpy/ticket/955

in the NumPy bug tracker.





Noted your statement that Bug has been forwarded to http://scipy.org/scipy/numpy/ticket/955. Request was from "Sandro Tosi" <matrixhasu@gmail.com> to control@bugs.debian.org. (Thu, 20 Nov 2008 08:00:04 GMT) Full text and rfc822 format available.

Added tag(s) pending. Request was from akumar@users.alioth.debian.org to control@bugs.debian.org. (Sat, 25 Jul 2009 14:03:05 GMT) Full text and rfc822 format available.

Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. (Mon, 24 Aug 2009 23:09:18 GMT) Full text and rfc822 format available.

Notification sent to Jiri Baum <jiri@baum.com.au>:
Bug acknowledged by developer. (Mon, 24 Aug 2009 23:09:18 GMT) Full text and rfc822 format available.

Message #24 received at 505999-close@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: 505999-close@bugs.debian.org
Subject: Bug#505999: fixed in python-numpy 1:1.3.0-1
Date: Mon, 24 Aug 2009 22:41:04 +0000
Source: python-numpy
Source-Version: 1:1.3.0-1

We believe that the bug you reported is fixed in the latest version of
python-numpy, which is due to be installed in the Debian FTP archive:

python-numpy-dbg_1.3.0-1_i386.deb
  to pool/main/p/python-numpy/python-numpy-dbg_1.3.0-1_i386.deb
python-numpy-doc_1.3.0-1_all.deb
  to pool/main/p/python-numpy/python-numpy-doc_1.3.0-1_all.deb
python-numpy-ext_1.3.0-1_all.deb
  to pool/main/p/python-numpy/python-numpy-ext_1.3.0-1_all.deb
python-numpy_1.3.0-1.diff.gz
  to pool/main/p/python-numpy/python-numpy_1.3.0-1.diff.gz
python-numpy_1.3.0-1.dsc
  to pool/main/p/python-numpy/python-numpy_1.3.0-1.dsc
python-numpy_1.3.0-1_i386.deb
  to pool/main/p/python-numpy/python-numpy_1.3.0-1_i386.deb
python-numpy_1.3.0.orig.tar.gz
  to pool/main/p/python-numpy/python-numpy_1.3.0.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 505999@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated python-numpy package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 24 Aug 2009 22:38:50 +0200
Source: python-numpy
Binary: python-numpy python-numpy-dbg python-numpy-ext python-numpy-doc
Architecture: source all i386
Version: 1:1.3.0-1
Distribution: unstable
Urgency: low
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 python-numpy - Numerical Python adds a fast array facility to the Python languag
 python-numpy-dbg - Fast array facility to the Python language (debug extension)
 python-numpy-doc - NumPy documentation
 python-numpy-ext - NumPy adds a fast array facility to the Python language
Closes: 505999 519580
Changes: 
 python-numpy (1:1.3.0-1) unstable; urgency=low
 .
   [ Kumar Appaiah ]
   * New upstream release.
     + Fix memory leak in exponentiation. (Closes: #505999)
   * debian/rules:
     + Use quilt instead of simple-patchsys.
     + Add sed magic to fix the f2py2.4 and f2py2.5
       to use the right interpreters.
     + debian/patches:
       - 01_fix_man_hyphens.patch: Removed; merged upstream.
       - 03_force_f2py_version.patch: Add to force generation
         f2py postfixed with interpreter version.
       - 04_fix_utils_deprecated.patch: Fix incorrect comma
         in utils.py. Patch from Yaroslav Halchenko (Closes: #519580)
   * debian/control:
     + Standards version is now 3.8.2 (no changes needed).
     + Remove myself from uploaders.
 .
   [ Matthias Klose ]
   * Add debian/README.source.
   * Bump standards version to 3.8.3.
   * Fix section of the -dbg package.
Checksums-Sha1: 
 6c03b0063af5d4b14b2f2b638b0610f8dbf25bf7 1735 python-numpy_1.3.0-1.dsc
 c04998a1fbf7d990c9a2b99a7b62486012c570ac 1995868 python-numpy_1.3.0.orig.tar.gz
 2be19bb007485e56fa8872525342d44b8ba61951 9395 python-numpy_1.3.0-1.diff.gz
 fd6fdb1ffc3f46cabf85e846d57b2aba2a9f37be 7402 python-numpy-ext_1.3.0-1_all.deb
 374588db131f9ad613f61493c277e4309bc73a6f 41390 python-numpy-doc_1.3.0-1_all.deb
 30ac0bc24a3a5a7192f5ec842e14ba8788653566 1685576 python-numpy_1.3.0-1_i386.deb
 7de9875f385101c952937e950a059604eb641c63 4270372 python-numpy-dbg_1.3.0-1_i386.deb
Checksums-Sha256: 
 de5e449daf7c27290d884589da854d8c7df5a5d47bff74e11172472787dd1f4b 1735 python-numpy_1.3.0-1.dsc
 7524687cce85aa78103046db5e617c626b0ef871a203a049159f88f35647c90d 1995868 python-numpy_1.3.0.orig.tar.gz
 7ce6f3e2d10378869cdcaeb9e87ce41a84225aded74cb4f2daa804672eb50744 9395 python-numpy_1.3.0-1.diff.gz
 30d2db432f9a368eb134d35a36711cfbbb2fef5e8bfce3ab8475b5cd952de885 7402 python-numpy-ext_1.3.0-1_all.deb
 9f973e06cfeaf29ba94d1efd612bcff3934baa628c975d7bcf136b4b62c5734b 41390 python-numpy-doc_1.3.0-1_all.deb
 2bdf4fa8f5bf152285088499de14588130350748a4079a965b50b21cd90a6aeb 1685576 python-numpy_1.3.0-1_i386.deb
 1061199110601333db5e348217d4ba314bc5af3b8becfa16d1f4dd45dad4a138 4270372 python-numpy-dbg_1.3.0-1_i386.deb
Files: 
 50e6d6ffccb5439fb7c282100f1f1e1c 1735 python optional python-numpy_1.3.0-1.dsc
 3f7773ff0971a5ebb8591536d8ec7bd6 1995868 python optional python-numpy_1.3.0.orig.tar.gz
 5b469e037148d7eb4a803952d99f2b3b 9395 python optional python-numpy_1.3.0-1.diff.gz
 b7e19705e6de44a607955b0344f918cc 7402 python optional python-numpy-ext_1.3.0-1_all.deb
 ad55debae77e19271ab45e9ba89de7cd 41390 doc optional python-numpy-doc_1.3.0-1_all.deb
 1affe06d508dc535c1f24290877fb65d 1685576 python optional python-numpy_1.3.0-1_i386.deb
 497dddf003f2ce313e94dc5134953d84 4270372 debug extra python-numpy-dbg_1.3.0-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqS/JMACgkQStlRaw+TLJxdGACgjqXfURegNq4HDZUq+/dp0xyx
fHkAoJX8Wk56xn2J7uTGTu/rXGW32EKN
=DrRp
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 24 Sep 2009 07:52:09 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 03:01:29 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.