<div dir="ltr"><br><div class="gmail_quote">On Tue, Jan 12, 2010 at 8:02 AM, Shachar Shemesh <span dir="ltr"><<a href="mailto:shachar@shemesh.biz">shachar@shemesh.biz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr" bgcolor="#ffffff" text="#000000"><div class="im">
Elazar Leibovich wrote:
<blockquote type="cite">
<div dir="ltr">I tried using valgrind in a different project. The
main problems I've had with valgrind are speed</div>
</blockquote></div>
Yes, that is known.<br>
<blockquote type="cite">
<div dir="ltr"> and false positives.</div>
</blockquote>
That one is new to me. Can you elaborate?</div></blockquote><div>IIRC the problem was using a different library, and tracing which problems are yours and which are of the library.</div><div>See for instance this rant <a href="http://www.mega-nerd.com/erikd/Blog/CodeHacking/house_of_cards.html">http://www.mega-nerd.com/erikd/Blog/CodeHacking/house_of_cards.html</a></div>
<div>I haven't really got into this, so maybe the suprresion files does allow you to quickly fix it.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr" bgcolor="#ffffff" text="#000000">
<div class="im"><br>
<blockquote type="cite">
<div dir="ltr">
<div>Getting gdb to report that during runtime has its advantages.</div>
<div>Anyhow, I was hoping to hear about products/valgrind add-ons etc
I do not know.</div>
<div><br>
<div>The main practical problem with it, is convincing management
that getting a linux box or VM and build the code on it is worth our
while...<br>
</div>
</div>
</div>
</blockquote></div>
Personally, I think that you should start with gcc. Just because it
spews out thousands of warnings does not mean they are not all
relevant. Compiler warnings are the easiest to fix, easiest to find,
and are often written off for no justifiable reason.<br></div></blockquote><div>It's more complex than that. The code currently work on the embedded device. This is a mission critical device, so we cannot make changes to the runtime code without testing it throughly first.</div>
<div>I try therefor to fix the problem in the emulation level without touching the actual code. (for instance, overriding a certain problematic function which used an uninitialized variable, and got away with it in the embedded device, but not in the desktop, or, replace the macro which stores a specific memory address (hex number) which is used by a the code, and is obviously relevant only for the embedded device)</div>
<div>Having a good runtime error checks (such as valgrind) will help me with recognizing this anomalities.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr" bgcolor="#ffffff" text="#000000">
<br>
I'm not sure at which version this started, but gcc 4.4.2 with -Wextra
catches your second example (array bounds problem).<br></div></blockquote><div>That surprising, more complex instances could be reducable to the halting problem (number of times we advance p might depend on any complex function). Didn't work for me. (Does it check that during runtime? perhaps it doesn't work with mingw).</div>
<div><br></div><div><div>Leibo@Leibo-PC ~</div><div>$ cat tmp.c</div><div>int main(int argc,char **argv) {</div><div> int x[10],y[10],i=0;</div><div> int *p = x;</div><div> for (;i<=13;i++,p++) *p = (*p)++;</div>
<div> return 0;</div><div>}</div><div><br></div><div><div>Leibo@Leibo-PC ~</div><div>$ /cygdrive/c/MinGW/bin/gcc.exe --version</div><div>gcc.exe (TDM-2 mingw32) 4.4.1</div><div>Copyright (C) 2009 Free Software Foundation, Inc.</div>
<div>This is free software; see the source for copying conditions. There is NO</div><div>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</div><div><br></div></div><div><br></div><div>Leibo@Leibo-PC ~</div>
<div>$ /cygdrive/c/MinGW/bin/gcc.exe -Wextra -Wall tmp.c</div><div>tmp.c: In function 'main':</div><div>tmp.c:2: warning: unused variable 'y'</div><div>tmp.c:1: warning: unused parameter 'argc'</div>
<div>tmp.c:1: warning: unused parameter 'argv'</div><div><br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr" bgcolor="#ffffff" text="#000000">
<br>
Shachar<br>
<pre cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a href="http://www.lingnu.com" target="_blank">http://www.lingnu.com</a>
</pre>
</div>
</blockquote></div><br></div>