There was an error while loading. Please reload this page.
1 parent 2dd0188 commit 49b1103Copy full SHA for 49b1103
1 file changed
Modules/_testexternalinspection.c
@@ -410,6 +410,7 @@ get_py_runtime(pid_t pid)
410
{
411
uintptr_t address = search_map_for_section(pid, "PyRuntime", "libpython");
412
if (address == 0) {
413
+ PyErr_Clear();
414
address = search_map_for_section(pid, "PyRuntime", "python");
415
}
416
return address;
@@ -1458,6 +1459,13 @@ get_stack_trace(PyObject* self, PyObject* args)
1458
1459
1460
1461
uintptr_t runtime_start_address = get_py_runtime(pid);
1462
+ if (runtime_start_address == 0) {
1463
+ if (!PyErr_Occurred()) {
1464
+ PyErr_SetString(
1465
+ PyExc_RuntimeError, "Failed to get .PyRuntime address");
1466
+ }
1467
+ return NULL;
1468
1469
struct _Py_DebugOffsets local_debug_offsets;
1470
1471
if (read_offsets(pid, &runtime_start_address, &local_debug_offsets)) {
@@ -1511,6 +1519,13 @@ get_async_stack_trace(PyObject* self, PyObject* args)
1511
1519
1512
1520
1513
1521
1522
1523
1524
1525
1526
1527
1528
1514
1529
1515
1530
1516
1531
0 commit comments