[Numpy-tickets] [NumPy] #378: NumPy or Python crashing with segfault

NumPy numpy-tickets at scipy.net
Wed Nov 15 05:22:07 CST 2006

#378: NumPy or Python crashing with segfault
 Reporter:  tecki               |        Owner:  somebody
     Type:  defect              |       Status:  reopened
 Priority:  normal              |    Milestone:          
Component:  numpy.core          |      Version:          
 Severity:  normal              |   Resolution:          
 Keywords:  segfault vectorize  |  
Comment (by tecki):

 Well, I am ''not'' just getting rid of a DECREF. Instead I am changing a
 a CLEAR. This CLEAR does exactly the same DECREF, only that it sets the
 to NULL afterwards. This prevents a second unwanted DECREF in the next
 loop, as described above. One could argue that we could just let the
 DECREF be done in the
 next pass of the loop: but that would be insane, since the last time we go
 the loop, the buffer will ''not'' be reused afterwards, we would have to
 clean it
 in a step later.

 I actually did a very careful tracking of references, saw that the
 of objects like int(158) (the 158 is an arbitrary example) go down to 0
 and even
 negative (that should ''really'' not happen). With my patch the refcounts
 go exactly
 to the right values. I'll write something that illustrates that.

Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/378#comment:11>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list