LWN: Comments on "Fully automated bisecting with "git bisect run"" https://lwn.net/Articles/317154/ This is a special feed containing comments posted to the individual LWN article titled "Fully automated bisecting with "git bisect run"". en-us Mon, 15 Sep 2025 09:29:06 +0000 Mon, 15 Sep 2025 09:29:06 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Fully automated bisecting with "git bisect run" https://lwn.net/Articles/767515/ https://lwn.net/Articles/767515/ bfields <div class="FormattedComment"> Seems to me that a lot of the dumb build bugs I've introduced over the years have required a particular combination of config options.<br> <p> This is a case where I should do more testing--a lot of those bugs would probably be caught by just a few extra builds that exercise some of the most commonly problematic combinations.<br> <p> But I'll never catch all of those just by doing enough builds. I mean, the kernel has thousands of build options. Combinatorics is against us.<br> </div> Wed, 03 Oct 2018 14:27:32 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/767514/ https://lwn.net/Articles/767514/ bfields <p>Completely agreed on the value of regression testing. We could always use more. But that will never catch every bug! <p>Take any random bug that's been discussed on lwn, say, I don't know, <a href="https://lwn.net/Articles/575460/">this mutex_unlock/free race</a> or <a href="https://lwn.net/Articles/304105/">the famous e1000e bug</a>. Without knowing about the bug ahead of time, what kind of testing would be guaranteed to catch one of those in a reasonable amount of time? <p>It's not impossible, but it's hard, and something will always slip through, absent some change more fundamental than just adding more regression tests. Wed, 03 Oct 2018 14:08:52 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/767500/ https://lwn.net/Articles/767500/ neilbrown <div class="FormattedComment"> <font class="QuotedText">&gt; Why would the kernel group allow code to be committed without running a clean build?</font><br> <p> Maybe someone started using a new compiler.<br> Or maybe I'm doing a git-bisect on my own private tree prior to submitting it. I just noticed a bug and now I want to find out where I introduced it, so I can fix and rebase.<br> <p> <font class="QuotedText">&gt; The point I was getting to here is that with build tests and regression tests, there would be little or no need for bisection, automated or manual. </font><br> <p> "Testing shows the presence, not the absence, of bugs". Still true 50 years after Dijksrta wrote it.<br> <p> </div> Wed, 03 Oct 2018 07:15:25 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/767497/ https://lwn.net/Articles/767497/ samiam95124 <div class="FormattedComment"> From my experience, the answer is "none of them and all of them". Let me explain.<br> <p> What VMs (and simulations) allow is the finding of "some bugs" related to hardware. The reason is simple. Hardware generates timing bugs. VMs and simulations do find some of those issues, but they also tend to model hardware in an overly simplified way that will not trip many of the most serious timing bugs. What they bring to the table, however, is important in another way, which is they are generally repeatable (this is not always true by the way). Just like a pseudo-random sequence, they can deliver the same bug over and over again. I think a lot of us have enough experience chasing hardware timing bugs to realize how valuable that is.<br> <p> Thus VM/Sim has a place, and that is usually first before you enter the "wild and woolly world" of hardware. The nice part is that typically matches hardware design flow, because sim is typically done before the hardware is available, especially in silicon/ic design world.<br> </div> Wed, 03 Oct 2018 01:37:27 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/767495/ https://lwn.net/Articles/767495/ samiam95124 <div class="FormattedComment"> My 2 cents:<br> <p> First, love the fact that this has been automated. I have been doing this procedure automatically for years (decades).<br> <p> However, this is a bit like closing the barn door after the horse has left. I was a bit shocked to find there is a procedure to find make errors *after they have been committed*??? Why would the kernel group allow code to be committed without running a clean build?<br> <p> Second, Linux is a pretty mature product these days. Your "clients" the hardware manufacturers, all run (or should all run) extensive regression tests. In fact, I don't think it is a tall order to submit regression tests along with drivers, which is not a requirement at the moment. Driver groups develop extensive regression tests, which Linux never sees, since they aren't upstreamed. So the drivers are open source, but their tests are secret?<br> <p> Finally, for the extensive kernel code running outside of driver land, this also needs regression testing.<br> <p> The point I was getting to here is that with build tests and regression tests, there would be little or no need for bisection, automated or manual. The reason build servers are popular now is to prevent make errors from reaching repositories. And it should be no different for functional errors, as well.<br> </div> Wed, 03 Oct 2018 01:28:34 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318632/ https://lwn.net/Articles/318632/ christian_couder The long usage message is: <pre> $ git bisect help Usage: git bisect [help|start|bad|good|skip|next|reset|visualize|replay|log|run] git bisect help print this long help message. git bisect start [&lt;bad&gt; [&lt;good&gt;...]] [--] [&lt;pathspec&gt;...] reset bisect state and start bisection. git bisect bad [&lt;rev&gt;] mark &lt;rev&gt; a known-bad revision. git bisect good [&lt;rev&gt;...] mark &lt;rev&gt;... known-good revisions. git bisect skip [(&lt;rev&gt;|&lt;range&gt;)...] mark &lt;rev&gt;... untestable revisions. git bisect next find next bisection to test and check it out. git bisect reset [&lt;branch&gt;] finish bisection search and go back to branch. git bisect visualize show bisect status in gitk. git bisect replay &lt;logfile&gt; replay bisection log. git bisect log show bisect log. git bisect run &lt;cmd&gt;... use &lt;cmd&gt;... to automatically bisect. Please use "git help bisect" to get the full man page. </pre> So you have to use "git bisect run &lt;cmd&gt;..." to automatically run the command you investigate. And if you don't want to automatically run the command, you can test by yourself at each step of the binary search and then use "git bisect good" or "git bisect bad" or "git bisect skip" depending on the result of your tests. Tue, 10 Feb 2009 04:41:38 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318597/ https://lwn.net/Articles/318597/ droundy <div class="FormattedComment"> I'd imagine that very few of the "hard" bugs could be found on a virtual machine, almost by definition. I'd think that a "hard" bug would be one that can't easily be reproduced by a kernel developer.<br> </div> Mon, 09 Feb 2009 18:19:22 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318523/ https://lwn.net/Articles/318523/ wfranzini <div class="FormattedComment"> I noticed only reading the article that 'git bisect' was unable to run the command being investigated.<br> <p> People interested in a workflow that includes tests can look at Aegis (<a href="http://aegis.sf.net/">http://aegis.sf.net/</a>). It also has an aebisect(1) command that run the command being investigated.<br> </div> Sun, 08 Feb 2009 16:06:48 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318482/ https://lwn.net/Articles/318482/ oak <div class="FormattedComment"> In general, how many of the kernel bugs need to be tested on real HW and <br> how many could be found in a virtual machine?<br> </div> Sat, 07 Feb 2009 18:19:39 +0000 Bisect on patchset boundaries ? https://lwn.net/Articles/318338/ https://lwn.net/Articles/318338/ lbt <div class="FormattedComment"> The "buggy intermediate versions" problem is one that I would have expected more attention to be drawn to. I've done a few bisects and had my filesystem fail to mount on several cuts during one run.<br> <p> A bisect that throws you into the middle of a patch set that messes with your filesystem is a dangerous place to be; especially when you ask 'normal' users to run a bisect on their everyday machines without warning them that they are potentially about to expose their data to random collections of code.<br> <p> The problem is that all patches are supposed to be non-toxic - and git is deliberately not good at revisionist history ;)<br> <p> That means that marking 'safe' bisect points is hard - but maybe a step in the right direction would be worth cutting on patchset boundaries?<br> <p> Or maybe an external (well, inside .git/) list of 'good' commits eg rc releases?<br> <p> Obviously this would make the bisect slightly less efficient but it may reduce the risk.<br> </div> Fri, 06 Feb 2009 10:33:11 +0000 Other similar tools https://lwn.net/Articles/318098/ https://lwn.net/Articles/318098/ epa <div class="FormattedComment"> 'git bisect' is a kind of delta debugging &lt;<a href="http://www.st.cs.uni-saarland.de/dd/">http://www.st.cs.uni-saarland.de/dd/</a>&gt;: where you have a broken version of the code and a known working version, and you find the change between them that introduces the bug. It's constrained to the version history in the repository, so it will find the guilty commit.<br> <p> An alternative is to randomly generate in-between files to find what difference causes the change. I believe DD.py &lt;<a href="http://www.st.cs.uni-saarland.de/dd/ddusage.php3">http://www.st.cs.uni-saarland.de/dd/ddusage.php3</a>&gt; is a tool for doing this.<br> <p> Finally, a plug for delta &lt;<a href="http://delta.tigris.org/">http://delta.tigris.org/</a>&gt; which isn't quite the same thing, but will automatically generate a minimal test case given a larger one.<br> </div> Thu, 05 Feb 2009 10:30:28 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318054/ https://lwn.net/Articles/318054/ dlang <div class="FormattedComment"> note that to cause problems the buggy intermediate versions need to be buggy in a way that your test script can't tell from the failure you are looking for.<br> <p> how big a problem this is depends on what your failure condition is.<br> <p> if you know that when it fails it generates message X then you just look for message X and mark everything else as 'good' (it may actually crash and not do anything useful, but it's not the bug you are looking for)<br> <p> if you are looking for a hang (or failure to boot like Ingo did in one example) then it's harder, you may end up going down the wrong path becouse some other bug is causing the problem (failing to boot in this example)<br> </div> Thu, 05 Feb 2009 07:44:55 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318038/ https://lwn.net/Articles/318038/ christian_couder <div class="FormattedComment"> Yes this is the idea.<br> <p> Exit code 125 tells "git bisect" to use "git bisect skip". "git bisect skip" marks the current commit as untestable and checks out another one nearby to be tested.<br> <p> See the "git bisect" documentation for more information:<br> <p> <a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html">http://www.kernel.org/pub/software/scm/git/docs/git-bisec...</a><br> </div> Thu, 05 Feb 2009 05:58:41 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318024/ https://lwn.net/Articles/318024/ dtlin <div class="FormattedComment"> The article did mention that exit code 125 signaled "skip this commit" -- if you have your git run script return that for known-toxic versions, that would do the trick. Or so it seems, from reading the article; I've never tried it myself.<br> </div> Thu, 05 Feb 2009 03:48:25 +0000 Fully automated bisecting with "git bisect run" https://lwn.net/Articles/318007/ https://lwn.net/Articles/318007/ ncm <div class="FormattedComment"> Perhaps I am showing my ignorance here, but doesn't this require that buggy intermediate versions of the code be scrubbed out of the repository, so that the bisection may choose any random intermediate version? Or must known-toxic versions labeled to deflect bisect from choosing them? <br> </div> Thu, 05 Feb 2009 02:13:33 +0000