|
From: <sv...@va...> - 2014-03-12 14:27:59
|
Author: bart
Date: Wed Mar 12 14:27:49 2014
New Revision: 13870
Log:
drd: Fix an assertion failure in the internal consistency check code (#332055)
When DRD is built with ENABLE_DRD_CONSISTENCY_CHECKS enabled it fails with an assert on platforms where VG_STACK_REDZONE_SZB is #define'd as 0 (for example on 32-bit x86). drd: drd_thread.h:299 (vgDrd_thread_set_stack_min): Assertion 'DRD_(g_threadinfo)[tid].stack_min < DRD_(g_threadinfo)[tid].stack_max || DRD_(g_threadinfo)[tid].stack_max == 0' failed. ==12392== at 0x380227CD: report_and_quit (m_libcassert.c:279) ==12392== by 0x38022979: vgPlain_assert_fail (m_libcassert.c:359) ==12392== by 0x38015B29: drd_post_thread_create (drd_thread.h:297) ==12392== by 0x380A5DDC: run_a_thread_NORETURN (syswrap-linux.c) This is because on drd_post_thread_create() call is made to: drd_start_using_mem_stack2(drd_created, stack_max, 0); and in drd_start_using_mem_stack2() calls is made to: DRD_(thread_set_stack_min)(tid, a - VG_STACK_REDZONE_SZB); For many platforms VG_STACK_REDZONE_SZB is #define'd as 0 so that stack_min == stack_max in DRD_(thread_set_stack_min)(). I think it is safe to change th
e assert from (stack_min < stack_max) to (stack_min <= stack_max).
From: Ivo Raisr <iv...@iv...>
Modified:
trunk/drd/drd_thread.h
Modified: trunk/drd/drd_thread.h
==============================================================================
--- trunk/drd/drd_thread.h (original)
+++ trunk/drd/drd_thread.h Wed Mar 12 14:27:49 2014
@@ -295,7 +295,7 @@
/* This function can be called after the thread has been created but */
/* before drd_post_thread_create() has filled in stack_max. */
tl_assert(DRD_(g_threadinfo)[tid].stack_min
- < DRD_(g_threadinfo)[tid].stack_max
+ <= DRD_(g_threadinfo)[tid].stack_max
|| DRD_(g_threadinfo)[tid].stack_max == 0);
#endif
if (UNLIKELY(stack_min < DRD_(g_threadinfo)[tid].stack_min_min))
|