Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 23, 2009, 2:07 PM

Post #1 of 3 (226 views)
Permalink
[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

New submission from Pauli Virtanen <pav [at] iki>:

In Objects/memoryobject.c:PyMemoryView_FromObject there's a
_PyObject_GC_UNTRACK unpaired with corresponding _PyObject_GC_TRACK,
which seems to cause a segmentation fault. This can be triggered by
calling PyMemoryView_FromObject on an object whose bf_getbuffer returns
an error.

PyMemoryView_FromObject(PyObject *base) {
...
if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) {
Py_DECREF(mview);
return NULL;
}
...
_PyObject_GC_TRACK(mview);
}
...
static void memory_dealloc(PyMemoryViewObject *self) {
_PyObject_GC_UNTRACK(self);
....
}

----------
components: Interpreter Core
messages: 95660
nosy: pv
severity: normal
status: open
title: MemoryView_FromObject crashes if PyBuffer_GetBuffer fails
versions: Python 3.1

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 3, 2009, 2:51 PM

Post #2 of 3 (154 views)
Permalink
[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails [In reply to]

Changes by Pauli Virtanen <pav [at] iki>:


----------
type: -> crash

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 4, 2009, 5:31 AM

Post #3 of 3 (148 views)
Permalink
[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Nice catch. I wonder whether there's a simple way of cooking up an unit
test for this (short of creating a new extension type).

----------
assignee: -> pitrou
nosy: +pitrou
priority: -> high
stage: -> needs patch
versions: +Python 2.7, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.