bug-bisect.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Bisecting a bug
  2. +++++++++++++++
  3. Last updated: 28 October 2016
  4. Introduction
  5. ============
  6. Always try the latest kernel from kernel.org and build from source. If you are
  7. not confident in doing that please report the bug to your distribution vendor
  8. instead of to a kernel developer.
  9. Finding bugs is not always easy. Have a go though. If you can't find it don't
  10. give up. Report as much as you have found to the relevant maintainer. See
  11. MAINTAINERS for who that is for the subsystem you have worked on.
  12. Before you submit a bug report read
  13. :ref:`Documentation/admin-guide/reporting-bugs.rst <reportingbugs>`.
  14. Devices not appearing
  15. =====================
  16. Often this is caused by udev/systemd. Check that first before blaming it
  17. on the kernel.
  18. Finding patch that caused a bug
  19. ===============================
  20. Using the provided tools with ``git`` makes finding bugs easy provided the bug
  21. is reproducible.
  22. Steps to do it:
  23. - build the Kernel from its git source
  24. - start bisect with [#f1]_::
  25. $ git bisect start
  26. - mark the broken changeset with::
  27. $ git bisect bad [commit]
  28. - mark a changeset where the code is known to work with::
  29. $ git bisect good [commit]
  30. - rebuild the Kernel and test
  31. - interact with git bisect by using either::
  32. $ git bisect good
  33. or::
  34. $ git bisect bad
  35. depending if the bug happened on the changeset you're testing
  36. - After some interactions, git bisect will give you the changeset that
  37. likely caused the bug.
  38. - For example, if you know that the current version is bad, and version
  39. 4.8 is good, you could do::
  40. $ git bisect start
  41. $ git bisect bad # Current version is bad
  42. $ git bisect good v4.8
  43. .. [#f1] You can, optionally, provide both good and bad arguments at git
  44. start with ``git bisect start [BAD] [GOOD]``
  45. For further references, please read:
  46. - The man page for ``git-bisect``
  47. - `Fighting regressions with git bisect <https://www.kernel.org/pub/software/scm/git/docs/git-bisect-lk2009.html>`_
  48. - `Fully automated bisecting with "git bisect run" <https://lwn.net/Articles/317154>`_
  49. - `Using Git bisect to figure out when brokenness was introduced <http://webchick.net/node/99>`_