sim/posix/backtrace: process host backtrace with critical section

backtrace() is not a signal safe

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-05-12 14:58:18 +08:00 committed by Xiang Xiao
parent 6417ca79ad
commit 150e5a1a0f

View File

@ -94,7 +94,13 @@ int host_backtrace(void** array, int size)
#ifdef CONFIG_WINDOWS_CYGWIN
return 0;
#else
return backtrace(array, size);
uint64_t flags = up_irq_save();
int ret;
ret = backtrace(array, size);
up_irq_restore(flags);
return ret;
#endif
}