File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: ob_refcnt of '*keyo' is 1 too high
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() succeeds
PyIntObject allocated at:     keyo = PyInt_FromLong(shmid);
ob_refcnt is now refs: 1 + N where N >= 0
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering range: -0x80000000 <= value <= -1
taking True path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
when PyDict_GetItem() succeeds
1087 	Py_INCREF(o);
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
1107 	Py_DECREF(o);
1108 	PyErr_SetString(PyShm_Error,
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }
ob_refcnt of '*keyo' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 12 similar trace(s) to this

File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: dereferencing NULL (MEM[(struct PyObject *)o].ob_refcnt) at src/extensions/shmmodule.c:1087
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() succeeds
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering range: -0x80000000 <= value <= -1
taking True path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
when PyDict_GetItem does not find item
1087 	Py_INCREF(o);
dereferencing NULL (MEM[(struct PyObject *)o].ob_refcnt) at src/extensions/shmmodule.c:1087
found 1 similar trace(s) to this
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
1107 	Py_DECREF(o);
1108 	PyErr_SetString(PyShm_Error,
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }

File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: ob_refcnt of return value is 1 too low
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() succeeds
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering value == (int)0 from src/extensions/shmmodule.c:1085
taking False path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
1087 	Py_INCREF(o);
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
when PyObject_Init() succeeds
taking False path
new ref from (unknown) PyObject_Init allocated at: 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
ob_refcnt is now refs: 1 + N where N >= 0
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
when PyDict_SetItem() succeeds
taking False path
ob_refcnt is now refs: 1 + N where N >= 1
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
taking True path
ob_refcnt is now refs: 0 + N where N >= 1
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
1107 	Py_DECREF(o);
1108 	PyErr_SetString(PyShm_Error,
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }
ob_refcnt of return value is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: return value
but final ob_refcnt is N + 0
found 1 similar trace(s) to this

File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: ob_refcnt of '*o' is 1 too low
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() succeeds
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering value == (int)0 from src/extensions/shmmodule.c:1085
taking False path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
1087 	Py_INCREF(o);
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
when PyObject_Init() succeeds
taking False path
new ref from (unknown) PyObject_Init allocated at: 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
ob_refcnt is now refs: 1 + N where N >= 0
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
when PyDict_SetItem() succeeds
taking False path
ob_refcnt is now refs: 1 + N where N >= 1
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
taking True path
ob_refcnt is now refs: 0 + N where N >= 1
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
when considering value == (int)-1 from src/extensions/shmmodule.c:1106
taking True path
1107 	Py_DECREF(o);
when taking True path
ob_refcnt is now refs: -1 + N where N >= 1
1108 	PyErr_SetString(PyShm_Error,
calling PyErr_SetString()
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }
ob_refcnt of '*o' is 1 too low
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + -1

File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: calling PyDict_GetItem with NULL as argument 2 (keyo) at src/extensions/shmmodule.c:1086
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() fails
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering range: -0x80000000 <= value <= -1
taking True path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
calling PyDict_GetItem with NULL as argument 2 (keyo) at src/extensions/shmmodule.c:1086
PyDict_GetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
1087 	Py_INCREF(o);
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
1107 	Py_DECREF(o);
1108 	PyErr_SetString(PyShm_Error,
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }

File: src/extensions/shmmodule.c
Function: PyShm_memory
Error: calling PyDict_SetItem with NULL as argument 2 (keyo) at src/extensions/shmmodule.c:1097
1072 static PyObject *
1073 PyShm_memory(
1074     PyObject *self,
1075     PyObject *args)
1076 {
1077     int shmid;
1078     PyShmObj *o;
1079     PyObject *keyo;
1080 
1081     if (!PyArg_ParseTuple(args, "i", &shmid))
when PyArg_ParseTuple() succeeds
taking False path
1082 	return NULL;
1083     keyo = PyInt_FromLong(shmid);
when PyInt_FromLong() fails
1084     /* get the object from the dictionary */
1085     if (PyMapping_HasKey(shm_dict, keyo)) {
when considering value == (int)0 from src/extensions/shmmodule.c:1085
taking False path
1086 	o = (PyShmObj *)PyDict_GetItem(shm_dict, keyo);
1087 	Py_INCREF(o);
1088     }
1089     else {
1090 	/* not found, create it */
1091 	if ((o = PyObject_NEW(PyShmObj, &PyShmMemory_Type)) == NULL)
when PyObject_Init() succeeds
taking False path
1092 	    return NULL;
1093 	o->shmid = shmid;
1094 	o->addr = NULL;
1095 	o->mode = 0;
1096 	/* shm_dict[shmid] = o */
1097 	if (PyDict_SetItem(shm_dict, keyo, (PyObject *)o) == -1) {
when treating unknown struct PyObject * from src/extensions/shmmodule.c:195 as non-NULL
calling PyDict_SetItem with NULL as argument 2 (keyo) at src/extensions/shmmodule.c:1097
PyDict_SetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
1098 	    Py_DECREF(o);
1099 	    PyErr_SetString(PyShm_Error,
1100 			    "can't initialize shared memory object");
1101 	    return NULL;
1102 	}
1103 	Py_DECREF(o);	/* the owned reference in shm_dict doesn't count! */
1104     }
1105     /* set up the status data */
1106     if (shmctl(o->shmid, IPC_STAT, &(o->ds)) == -1) {
1107 	Py_DECREF(o);
1108 	PyErr_SetString(PyShm_Error,
1109 			"can't access shared memory segment");
1110 	return NULL;
1111     }
1112     return (PyObject *)o;
1113 }