chrome-bisect

Chrome Bisect

Chrome Bisect is a packaging of the bisect-builds.py tool. It’s goal is to make it easy for IT admins to determine when Chrome browser began behaving differently and why it did so (deprecation, regression bug, etc).

Build Chrome Bisect Script

Quick Start

Download the latest release for your OS, extract it and run chrome_bisect.

Running Chrome Bisect

You need to know a few things before you run Chrome Bisect effectively:

Once you know these details, go ahead and run Chrome Bisect. Use chrome-bisect --help to understand all the proper arguments. Here’s a sample command:

chrome_bisect --good M85 --bad M90 -- https://www.google.com/

# An example Chrome Bisect You own the site batstat.jaylee.us, a website that shows users their current device battery status. After Chrome browser version 103 was released some users started reporting that battery status failed with a Chrome API error and you’re not sure why it’s failing. Let’s run a bisect to understand exactly when between Chrome 102 and 103 it started failing and what the reason might be:

  1. Run Chrome Bisect:
chrome_bisect --good M102 --bad M103 -- http://batstat.jaylee.us:80/
  1. The tool will start downloading Chromium builds. If the Chromium build launches and a green “GOOD” page loads with battery information, exit Chromium and mark the version as “g” GOOD. If a red page loads with BAD and complains of an API error, exit Chromium and mark the version as “b” BAD.
  2. The tool will need to download and run about a dozen builds to narrow the build range as tightly as possible. Keep marking builds as good or bad based on the page it shows until the tool finishes. Be careful here, marking one build wrong will cause the whole bisect to fail and show invalid results.
  3. Once the tool is finished with builds, it will tell you the exact builds between good and bad behavior. It also gives you a link to the changes that were made to Chromium browser between the last good and first bad build.
  4. Open the changelog page and look through the list. (hint: here’s the changelog you should get.)
    • Can you tell which exact change in the list caused the site to stop loading? (hint, search the list of changes for “battery”)
    • Why was that change made?
    • What might you need to do to fix your site? (hint, notice how HTTPS://batstat.jaylee.us works in newer Chrome versions but HTTP://batstat.jaylee.us only works in Chrome 102 and earlier)
  5. For reference, here’s the full output of an example run:
Expand for full command output $ ./chrome_bisect --good M102 --bad M103 -- http://batstat.jaylee.us:80/ running bisect-builds.py with options: --good 992738 --bad M103 --verify-range --use-local-cache --archive linux64 -- http://batstat.jaylee.us:80/ Scanning from 992738 to 1002911 (10173 revisions). Downloading list of known revisions... Loaded revisions 41523-1118151 from /home/jayhlee/cb/chrome_bisect/.bisect-builds-cache.json Downloading revision 992740... Received 154342263 of 154342263 bytes, 100.00% Trying revision 992740... Revision 992740 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 1002910... Trying revision 1002910... Revision 1002910 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: b Downloading revision 998107... Bisecting range [992740 (good), 1002910 (bad)], roughly 11 steps left. Trying revision 998107... Revision 998107 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: b Downloading revision 995067... Received 154537868 of 154537868 bytes, 100.00% Bisecting range [992740 (good), 998107 (bad)], roughly 10 steps left. Trying revision 995067... Revision 995067 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 996538... Received 154807698 of 154807698 bytes, 100.00% Bisecting range [995067 (good), 998107 (bad)], roughly 9 steps left. Trying revision 996538... Revision 996538 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997440... Received 154925953 of 154925953 bytes, 100.00% Bisecting range [996538 (good), 998107 (bad)], roughly 8 steps left. Trying revision 997440... Revision 997440 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997790... Received 155344479 of 155344479 bytes, 100.00% Bisecting range [997440 (good), 998107 (bad)], roughly 7 steps left. Trying revision 997790... Revision 997790 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: b Downloading revision 997598... Received 154954643 of 154954643 bytes, 100.00% Bisecting range [997440 (good), 997790 (bad)], roughly 6 steps left. Trying revision 997598... Revision 997598 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997664... Received 154954126 of 154954126 bytes, 100.00% Bisecting range [997598 (good), 997790 (bad)], roughly 5 steps left. Trying revision 997664... Revision 997664 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997718... Received 154953295 of 154953295 bytes, 100.00% Bisecting range [997664 (good), 997790 (bad)], roughly 4 steps left. Trying revision 997718... Revision 997718 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997744... Received 154955563 of 154955563 bytes, 100.00% Bisecting range [997718 (good), 997790 (bad)], roughly 4 steps left. Trying revision 997744... Revision 997744 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g Downloading revision 997775... Received 155344747 of 155344747 bytes, 100.00% Bisecting range [997744 (good), 997790 (bad)], roughly 3 steps left. Trying revision 997775... Revision 997775 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: b Downloading revision 997757... Received 155345317 of 155345317 bytes, 100.00% Bisecting range [997744 (good), 997775 (bad)], roughly 2 steps left. Trying revision 997757... Revision 997757 is [(g)ood/(b)ad/(r)etry/(u)nknown/(s)tdout/(q)uit]: g You are probably looking for a change made after 997757 (known good), but no later than 997775 (first known bad). CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/03e9c2b23047e8bc7cdbbd5843b52112817ed1d6..53d540703b72faa87436f51279043c094939418f

Known Limitations

As mentioned above, Chrome Bisect has a few limitations that you should be aware of: