|
From: Nicholas N. <nj...@ca...> - 2004-01-30 17:37:34
|
Hi,
Valgrind's VG_(sys_set_thread_area)() is missing some {pre,post}_mem_write
events.
Firstly, the info->entry_number of the passed structure can be written to.
The following patch fixes this.
diff -u -3 -p -r1.12 vg_ldt.c
--- coregrind/vg_ldt.c 21 Jan 2004 01:27:26 -0000 1.12
+++ coregrind/vg_ldt.c 30 Jan 2004 17:30:10 -0000
@@ -429,7 +429,12 @@ Int VG_(sys_set_thread_area) ( ThreadId
translate_to_hw_format(info, VG_(threads)[tid].tls + idx, 0);
+ VG_TRACK( pre_mem_write, Vg_CoreSysCall, tid,
+ "set_thread_area(info->entry)",
+ (Addr) & info->entry_number, sizeof(unsigned int) );
info->entry_number = idx + VKI_GDT_TLS_MIN;
+ VG_TRACK( post_mem_write,
+ (Addr) & info->entry_number, sizeof(unsigned int) );
return 0;
}
Secondly, AIUI, the structure passed to set_thread_area is copied
into the thread's TLS array. However, since the thread's TLS array is
stored within Valgrind, I think we don't need an event there.
How does this sound? I'll commit it if no-one has complaints.
N
|