基于君正T31N的芯片 网络摄像头执行提供的demo程序 出现段错误

IPC/NVR/可视门铃等具备多媒体能力的设备,扫地机/AGV等机器人设备


Post Reply
15118021615
Posts: 1

详情描述:详情描述:基于君正T31N的 网络摄像头执行你们提供的demo程序 出现段错误显示出现在你们的SDK cjson那一块
./tuya_ipc_demo -m 2 -p a1EAq22hGho -u 3xCy08F3HUOxHN24UKRg -a nXDxHOktvAViGApuCtIeIgBREa9T8iYB -r "./" -t "AYcjAkxa0v6IcF"
为便于调试将 执行程序后面的参数全部固定在程序里面
问题类型目录:产品功能模块/MCU嵌入式开发/TuyaOS多代码开发
区域:中国区
产品ID:[智能摄像机-rlrsyl46k1csnz80, 智能摄像机2-tekapgba2mrnditu]
Program received signal SIGSEGV, Segmentation fault.
0x0041ef04 in cJSON_strcasecmp (s1=0x62c5e0 "uuid", s2=0x5632d8 "uuid") at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_adapter/utilities/cJSON.c:47
47 /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_adapter/utilities/cJSON.c: No such file or directory.
(gdb) bt full
#0 0x0041ef04 in cJSON_strcasecmp (s1=0x62c5e0 "uuid", s2=0x5632d8 "uuid") at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_adapter/utilities/cJSON.c:47
__res = <optimized out>
#1 0x004210b8 in cJSON_GetObjectItem (object=<optimized out>, string=0x5632d8 "uuid") at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_adapter/utilities/cJSON.c:568
c = 0x62d220
#2 0x004755e0 in __ty_deserialize (in=<optimized out>, rw=0x7fff6838, rw_cnt=6) at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_iot_sdk/tuya_cloud/tuya_ws_db.c:147
root = 0x62d1e0
func = "__ty_deserialize"
op_ret = <optimized out>
i = <optimized out>
json = <optimized out>
#3 0x00475980 in __ty_db_deserialize_restore (key=0x56331c "gw_bi", rw=0x7fff6838, rw_cnt=6) at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_iot_sdk/tuya_cloud/tuya_ws_db.c:319
buf = 0x62d710 "{\"uuid\":\"3xCy08F3HUOxHN24UKRg\",\"auth_key\":\"nXDxHOktvAViGApuCtIeIgBREa9T8iYB\",\"ap_ssid\":null,\"ap_passwd\":null,\"country_code\":null,\"prod_test\":false }", '\f' <repeats 12 times>
len = 148
op_ret = 0
func = "__ty_db_deserialize_restore"
#4 0x004763e4 in wd_gw_base_if_read (bi=<optimized out>) at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_iot_sdk/tuya_cloud/tuya_ws_db.c:484
func = "wd_gw_base_if_read"
tdrw = {{key = 0x5632d8 "uuid", vt = 6 '\006', val = 0x7fff6964, len = 26}, {key = 0x5632e0 "auth_key", vt = 6 '\006', val = 0x7fff697e, len = 33}, {key = 0x5632ec "ap_ssid", vt = 6 '\006', val = 0x7fff699f, len = 33}, {
key = 0x5632f4 "ap_passwd", vt = 6 '\006', val = 0x7fff69c0, len = 65}, {key = 0x563300 "country_code", vt = 6 '\006', val = 0x7fff6a01, len = 8}, {key = 0x563310 "prod_test", vt = 5 '\005', val = 0x7fff6a0c, len = 4}}
op_ret = 0
#5 0x004eb798 in tuya_iot_set_wf_gw_prod_info (wf_prod_info=0x7fff6ae8) at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_iot_sdk/wifi_sdk/tuya_iot_wifi_api.c:57
op_ret = 0
need_wr = 0
bi = {uuid = '\000' <repeats 25 times>, auth_key = '\000' <repeats 32 times>, ap_ssid = '\000' <repeats 32 times>, ap_passwd = '\000' <repeats 64 times>, country_code = "\000\000\000\000\000\000\000", prod_test = 0}
tmp_bi = {uuid = '\000' <repeats 25 times>, auth_key = '\000' <repeats 32 times>, ap_ssid = '\000' <repeats 32 times>, ap_passwd = '\000' <repeats 64 times>, country_code = "\000\000\000\000\000\000\000", prod_test = 0}
#6 0x00424bc8 in tuya_ipc_start_sdk (wifi_mode=WIFI_INIT_DEBUG, pToken=0x7fff6c60 "AYY4fEPAV04L96") at /var/lib/jenkins/workspace/ipc_common_platform_new/src/tuya_ipc_sdk/tuya_ipc_api.c:172
ret = 0
iot_cb = {gw_status_cb = 0x419a10 <__IPC_APP_Get_Net_Status_cb>, gw_ug_cb = 0x41b144 <IPC_APP_Upgrade_Inform_cb>, gw_reset_cb = 0x41af00 <IPC_APP_Reset_System_CB>, dev_obj_dp_cb = 0x41ecc4 <IPC_APP_handle_dp_cmd_objs>,
dev_raw_dp_cb = 0x0, dev_dp_query_cb = 0x41ede4 <IPC_APP_handle_dp_query_objs>, dev_ug_cb = 0x0, gw_traffic_status_cb = 0x424888 <tuya_ipc_traffic_change>}
iot_wifi_mode = 0
func = "tuya_ipc_start_sdk"
prod_info = {uuid = 0x5b9a42 <s_tuya_env+82> "tuyaOneUuidForOneDevice", auth_key = 0x5b9a5c <s_tuya_env+108> "tuyaOneAuthkeyForOneUUID", ap_ssid = 0x0, ap_passwd = 0x0}
#7 0x00419e60 in IPC_APP_Init_SDK (init_mode=WIFI_INIT_DEBUG, p_token=0x7fff6c60 "AYY4fEPAV04L96") at /home/wsf/ISVP/ISVP_T20/tuya-iotos-embeded-multimedia-demo/demo_for_ipc/demo_src/user_main.c:122
env = {storage_path = "./", '\000' <repeats 62 times>, product_key = "gpkguYNp7yI4k413", uuid = "tuyaOneUuidForOneDevice\000\000", auth_key = "tuyaOneAuthkeyForOneUUID\000\000\000\000\000\000\000\000",
p2p_id = '\000' <repeats 25 times>, dev_sw_version = "1.2.3", '\000' <repeats 15 times>, dev_serial_num = "tuya_ipc", '\000' <repeats 24 times>, dev_obj_dp_cb = 0x41ecc4 <IPC_APP_handle_dp_cmd_objs>, dev_raw_dp_cb = 0x0,
dev_dp_query_cb = 0x41ede4 <IPC_APP_handle_dp_query_objs>, status_changed_cb = 0x419a10 <__IPC_APP_Get_Net_Status_cb>, gw_ug_cb = 0x41b144 <IPC_APP_Upgrade_Inform_cb>, gw_rst_cb = 0x41af00 <IPC_APP_Reset_System_CB>,
gw_restart_cb = 0x41af4c <IPC_APP_Restart_Process_CB>, mem_save_mode = 0, p_reserved = 0x0}
#8 0x0041a200 in main (argc=1, argv=0x7fff6e64) at /home/wsf/ISVP/ISVP_T20/tuya-iotos-embeded-multimedia-demo/demo_for_ipc/demo_src/user_main.c:203
res = -1
token = "AYY4fEPAV04L96", '\000' <repeats 15 times>
mode = WIFI_INIT_DEBUG
h264_output_thread = 0
pcm_output_thread = 0
motion_detect_thread = 312
test_input = "\373\000\000\000\000\000\000\000\001\000\000\000\240l\377\177\000$\376w\000\000\000\000\001\000\000\000\000`\361w\000\000\000\000\030[\377wD\330\375w\000\000F\000\374\023\214\000\000\000\000\000\001\000\000\000\320l\377\177"
warning: GDB can't find the start of the function at 0x77f1af5a.

Code: Select all

GDB is unable to find the start of the function at 0x77f1af5a

and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x77f1af5a for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
(gdb)

User avatar
起个中文名
Posts: 110

Re: 基于君正T31N的芯片 网络摄像头执行提供的demo程序 出现段错误

我们先看一下,稍后回复

User avatar
起个中文名
Posts: 110

Re: 基于君正T31N的芯片 网络摄像头执行提供的demo程序 出现段错误

目前根据gdb的信息以及代码分析,没有看到异常的问题。
能否在你们平台上验证下以下代码是否可以正常运行:

Code: Select all

#include "cJSON.h"

int test_json()
{
	char *buf = "{\"uuid\":\"3xCy08F3HUOxHN24UKRg\",\"auth_key\":\"nXDxHOktvAViGApuCtIeIgBREa9T8iYB\",\"ap_ssid\":null,\"ap_passwd\":null,\"country_code\":null,\"prod_test\":false}";
	
cJSON *root = cJSON_Parse(buf);
if(NULL == root)
{
    printf("json parse fails\n");
    return -1;
}	

cJSON *json = cJSON_GetObjectItem(root, "uuid");

if(json){
	printf("get uuid ok\n");
} else {
	printf("get uuid fail\n");
}
return 0;
}
Post Reply