|
From: Tom H. <th...@cy...> - 2004-09-12 22:49:08
|
CVS commit by thughes:
Only mark the section of the stack that has actually been used as
off limits otherwise we can try and invalidate a vast area of memory
if there is no stack limit.
M +4 -2 vg_scheduler.c 1.183
--- valgrind/coregrind/vg_scheduler.c #1.182:1.183
@@ -1248,9 +1248,11 @@ static
void cleanup_after_thread_exited ( ThreadId tid, Bool forcekill )
{
+ Segment *seg;
+
vg_assert(is_valid_or_empty_tid(tid));
vg_assert(VG_(threads)[tid].status == VgTs_Empty);
/* Its stack is now off-limits */
- VG_TRACK( die_mem_stack, VG_(threads)[tid].stack_base,
- VG_(threads)[tid].stack_size );
+ seg = VG_(find_segment)( VG_(threads)[tid].stack_base );
+ VG_TRACK( die_mem_stack, seg->addr, seg->len );
VGA_(cleanup_thread)( &VG_(threads)[tid].arch );
|