[Lldb-commits] [PATCH] D93495: CrashReason: Add MTE tag check faults to the list of crash reasons.

Peter Collingbourne via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 21 13:38:39 PST 2020


pcc updated this revision to Diff 313190.
pcc added a comment.

Show fault address for SEGV_MTESERR


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93495/new/

https://reviews.llvm.org/D93495

Files:
  lldb/source/Plugins/Process/POSIX/CrashReason.cpp
  lldb/source/Plugins/Process/POSIX/CrashReason.h


Index: lldb/source/Plugins/Process/POSIX/CrashReason.h
===================================================================
--- lldb/source/Plugins/Process/POSIX/CrashReason.h
+++ lldb/source/Plugins/Process/POSIX/CrashReason.h
@@ -22,6 +22,8 @@
   eInvalidAddress,
   ePrivilegedAddress,
   eBoundViolation,
+  eAsyncTagCheckFault,
+  eSyncTagCheckFault,
 
   // SIGILL crash reasons.
   eIllegalOpcode,
Index: lldb/source/Plugins/Process/POSIX/CrashReason.cpp
===================================================================
--- lldb/source/Plugins/Process/POSIX/CrashReason.cpp
+++ lldb/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -58,6 +58,16 @@
 #endif
   case SEGV_BNDERR:
     return CrashReason::eBoundViolation;
+#ifndef SEGV_MTEAERR
+#define SEGV_MTEAERR 8
+#endif
+  case SEGV_MTEAERR:
+    return CrashReason::eAsyncTagCheckFault;
+#ifndef SEGV_MTESERR
+#define SEGV_MTESERR 9
+#endif
+  case SEGV_MTESERR:
+    return CrashReason::eSyncTagCheckFault;
   }
 
   return CrashReason::eInvalidCrashReason;
@@ -166,6 +176,13 @@
   case CrashReason::eBoundViolation:
     str = "signal SIGSEGV: bound violation";
     break;
+  case CrashReason::eAsyncTagCheckFault:
+    str = "signal SIGSEGV: async tag check fault";
+    break;
+  case CrashReason::eSyncTagCheckFault:
+    str = "signal SIGSEGV: sync tag check fault";
+    AppendFaultAddr(str, fault_addr);
+    break;
   case CrashReason::eIllegalOpcode:
     str = "signal SIGILL: illegal instruction";
     break;
@@ -246,6 +263,12 @@
   case CrashReason::eBoundViolation:
     str = "eBoundViolation";
     break;
+  case CrashReason::eAsyncTagCheckFault:
+    str = "eAsyncTagCheckFault";
+    break;
+  case CrashReason::eSyncTagCheckFault:
+    str = "eSyncTagCheckFault";
+    break;
 
   // SIGILL crash reasons.
   case CrashReason::eIllegalOpcode:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93495.313190.patch
Type: text/x-patch
Size: 1827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201221/d9a82065/attachment-0001.bin>


More information about the lldb-commits mailing list