SEV-ES code may fill the 4th ist to VC_stack, but crash-util has no
support for #VC frames. It break backtrace due the zero-size stack.
So clear all unused stack base to workaround it.
Signed-off-by: samuelliao <samuelliao(a)samuelliao.com>
---
x86_64.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/x86_64.c b/x86_64.c
index 939c8a9..382cff1 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -1462,7 +1462,10 @@ x86_64_ist_init(void)
for (i = 0; i < MAX_EXCEPTION_STACKS; i++) {
if (ms->stkinfo.ebase[c][i] == 0)
continue;
- ms->stkinfo.ebase[c][i] -= ms->stkinfo.esize[i];
+ if(ms->stkinfo.esize[i] == 0)
+ ms->stkinfo.ebase[c][i] = 0;
+ else
+ ms->stkinfo.ebase[c][i] -= ms->stkinfo.esize[i];
}
}
--
2.18.4