{"id":16,"date":"2009-02-17T17:26:55","date_gmt":"2009-02-17T06:26:55","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=16"},"modified":"2009-03-17T16:26:52","modified_gmt":"2009-03-17T05:26:52","slug":"valgrind-mac-os-x-update-feb-17-2009","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2009\/02\/17\/valgrind-mac-os-x-update-feb-17-2009\/","title":{"rendered":"Valgrind + Mac OS X update (Feb 17, 2009)"},"content":{"rendered":"<p>It&#8217;s been a month since I first wrote about my work on the Mac OS X port of Valgrind.\u00a0 In that time I&#8217;ve made 85 commits to the DARWIN branch (and a similar number to the trunk).<\/p>\n<p>Here are the current (as of r9192) values of the metrics I <a href=\"http:\/\/blog.mozilla.org\/nnethercote\/2009\/01\/18\/me-valgrind-and-mac-os-x\/\">defined in the first post<\/a> as a means of tracking progress.<\/p>\n<ul>\n<li>The number of regression test failures on Linux was: 477 tests, 220 stderr failures, 53 stdout failures, 25 post failures (which I&#8217;ll abbreviate as<strong> 477\/220\/53\/25<\/strong>).  It&#8217;s now <strong>484\/4\/1\/0<\/strong>.\u00a0 I.e. the number of failures went from <strong>298<\/strong> to <strong>5<\/strong>.\u00a0 A few new tests have been added.\u00a0 Four of the failures are in Helgrind, the data race detector tool, which I haven&#8217;t tracked down yet.\u00a0 The other failure is one that also occurs on the trunk.\u00a0 So almost all the Linux functionality broken by the changes has been restored.<\/li>\n<li>The number of regression test failures on Mac was <strong>419\/293\/58\/29<\/strong>.\u00a0 It&#8217;s now <strong>402\/213\/52\/0<\/strong>.\u00a0 I.e. the number of failures went from <strong>380<\/strong> to <strong>265<\/strong>.\u00a0 The total number of tests has gone down because some Linux-specific tests are no longer being (inappropriately) run on Mac.\u00a0 This is the most important metric, and it&#8217;s improving steadily, but there&#8217;s still a long way to go.<\/li>\n<li>The number of compiler warnings on Linux was <strong>186<\/strong>.\u00a0 It&#8217;s now <strong>10<\/strong>, and all of these are from #warning declarations that mark places where improvement need to be made to the Darwin port, but aren&#8217;t actually a problem for Linux.\u00a0 The number of compiler warnings on Mac was <strong>461<\/strong>.\u00a0 It&#8217;s now <strong>44<\/strong>.\u00a0 Of these, 33 are from #warning declarations, and 10 are from code generated by the Darwin &#8216;mig&#8217; utility which I have no control over.\u00a0 So compiler warnings aren&#8217;t an issue any more, and I won&#8217;t bother tracking them as a metric in the future.<\/li>\n<li>The size of the diff between the trunk and the branch was <strong>55,852 lines (1.9MB)<\/strong>.\u00a0 It&#8217;s now <strong>41,895 lines (1.5MB)<\/strong>.\u00a0 But note that this is not a very useful metric;\u00a0 progress will usually cause it to drop, but it will also increase as missing Darwin functionality is added.<\/li>\n<\/ul>\n<p>Interestingly enough, although this number of Mac test failures has gone down significantly, if the branch didn&#8217;t handle your program a month ago it probably still won&#8217;t handle it now (although getsockopt() no longer causes an abort).\u00a0 But Valgrind&#8217;s output may well be better (e.g. debugging information will be better utilized).\u00a0 Much of my effort has been in making the tests pass &#8212; improving cases where the Darwin port was doing basically the right thing, but its output didn&#8217;t exactly match that expected.<\/p>\n<p>One example is that stack traces were a little unclean, in various minor ways.\u00a0 Another example is that I added a &#8211;ignore-fn option to Massif (the heap profiler) which allows it to ignore certain heap allocations.\u00a0 This was required because Darwin&#8217;s libc always does a few heap allocations at start-up, but Linux&#8217;s libc doesn&#8217;t.\u00a0 The new option allows the Darwin allocations to be ignored and therefore Massif&#8217;s output to be consistent on both platforms.<\/p>\n<p>Few if any of these changes have made the branch closer to handling new programs, at least directly.\u00a0 But there&#8217;s no point apologising about this, because the branch won&#8217;t reach a highly functional state without a working test suite to serve as a safety net against regressions.\u00a0 And as I progress, getting more tests to pass will require genuine new program functionality to be supported, so improvements should start to occur on that front soon.\u00a0 For example, signals currently aren&#8217;t supported at all, and this is why Firefox does not run under Valgrind on Mac yet &#8212; all calls to sigaction() currently return -1, which causes an assertion failure somewhere in NSPR.<\/p>\n<p>Something else worth mentioning:\u00a0 I bought a new MacBook Pro, as my old 32-bit only was was slow and noisy and getting annoying.\u00a0 The new machine is 64-bit capable, but compiles to 32-bit by default and Valgrind&#8217;s configure script identifies it as a 32-bit only machine.\u00a0 If anybody knows how to make configure recognise that it&#8217;s a 64-bit machine I&#8217;d love to hear about it.<\/p>\n<p><strong>Update, March 17:<\/strong> fixed a broken link to an earlier post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a month since I first wrote about my work on the Mac OS X port of Valgrind.\u00a0 In that time I&#8217;ve made 85 commits to the DARWIN branch (and a similar number to the trunk). Here are the current (as of r9192) values of the metrics I defined in the first post as [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487,484],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/16"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/users\/139"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}