Skip to content

Commit 0b1ca87

Browse files
committed
Try to get more context trying to tp_traverse a free'd type
1 parent 03db186 commit 0b1ca87

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

graalpython/com.oracle.graal.python.cext/src/gcmodule.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ call_traverse(traverseproc traverse, PyObject *op, visitproc visit, void *arg)
4949
Py_TYPE((op))->tp_name);
5050
return 0;
5151
} else {
52+
if (_PyObject_IsFreed((PyObject *)Py_TYPE(op))) {
53+
if (_PyObject_IsFreed(op)) {
54+
PyTruffle_Log(PY_TRUFFLE_LOG_INFO,
55+
"we tried to call tp_traverse on a freed object at %p (ctx %p)!",
56+
op, arg);
57+
} else {
58+
PyTruffle_Log(PY_TRUFFLE_LOG_INFO,
59+
"we tried to call tp_traverse on an object at %p with a freed type at %p (ctx %p)!",
60+
op, Py_TYPE(op), arg);
61+
}
62+
return 0;
63+
}
5264
return traverse(op, (visitproc)visit, arg);
5365
}
5466

graalpython/com.oracle.graal.python.cext/src/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ PyLong_FromString(const char *str, char **pend, int base)
19611961
// is a small integer cache and if we're lucky we can just return from
19621962
// that.
19631963
// In base 2, up to 8 digits may be a small integer, in base 36 8 digits
1964-
// still fit in 64 bits
1964+
// still fit easily in 64 bits
19651965
for (int i = 0; i < 8; i++) {
19661966
char c = str[i];
19671967
if (c == '\0') {

0 commit comments

Comments
 (0)