https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66874

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
I've been going crazy hitting this recently (see e.g.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114068#c2).

pinskia pointed me here and I fear I might be hitting this as a result of dwz
optimised debug info on gcc (as it's the only recent change I can think of).

Anyway, this seems to help indeed:

--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -60,6 +60,11 @@ x86_64_fallback_frame_state (struct _Unwind_Context
*context,
 #else
 #define RT_SIGRETURN_SYSCALL   0x050f40000201c0c7ULL
 #endif
+
+  /* Defend against corrupted PC, PR66874 */
+  if ((unsigned long)pc < 4096)
+    return _URC_END_OF_STACK;
+
   if (*(unsigned char *)(pc+0) == 0x48
       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
     {

I've only shoved it in quickly to be able to debug something else so it's not
really ready to submit.

Reply via email to