[Python-bugs-list] [Bug #128713] type() on mmap object causes segfault
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 13 Jan 2001 20:11:14 -0800
Bug #128713, was updated on 2001-Jan-13 20:11
Here is a current snapshot of the bug.
Project: Python
Category: Extension Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: tokeneater
Assigned to : nobody
Summary: type() on mmap object causes segfault
Details: Apparently, mmap_object_type.ob_type wasn't initialized properly
for UNIX platforms. The patch below fixes the problem for Linux, and I
believe it should work for windows as well.
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.26
diff -c -r2.26 mmapmodule.c
*** mmapmodule.c 2001/01/10 21:03:32 2.26
--- mmapmodule.c 2001/01/14 04:03:15
***************
*** 841,849 ****
int fileno;
HANDLE fh = 0;
- /* Patch the object type */
- mmap_object_type.ob_type = &PyType_Type;
-
if (!PyArg_ParseTuple(args,
"iO|z",
&fileno,
--- 841,846 ----
***************
*** 956,961 ****
--- 953,962 ----
initmmap(void)
{
PyObject *dict, *module;
+
+ /* Patch the object type */
+ mmap_object_type.ob_type = &PyType_Type;
+
module = Py_InitModule ("mmap", mmap_functions);
dict = PyModule_GetDict (module);
mmap_module_error = PyExc_EnvironmentError;
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=128713&group_id=5470