|
From: <sv...@va...> - 2015-07-07 14:06:11
|
Author: sewardj
Date: Tue Jul 7 15:06:00 2015
New Revision: 15400
Log:
VG_(get_StackTrace_wrk) for x86-{linux,darwin}: when following
frame-pointer chains (via EBP), don't continue if EBP doesn't contain
a 4-aligned value. A misaligned EBP is almost certainly invalid --
hence, no loss in unwind capability here -- and the misaligned access
causes gcc 5.1 ubsan alignment checks to fail. So avoid them.
Modified:
trunk/coregrind/m_stacktrace.c
Modified: trunk/coregrind/m_stacktrace.c
==============================================================================
--- trunk/coregrind/m_stacktrace.c (original)
+++ trunk/coregrind/m_stacktrace.c Tue Jul 7 15:06:00 2015
@@ -337,7 +337,8 @@
/* This deals with frames resulting from functions which begin "pushl%
ebp ; movl %esp, %ebp" which is the ABI-mandated preamble. */
if (fp_min <= uregs.xbp &&
- uregs.xbp <= fp_max - 1 * sizeof(UWord)/*see comment below*/)
+ uregs.xbp <= fp_max - 1 * sizeof(UWord)/*see comment below*/ &&
+ VG_IS_4_ALIGNED(uregs.xbp))
{
/* fp looks sane, so use it. */
uregs.xip = (((UWord*)uregs.xbp)[1]);
|