From 66788d2f201b0fdb937e4e83fca1734bcfdb8f5f Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Thu, 10 Apr 2025 22:26:16 +0800 Subject: [PATCH] debug --- util/RTCContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index 1c1d06b..4fde7cb 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -202,6 +202,12 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, reinterpret_cast(numpyApi_[93]); std::cout << " 函数地址: " << (void*)PyArray_SimpleNew << std::endl; + std::cout << "[5.1] 验证函数指针..." << std::endl; + void* func_ptr = numpyApi_[93]; + if (reinterpret_cast(func_ptr) < 0x1000) { // 检查是否为合法地址 + std::cerr << "非法函数指针: " << func_ptr << std::endl; + throw std::runtime_error("Invalid PyArray_SimpleNew pointer"); + } // 6. 创建NumPy数组 std::cout << "[6] 创建NumPy数组..." << std::endl; PyObject* pyArray = PyArray_SimpleNew(1, dims, NPY_INT16);