This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: type() on mmap object causes segfault
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: moshez, tim.peters, tokeneater
Priority: normal Keywords:

Created on 2001-01-14 04:11 by tokeneater, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (3)
msg2915 - (view) Author: Jeffery D. Collins (tokeneater) Date: 2001-01-14 04:11
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;
msg2916 - (view) Author: Moshe Zadka (moshez) (Python triager) Date: 2001-01-14 08:06
Assigning to tim, because I recall seeing a checkin 
message from him saying he fixed it.
msg2917 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-01-14 10:51
Thanks, Moshe.  I swear I closed this already, adding a note giving the new revision numbers for mmapmodule.c, test_mmap, output/test_mmap, and mentioned I'd also checked in a new ACKS.  But, indeed, there's no record of that here!  So closing it now (again, from my POV).
History
Date User Action Args
2022-04-10 16:03:37adminsetgithub: 33712
2001-01-14 04:11:14tokeneatercreate