Skip to content

Commit 1a62649

Browse files
committed
fixup too many decrefs
1 parent 0101cda commit 1a62649

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ addons:
126126
- sasl2-bin
127127
- swig
128128
- libnghttp2-dev
129+
# used by symbolizer in leak warnings suppression
130+
- python2.7-dbg
129131
# documentation
130132
- asciidoc
131133
- asciidoctor

src/router_pynode.c

-4
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ qd_error_t qd_router_python_setup(qd_router_t *router)
444444
// Instantiate the router
445445
//
446446
pyRouter = PyObject_CallObject(pClass, pArgs);
447-
Py_DECREF(pId);
448-
Py_DECREF(pArea);
449-
Py_DECREF(pMaxRouters);
450447
Py_DECREF(pClass);
451448
Py_DECREF(pArgs);
452449
Py_DECREF(adapterType);
@@ -456,7 +453,6 @@ qd_error_t qd_router_python_setup(qd_router_t *router)
456453
pySetMobileSeq = PyObject_GetAttrString(pyRouter, "setMobileSeq"); QD_ERROR_PY_RET();
457454
pySetMyMobileSeq = PyObject_GetAttrString(pyRouter, "setMyMobileSeq"); QD_ERROR_PY_RET();
458455
pyLinkLost = PyObject_GetAttrString(pyRouter, "linkLost"); QD_ERROR_PY_RET();
459-
// Py_DECREF(adapterInstance); // TODO: why not this? get python exceptions if I try
460456
return qd_error_code();
461457
}
462458

tests/lsan.supp

+24-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ leak:^pn_raw_connection$
3737
#### Miscellaneous 3rd party libraries:
3838
####
3939

40-
# these leaks happen even after simple Py_Initialize(); Py_Finalize();
40+
# Wholesale library suppressions, avoid doing this if at all possible
41+
# one reason we may not be able to avoid doing this is compatibility with multiple versions of libs on many operating systems
42+
#leak:/libpython2.*.so
43+
#leak:/libpython3.*.so
44+
#leak:/libwebsockets.so
45+
#leak:libqpid-proton
46+
47+
# these Python leaks happen even after simple Py_Initialize(); Py_Finalize();
4148
# https://bugs.python.org/issue1635741
4249
leak:^_PyObject_Realloc
4350
leak:^PyObject_Malloc$
@@ -51,16 +58,23 @@ leak:^_PyObject_GC_Resize$
5158
# Python uses these alloc functions if you define PYTHONDEVMODE=1
5259
leak:^_PyMem_DebugRawAlloc$
5360
leak:^_PyMem_DebugRawRealloc$
61+
# All the rest
62+
leak:^list_append$
63+
leak:^list_resize$
64+
leak:^_PyBytes_Resize$
65+
leak:^resize_compact$
66+
leak:^unicode_resize$
67+
# Python 2.7
68+
leak:^PyString_FromStringAndSize$
69+
leak:^PyString_FromString$
70+
leak:^PyObject_Realloc$
71+
leak:^_PyObject_GC_Malloc$
72+
leak:^_PyString_Resize$
73+
leak:^PyUnicodeUCS4_FromUnicode$
74+
leak:^PyList_Append$
75+
leak:^PyList_New$
5476

55-
# Wholesale library suppressions, avoid doing this if at all possible
56-
# one reason we may not be able to avoid doing this is compatibility with multiple versions of libs on many operating systems
57-
leak:/libpython2.*.so
58-
#leak:/libpython3.*.so
59-
#leak:/libwebsockets.so
60-
#leak:libqpid-proton
61-
62-
# We might be able to remove these once all known dispatch leaks have been fixed
63-
# Suppressions taken from Proton's lsan.supp
77+
# Proton suppressions taken from Proton's lsan.supp
6478
# this appears in system_tests_open_properties:
6579
leak:^pni_data_grow$
6680
leak:^pn_buffer_ensure$

0 commit comments

Comments
 (0)