|
From: Maurice v. S. <ma...@bl...> - 2015-04-23 16:34:37
|
Hi Chiaki, If you use --track-origins=yes, then valgrind will report where the variable was first allocated (or put on the stack). That's usually enough to figure out which it is. ][ Maurice van Swaaij, Blue Sky Studios ][ ----- Original Message ----- | From: "chiaki ISHIKAWA" <ish...@yk...> | To: val...@li... | Sent: Thursday, April 23, 2015 12:13:38 PM | Subject: [Valgrind-users] Can valgrind print the used "uninitialized | value" and its size? | Hi, | I was running mozilla TB and found a message during a test run | ==20163== Conditional jump or move depends on uninitialised value(s) | ==20163== at 0x90974BC: nsJSObjWrapper::NP_SetProperty(NPObject*, | void*, _NPVariant const*) (nsJSNPRuntime.cpp:137) | ... | so there is an uninitialized usage. | In this particular instance, I realized that it would be really great | to know the value of this uninitialized memory (turns out to be | automatic variable on the stack.) | so that I can learn what has happened to the subsequent processing. | Can the uninitialized value was zero or not, for example? | Can valgrind print value of used uninitialized memory location, say, | something along the suggested manner below? | I use the above example: | ==20163== Conditional jump or move depends on uninitialised value(s) | ==20163== The value used was: 0xdeadbeaf (4 bytes) | ==20163== at 0x90974BC: nsJSObjWrapper::NP_SetProperty(NPObject*, | void*, _NPVariant const*) (nsJSNPRuntime.cpp:137) | ... | or maybe considering the possibility of byte block: | ==20163== Conditional jump or move depends on uninitialised value(s) | ==20163== The value used started with 0xde 0xad 0xbe 0xaf 0xaa 0xbb | 0xcc ... (up to the minimum of first N octets or the size of the | data, | maybe N can be 16 , etc.) | ==20163== at 0x90974BC: nsJSObjWrapper::NP_SetProperty(NPObject*, | void*, _NPVariant const*) (nsJSNPRuntime.cpp:137) | I believe this simple addition makes the detection very useful | because it would make creating the suggested patch easier by knowing | why a program that has been used so long had a hidden issue for so | many | years. | Thank you for sharing this great tool with the programming community. | Best Regards, | Chiaki Ishikawa | ------------------------------------------------------------------------------ | BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT | Develop your own process in accordance with the BPMN 2 standard | Learn Process modeling best practices with Bonita BPM through live | exercises | http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- | event?utm_ | source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF | _______________________________________________ | Valgrind-users mailing list | Val...@li... | https://lists.sourceforge.net/lists/listinfo/valgrind-users |