硬汉嵌入式论坛

 找回密码
 立即注册
查看: 97|回复: 1
收起左侧

我最近再使用RT-thread的时候出现一个问题,使用邮箱发送和接收数据的时候会出现stack overflow后面打出来的线程信息没异常

[复制链接]

1

主题

0

回帖

3

积分

新手上路

积分
3
发表于 2025-5-20 10:15:41 | 显示全部楼层 |阅读模式
使用消息队列也会出现这种问题,关键是我再通信中加了互斥的,一帧数据的发送到接收只可能占一个邮箱或消息队列,我还多申请了几个怎么可能出现溢出的情况呢,有没有大佬能帮我解答一下,错误打印如下:
thread:can_re stack overflow
thread           pri  status      sp     stack size max used left tick  error
---------------- ---  ------- ---------- ----------  ------  ---------- ---
telnet            25  suspend 0x0000016c 0x00000800    18%   0x00000002 000
ufd_tcp           58  suspend 0x00000104 0x00000800    35%   0x00000001 000
rmcp              57  suspend 0x000000e4 0x00000400    27%   0x00000009 000
ipmi              56  suspend 0x000000ac 0x00000400    16%   0x0000000a 000
tcpip             50  ready   0x000000cc 0x00000800    31%   0x00000009 -02
etx               53  suspend 0x000000a0 0x00000800    07%   0x0000000c 000
erx               52  ready   0x0000009c 0x00000800    13%   0x00000001 000
bat_shutdown      45  suspend 0x00000084 0x00000400    24%   0x00000004 000
bmsx              38  suspend 0x00000094 0x00000400    37%   0x00000005 000
bat               37  ready   0x00000078 0x00000400    22%   0x00000007 -02
bat_acdown        36  suspend 0x00000080 0x00000400    14%   0x00000006 000
flash            136  ready   0x00000078 0x00000400    21%   0x0000000d -02
smbus             10  suspend 0x000000b8 0x00000400    20%   0x00000014 000
pmbus             41  ready   0x0000007c 0x00000400    32%   0x00000006 -02
bat_init          35  suspend 0x00000074 0x00000400    30%   0x00000003 000
m_s               34  ready   0x00000100 0x00000400    34%   0x00000001 000
fz                47  ready   0x000000cc 0x00000400    34%   0x0000000e -02
card              40  suspend 0x00000074 0x00000400    29%   0x00000008 000
death             33  suspend 0x00000098 0x00000400    29%   0x00000002 000
idle              32  suspend 0x00000090 0x00000400    29%   0x00000008 000
hb                31  suspend 0x00000074 0x00000400    11%   0x00000009 000
acdown             6  suspend 0x0000009c 0x00000400    28%   0x00000009 000
fanctl            39  suspend 0x000000a4 0x00000400    30%   0x00000011 000
fan               22  suspend 0x00000098 0x00000400    28%   0x00000007 000
syssta            19  suspend 0x0000007c 0x00000400    26%   0x00000002 000
info              20  suspend 0x00000074 0x00000400    29%   0x00000010 000
pca               21  suspend 0x00000080 0x00000400    21%   0x00000009 000
btn               18  suspend 0x00000078 0x00000400    11%   0x00000001 000
pwrctl             7  suspend 0x00000080 0x00000400    46%   0x00000008 000
led               44  ready   0x00000078 0x00000400    11%   0x00000008 -02
syspwr            11  suspend 0x000000a8 0x00000400    25%   0x0000000a 000
com5_r            30  suspend 0x00000084 0x00000400    12%   0x0000000a 000
com2_r            29  suspend 0x00000088 0x00000400    13%   0x0000000a 000
com1_r            28  suspend 0x00000084 0x00000400    12%   0x0000000a 000
can_r              9  suspend 0x000000cc 0x00000400    28%   0x00000004 000
ufd                8  suspend 0x000000bc 0x00000400    35%   0x00000003 000
tshell            49  suspend 0x00000134 0x00001000    07%   0x00000008 000
ntp_sync          26  suspend 0x00000074 0x00000600    28%   0x00000002 -19
sys_work          23  suspend 0x00000060 0x00000800    04%   0x0000000a 000
tidle0           255  ready   0x00000048 0x00000100    34%   0x00000010 -02
main               4  suspend 0x00000110 0x00001000    10%   0x00000008 000
nfs_init done

还有一种错误信息如下,我还在rt_thread_resume函数卡死前添加一些打印信息
<2025-05-19 07:08:48> rt_thread_resume : therad type :5
<2025-05-19 07:08:48> rt_thread_resume : therad flags :0
<2025-05-19 07:08:48> rt_thread_resume : therad stack_size :537015776
<2025-05-19 07:08:48> rt_thread_resume : therad current_priority :54
<2025-05-19 07:08:48> rt_thread_resume : therad init_priority :0
<2025-05-19 07:08:48> rt_thread_resume : therad error :73376
<2025-05-19 07:08:48> rt_thread_resume : therad stat :4

(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread) assertion failed at function:rt_thread_resume, line number nfs_init done

回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
115988
QQ
发表于 2025-5-21 07:21:50 | 显示全部楼层
可以考虑使用全局变量数组,然后信号量做个数据同步,看看是否正常

算是个对比测试
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-6-2 02:25 , Processed in 0.197607 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表