wss_server 断开wifi时assert failed

chenmantone
Posts: 7
Joined: Thu Apr 13, 2023 1:37 am

wss_server 断开wifi时assert failed

Postby chenmantone » Sat Jan 27, 2024 7:34 am

esp32c3项目采用wss_server 例程,运行后连接WiFi正常,但是如果之后把wifi断开的话,esp32c3会重启,监视器显示“assert failed: tlsf_free tlsf.c:1119 (!block_is_free(block) && "block already marked as free")”,请问这是什么原因造成esp32c3重启。如果想断开wifi之后esp32c3不重启,要修改哪里?

chenmantone
Posts: 7
Joined: Thu Apr 13, 2023 1:37 am

Re: wss_server 断开wifi时assert failed

Postby chenmantone » Tue Jan 30, 2024 3:27 am

发现运行到components\esp_http_server\src\httpd_main.c文件的httpd_stop(httpd_handle_t handle)中释放global user context时assert failed:

/* Release global user context, if not NULL */
if (hd->config.global_user_ctx) {
if (hd->config.global_user_ctx_free_fn) {
hd->config.global_user_ctx_free_fn(hd->config.global_user_ctx);
} else {
free(hd->config.global_user_ctx); //屏蔽这条指令,就不会出现assert filed
}
hd->config.global_user_ctx = NULL;
}

把free(hd->config.global_user_ctx); 这条指令屏蔽,就不会出现assert filed请问有谁知道原因吗?

Who is online

Users browsing this forum: No registered users and 205 guests