[Numpy-discussion] [Numeric] "put" into object array corrupts memory

Sasha ndarray at mac.com
Sun Apr 30 10:12:06 CDT 2006


I know that Numeric is no longer maintained, but since this bug cost
me two sleepless nights, I think it is appropriate to announce the bug
and the fix to the list.

---------- Forwarded message ----------
From: SourceForge.net <noreply at sourceforge.net>
Date: Apr 30, 2006 12:58 PM
Subject: [ numpy-Bugs-1479376 ] [Numeric] "put" into object array
corrupts memory
To: noreply at sourceforge.net


Bugs item #1479376, was opened at 2006-04-30 12:46
Message generated for change (Comment added) made by belopolsky
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=101369&aid=1479376&group_id=1369

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Fatal Error
Group: Normal bug
Status: Open
Priority: 5
Submitted By: Alexander Belopolsky (belopolsky)
Assigned to: Nobody/Anonymous (nobody)
Summary: [Numeric] "put" into object array corrupts memory

Initial Comment:
This is one of those bugs that are easier to fix than to reproduce:

$ cat test-put.py
class A(object):
    def __del__(self): print "deleting %r" % self
a = A()
from Numeric import *
x = array([None], 'O')
y = array([a], 'O')
put(x,[0],y)
del a,y
print "exiting"

$ python test-put.py
deleting <__main__.A object at 0xf7e4d24c>
exiting
Fatal Python error: deletion of interned string failed
Aborted (core dumped)


Numeric version: 24.2

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

>Comment By: Alexander Belopolsky (belopolsky)
Date: 2006-04-30 12:58

Message:
Logged In: YES
user_id=835142

Attached patch fixes the bug.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=101369&aid=1479376&group_id=1369




More information about the Numpy-discussion mailing list