Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Bug's Life: What if `select` is Broken After ...

A Bug's Life: What if `select` is Broken After All?

Your project's issue list lies dormant for months, years even. Users seem happy enough, and you've got other priorities. Suddenly, a flurry of users report a crazy-sounding bug. They're seeing a crash, triggered with specific keystrokes, with a common operating system. You can't reproduce it. What in the world?!

You may have heard the debugging tip from the fantastic book Pragmatic Programmer, "select isn't broken". It's always best to assume that bugs are in *your* code. But... what if this one isn't?

In this talk, you'll re-experience this unusual low-level bug, and take away some lessons for the kinds of debugging we need to do all the time as software developers.

Colin Jones

August 23, 2019
Tweet

More Decks by Colin Jones

Other Decks in Programming

Transcript

  1. A Bug's Life What If select Is Broken After All?

    8th Light, Inc. Colin Jones @trptcolin https://8thlight.com
  2. Addressed pain points • Readline bindings in JLine (v1) were

    lacking • CTRL-C killed the whole REPL • Tab completion didn’t exist
  3. IOException Recurso temporariamente indisponível java.io.FileInputStream.readBytes (FileInputStream.java:-2) java.io.FileInputStream.read (FileInputStream.java:255) java.io.BufferedInputStream.fill (BufferedInputStream.java:246)

    java.io.BufferedInputStream.read (BufferedInputStream.java:265) jline.internal.NonBlockingInputStream.run (NonBlockingInputStream.java:294) java.lang.Thread.run (Thread.java:748) Bye for now!
  4. “Ubuntu has recently pushed what appears to be a bad

    kernel update to Ubuntu 18.04 users.”
  5. “After lots of debugging and some brief discussion on the

    LKML, it appears that this is the result of a bug introduced in Linux on 1 November 2018, and fixed on 9 January 2019.”
  6. Tip: Use search • Use rare words • Use rare

    combinations of words • Use rare phrases
  7. “ Broadly prior to the introduction of this bug (i.e

    for the last 5 years), the program would echo back console input (once enter is pressed), as expected.”
  8. “I have attached to this email a very short c

    program, which I believe shows the issue.”
  9. What now?! “Not sure if it’s worth trying to build

    / release a workaround - update your kernels if this affects you?”
  10. Recommended resources • Book by David Thomas & Andrew Hunt:

    The Pragmatic Programmer • Talk by Stuart Halloway: “Debugging with the Scientific Method” • Blog by Julia Evans: “What does debugging a program look like?” @trptcolin
  11. Recommended resources • Leiningen report: https://github.com/technomancy/leiningen/issues/ 2533 • Spigot (Minecraft

    server) forum: https://www.spigotmc.org/threads/ ubuntu-18-04-bad-kernel-update.357871/ • Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/ linux/+bug/1813873 • linux-console bug report: https://marc.info/?l=linux- console&m=154883021430618&w=2 About this bug @trptcolin