diff --git a/components/common/src/volc_rtc.c b/components/common/src/volc_rtc.c index 9db5bff..1c0520f 100644 --- a/components/common/src/volc_rtc.c +++ b/components/common/src/volc_rtc.c @@ -427,7 +427,10 @@ static void _on_global_error(byte_rtc_engine_t engine, int code, const char* mes rtc->b_channel_joined = false; rtc->b_first_keyframe_received = false; - LOGI("global error %d %s\n", code, message); + // 防御性判空: 火山 RTC SDK 在某些 ICE Agent 失败路径下会用 message=NULL 调用本回调, + // 导致 printf("%s", NULL) → strlen(NULL) → LoadProhibited panic → 设备重启 + // (idle ≥ 10 分钟后服务端 session 超时 / NAT 表过期等场景偶发触发) + LOGI("global error %d %s\n", code, message ? message : "(null)"); LOGI("global error heap_free=%u", (unsigned)heap_caps_get_free_size(MALLOC_CAP_DEFAULT)); msg_data.code = VOLC_MSG_DISCONNECTED; _send_message_2_user(rtc, &msg_data);