{"id":103,"date":"2011-03-24T14:58:42","date_gmt":"2011-03-24T13:58:42","guid":{"rendered":"http:\/\/blog.mozilla.org\/jseward\/?p=103"},"modified":"2011-03-24T14:58:42","modified_gmt":"2011-03-24T13:58:42","slug":"a-thread-checking-toolkit-for-firefox","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/jseward\/2011\/03\/24\/a-thread-checking-toolkit-for-firefox\/","title":{"rendered":"A thread-checking toolkit for Firefox"},"content":{"rendered":"<p>Back in January I blogged about <a href=\"http:\/\/blog.mozilla.org\/jseward\/2011\/01\/11\/finding-data-races-in-the-js-engine\">using Helgrind to check for threading errors in Firefox&#8217;s JS engine<\/a>.\u00a0 That effort was the first step towards a bigger goal, namely to find and remove all unintended data races in the browser proper.<\/p>\n<p>I have been wanting to get a point where our C++ developers can routinely use Helgrind to check for threading bugs in code, both new and old, in the same way that Valgrind&#8217;s Memcheck tool is now widely used to check for memory errors.\u00a0 For the reasons discussed in my January posting, race checking is more difficult than memory checking.\u00a0 Now, though, I believe we&#8217;re approaching the point where routine Helgrinding is feasible.<\/p>\n<p>I&#8217;d like to introduce what amounts to a kit for thread-checking Firefox.\u00a0 The main resource for this is at the MDC page &#8220;<a href=\"https:\/\/developer.mozilla.org\/en\/Debugging_Mozilla_with_Helgrind\">Debugging Mozilla with Helgrind<\/a>&#8220;.\u00a0 Here&#8217;s a summary.<\/p>\n<p>There&#8217;s three parts to the kit:<\/p>\n<ul>\n<li>A markup patch for the Mozilla code base.\u00a0 This describes to Helgrind the effect of some synchronisation events it doesn&#8217;t understand and stops it complaining about some harmless races in the JS engine.<\/li>\n<\/ul>\n<ul>\n<li>A suppression file that hides error reports in system libraries.<\/li>\n<\/ul>\n<ul>\n<li>A development version of Helgrind.\u00a0 This contains a bunch of correctness, diagnostic and scalability improvements.\u00a0 A stock Valgrind installation won&#8217;t work.<\/li>\n<\/ul>\n<p>With this framework in place, I completed a first run through Mochitests with Helgrind.\u00a0 It took 32 CPU hours.\u00a0 Around 15 bugs have been filed.\u00a0 Some of them are now fixed, and others have been declared harmless.\u00a0 But that&#8217;s just a beginning: there are many more uninvestigated reports lurking in the mochitests output.<\/p>\n<p>Have a look at the <a href=\"https:\/\/developer.mozilla.org\/en\/Debugging_Mozilla_with_Helgrind\">MDC page<\/a> for more details, including directions on how to get started.\u00a0 And, of course, if you want help with any of this, please feel free to contact me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in January I blogged about using Helgrind to check for threading errors in Firefox&#8217;s JS engine.\u00a0 That effort was the first step towards a bigger goal, namely to find and remove all unintended data races in the browser proper. &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/jseward\/2011\/03\/24\/a-thread-checking-toolkit-for-firefox\/\">Continue reading<\/a><\/p>\n","protected":false},"author":240,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts\/103"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}