Hi Martin, Thank you for your comment. I haven't have time to read the code carefully so bare with me. On Sat, Jan 6, 2018 at 5:21 PM, Martin Ågren <martin.agren@xxxxxxxxx> wrote: >> On Fri, Jan 5, 2018 at 11:45 AM, Yasushi SHOJI <yasushi.shoji@xxxxxxxxx> wrote: >>> When does the list allowed to contain NULLs? > > Short answer: there are no commits left to test. > > The list is built in the for-loop in `find_bisection()`. So the > technical answer is: if all commits in the initial list `commit_list` > are UNINTERESTING (including if `commit_list` is empty to begin with). > > It's also helpful to study where we should end up from there. We should > take the `if (!revs.commits)` branch in `bisect_next_all()`. That is, we > should print either "There are only 'skip'ped commits left to test. The > first bad commit could be any of:" or "<commit> was both good and bad". best_bisection_sorted() seems to do - get the commit list along with the number of elements in the list - walk the list one by one to check whether a element have TREESAME or not - if TREESAME, skip - if not, add it to array - sort the array by distance - put elements back to the list so, if you find TREESAME, you get less elements than given, right? Also, if you sort, the last commit, which has NULL in the ->next, might get in the middle of the array?? # BTW, is it really fast to use QSORT even if you have to convert to # an array from list? >>> Since nobody noticed it since 7c117184d7, it must be a rare case, right? > > Right, you marked a commit both good and bad. That's probably not very > common. But it obviously happens. :-) > > On 5 January 2018 at 06:28, Yasushi SHOJI <yasushi.shoji@xxxxxxxxx> wrote: >> OK, here is the step to reproduce on git.git > > Thank you for providing a script for reproducing this. It helped me come > up with the attached patch. The patch is based on ma/bisect-leakfix, > which includes Ævar's patch. > > I think this patch could be useful, either as a final "let's test > something previously non-tested; this would have caught the segfault", > or simply squashed into Ævar's patch as a "let's add a test that would > have caught this, and which also tests a previously non-tested code > path." Do we really need that? What is a practical use of a commit having both good and bad? Regards, -- yashi