From 38ff5a7fafadaeb2e9aff4f6af896c9d82075a47 Mon Sep 17 00:00:00 2001 From: Dino Viehland Date: Thu, 4 Apr 2024 11:00:46 -0700 Subject: [PATCH] Log what target we have when we're looking up a vtable slot Summary: There's a bunch of errors coming out of this where we're failing to find the v-table slot. It seems likely that we either have the slot patched or that the type isn't actually being defined statically for some reason. This increases what we report for the error so we can have a chance of figuring out what the issue is. Reviewed By: alexmalyshev Differential Revision: D55702279 fbshipit-source-id: c7031fc86d663e5c6db11bf424d41935d62a4471 --- cinderx/StaticPython/classloader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cinderx/StaticPython/classloader.c b/cinderx/StaticPython/classloader.c index 395fd943252..a576aa5ef2b 100644 --- a/cinderx/StaticPython/classloader.c +++ b/cinderx/StaticPython/classloader.c @@ -3759,8 +3759,9 @@ classloader_init_slot(PyObject *path) PyObject *new_index = PyDict_GetItem(slot_map, slot_name); if (new_index == NULL) { PyErr_Format( - PyExc_RuntimeError, "unable to resolve v-table slot '%R' in %s", - slot_name, target_type->tp_name); + PyExc_RuntimeError, "unable to resolve v-table slot %R in %s for %s (%R) is_static: %s used: %s", + slot_name, target_type->tp_name, Py_TYPE(cur)->tp_name, cur, + is_static_type(target_type) ? "true" : "false", used_in_vtable(cur) ? "true" : "false"); Py_DECREF(target_type); Py_DECREF(cur); return -1;