mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-19 08:42:22 +00:00
hv: fix 'Recursion in procedure calls found'
Here is how the recursion might happen: when there is something wrong | sbuf_put -> memcpy_s -> pr_err -> do_logmsg | | ----------------------------------- Replace 'pr_err' with 'ASSERT' in 'memcpy_s' to break this kind of recursion. Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
parent
deb44402e3
commit
54bd55d636
@ -234,7 +234,7 @@ void __assert(uint32_t line, const char *file, const char *txt)
|
||||
uint64_t rsp = cpu_rsp_get();
|
||||
uint64_t rbp = cpu_rbp_get();
|
||||
|
||||
pr_fatal("Assertion failed in file %s,line %u : %s",
|
||||
printf("Assertion failed in file %s,line %u : %s",
|
||||
file, line, txt);
|
||||
show_host_call_trace(rsp, rbp, pcpu_id);
|
||||
dump_guest_context(pcpu_id);
|
||||
|
@ -12,7 +12,6 @@ void __assert(uint32_t line, const char *file, const char *txt);
|
||||
|
||||
#define ASSERT(x, ...) \
|
||||
if (!(x)) {\
|
||||
pr_fatal(__VA_ARGS__);\
|
||||
__assert(__LINE__, __FILE__, "fatal error");\
|
||||
}
|
||||
#else
|
||||
|
@ -344,14 +344,12 @@ void *memcpy_s(void *d, size_t dmax, const void *s, size_t slen)
|
||||
uint8_t *src8;
|
||||
|
||||
if (slen == 0U || dmax == 0U || dmax < slen) {
|
||||
pr_err("%s: invalid src, dest buffer or length.", __func__);
|
||||
return NULL;
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
if ((d > s && d <= s + slen - 1)
|
||||
|| (d < s && s <= d + dmax - 1)) {
|
||||
pr_err("%s: overlap happened.", __func__);
|
||||
return NULL;
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
/*same memory block, no need to copy*/
|
||||
|
Loading…
Reference in New Issue
Block a user