|
From: Julian S. <js...@ac...> - 2007-02-25 15:46:06
|
http://www.x86-64.org/documentation/abi.pdf Up to 128 bytes below rsp can be used. See VG_STACK_REDZONE_SZB in include/pub_tool_machine.h. The ABI says that this area can be trashed across calls (is highly volatile). From which I infer that it is a bug for a program to put something there, do a call and expect it to still be there afterwards. Therefore memcheck marks that area as uninitialised at each call and return, which is expensive, but necessary to make uninitialised value checking for stack variables work right on amd64. I don't know if this is relevant for drd, or not. ppc64-linux has the same disease only worse (288 bytes); x86-linux and ppc32-linux don't have it at all. J On Sunday 25 February 2007 15:23, Bart Van Assche wrote: > Can anyone of the Valgrind developer tell me where I can find more > information about the AMD-64 ABI ? Apparently the false positives > produced by drd on AMD-64 are caused by accesses to stack locations. > The location in the example below (0x4021018, 96 bytes below the > current lowest stack address in use according to Valgrind's core) was > not declared to the drd tool via track_new_mem_stack but is accessed > anyway by the client. I was expecting Valgrind's core to call > track_new_mem_stack before the client accesses stack data. Did I > misunderstand something ? > > Suspicious stack access: > > ==4681== store 0x4021018 size 8 thread_func1[0] (vg 2 / drd 2 / off -96) > ==4681== at 0x4C20DE9: pthread_mutex_unlock (drd_preloaded.c:339) > ==4681== by 0x400EB0: increment_finished_count (pth_detached.c:29) > ==4681== by 0x400F16: thread_func1 (pth_detached.c:45) > ==4681== by 0x4C21B20: vg_thread_wrapper (drd_preloaded.c:148) > ==4681== by 0x4E2A09D: start_thread (in /lib64/libpthread-2.5.so) > ==4681== by 0x51004CC: clone (in /lib64/libc-2.5.so) > > Line 339 in drd_preloaded.c looks as follows: > > VALGRIND_DO_CLIENT_REQUEST(res, -1, > VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK, > mutex, sizeof(*mutex), 0, 0, 0); > > Regards, > > Bart. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |