mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
sched: fix stack check crash in idle thread
Change-Id: Iea7c096ffcab181f318edcc1bfe1717785831b7a Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -801,18 +801,21 @@ void nx_start(void)
|
|||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_STACK_COLORATION) && defined(CONFIG_DEBUG_MM)
|
#if defined(CONFIG_STACK_COLORATION) && defined(CONFIG_DEBUG_MM)
|
||||||
irqstate_t flags;
|
|
||||||
|
|
||||||
/* Check stack in idle thread */
|
/* Check stack in idle thread */
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_MAX_TASKS && g_pidhash[i].tcb; i++)
|
for (i = 0; i < CONFIG_MAX_TASKS; i++)
|
||||||
{
|
{
|
||||||
|
FAR struct tcb_s *tcb;
|
||||||
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
if (up_check_tcbstack_remain(g_pidhash[i].tcb) <= 0)
|
tcb = g_pidhash[i].tcb;
|
||||||
|
if (tcb && up_check_tcbstack_remain(tcb) <= 0)
|
||||||
{
|
{
|
||||||
_alert("Stack check failed, pid %d, name %s\n",
|
_alert("Stack check failed, pid %d, name %s\n",
|
||||||
g_pidhash[i].tcb->pid, g_pidhash[i].tcb->name);
|
tcb->pid, tcb->name);
|
||||||
PANIC();
|
PANIC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user