From: Sunny D. <int...@ya...> - 2012-06-07 11:31:00
|
I forgot to mention that I can gdb my daemons perfectly fine with all the debug information like line numbers, local variables and code listing etc. Its only when valgrind crashes, the backtrace is all '??'. -Sunny ----- Original Message ----- From: Sunny Das <int...@ya...> To: Philippe Waroquiers <phi...@sk...> Cc: "val...@li..." <val...@li...> Sent: Wednesday, June 6, 2012 4:08 PM Subject: Re: [Valgrind-developers] vmware backdoor patch I went ahead and ripped all the 8 functions out and replaced the part which does backdoor assembly into their own functions with correct signature, handling the returns properly. And I went past that issue of backdoor. Now, I am running into another weird issue where valgrind crashed somewhere and I can't figure out where because the backtrace is all '??'. This happens even if I run the program inline inside the gdb. valgrind was built with splitdebug in gentoo and so was glibc. The valgrind debug symbols are all in /usr/lib/debug/usr/lib64/valgrind/ and /usr/lib/debug/usr/bin/valgrind.debug and glibc debug symbols are in/usr/lib/debug/lib64. Why is gdb refusing to give me a proper backtrace? -Sunny ----- Original Message ----- From: Philippe Waroquiers <phi...@sk...> To: Sunny Das <int...@ya...> Cc: "val...@li..." <val...@li...> Sent: Wednesday, June 6, 2012 10:02 AM Subject: Re: [Valgrind-developers] vmware backdoor patch On Wed, 2012-06-06 at 07:14 -0700, Sunny Das wrote: > So, basically, I can't do simple things like strlen, malloc....:( Man that sucks big time. > How do I segregate the darn thing like that? And its someone else's code I am ripping apart. Depending on the structure of this code, it might be easy or might be very tricky. If the special sequence(s) of instruction that triggers the vmware backdoor is at well isolated and specific place(s), then it is should be trivial to put an "if" around it. So, something like: ... surrounding code doing malloc/free/.... ... asm("... special instruction sequence of vmware") ... some other code doing malloc/free/... Then just replace the asm by: if RUNNING_ON_VALGRIND SIMD_CALL (valgrind_vmware_backdoor_fn, ...) else asm ("...") keep all the rest as is, and have your function valgrind_vmware_backdoor_fn doing the magical instructions with the same asm sequence, and returning the values as expected by the inline asm. If there are several tricky interactions between the surrounding code and the special asm, then I think it is still possible but more of these valgrind specific fn will have to be written. If you do not have access to the above code and cannot modify it (so, if you just have a "vmware closed source library", then you need to ask vmware developpers to do this for you. Philippe ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Valgrind-developers mailing list Val...@li... https://lists.sourceforge.net/lists/listinfo/valgrind-developers |