[Crash-utility] [PATCH] Clear ununsed exception stack base

samuelliao(廖生苗) samuelliao at tencent.com
Mon Nov 23 07:00:03 UTC 2020


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 at 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







More information about the Crash-utility mailing list