Return to Video

Favorite Bug Stories - Software Debugging

  • 0:00 - 0:07
    Some of my very favorite bug stories of all time are related to the F-16 fighter plane.
  • 0:07 - 0:12
    It turns out that when the F-16 was conceived,
  • 0:12 - 0:16
    it had a very interesting feature.
  • 0:16 - 0:23
    Whenever it would fly and fly and cross the Equator,
  • 0:23 - 0:29
    the plane would instantly flip on its backside and keep on flying.
  • 0:29 - 0:34
    This, fortunately, only happened in simulation.
  • 0:34 - 0:37
    But imagine what would have happened in real life.
  • 0:37 - 0:42
    Well, the F-16 can actually fly on its back for hours and hours.
  • 0:42 - 0:48
    It turns out that this was a signage bug in the navigation system.
  • 0:48 - 0:51
    Picture what would have happened if this navigation system
  • 0:51 - 0:55
    had been used for commercial airlines.
  • 0:55 - 1:03
    If you see the Fasten Seat Belt sign, yes, be sure to keep your seat belt on at all times.
  • 1:03 - 1:10
    Another nice bug story is related to Google's Android operating system for mobile phones.
  • 1:10 - 1:15
    One of the first versions of Android had a diagnostic mode turned on
  • 1:15 - 1:22
    where an engineer would be able to use the serial port to enter arbitrary UNIX commands.
  • 1:22 - 1:29
    Interestingly enough, if the phone would not detect a device on the serial port,
  • 1:29 - 1:33
    it would fall back to the built-in keyboard instead.
  • 1:33 - 1:38
    What this meant was that anything you entered on the keyboard
  • 1:38 - 1:42
    was also interpreted as a UNIX command.
  • 1:42 - 1:48
    This was discovered when somebody got an SMS asking him, "What did you do all day?"
  • 1:48 - 1:51
    and he answered, "Reboot."
  • 1:51 - 1:57
    And lo and behold, with this command the phone rebooted.
  • 1:57 - 2:01
    Picture this: Anything you say is interpreted as a UNIX command.
  • 2:01 - 2:07
    He could also have said, "Remove files," or "Drop database," or whatever.
  • 2:07 - 2:11
    This was very, very quickly fixed.
  • 2:11 - 2:15
    Here's another really mysterious bug.
  • 2:15 - 2:19
    I had a program and the program crashed.
  • 2:19 - 2:21
    So far, so good.
  • 2:21 - 2:25
    So I inserted a print statement in order to figure out what was going on.
  • 2:25 - 2:32
    To my big amazement, after I inserted the print statement, the bug was gone.
  • 2:32 - 2:34
    Classical Heisenberg.
  • 2:34 - 2:39
    What was even better, I removed the print statement again
  • 2:39 - 2:42
    and the bug still was gone.
  • 2:42 - 2:45
    Now, that's an interesting way to fix bugs.
  • 2:45 - 2:48
    What was going on there?
  • 2:48 - 2:52
    It turned out this was a problem in the linker.
  • 2:52 - 2:54
    The linker had 2 modes.
  • 2:54 - 2:59
    It had an incremental mode in which you would simply link in changes,
  • 2:59 - 3:04
    and it had a non-incremental mode where it would start linking from scratch.
  • 3:04 - 3:09
    And if I made a small change to the program, it would go into the incremental mode.
  • 3:09 - 3:13
    In the incremental mode the bug was not triggered.
  • 3:13 - 3:18
    So this is why in the first attempt, in the non-incremental mode, the bug came to be
  • 3:18 - 3:24
    and later, in the incremental mode, the bug was turned off again.
  • 3:24 - 3:29
    But this was hard to work around.
  • 3:29 - 3:35
    Essentially, what I did was I made a comment in the build script
  • 3:35 - 3:38
    that would trigger the incremental mode by simply linking twice.
  • 3:38 - 3:40
    And this is how we worked around the bug.
Tytuł:
Favorite Bug Stories - Software Debugging
Video Language:
English
Team:
Udacity
Projekt:
CS259 - Software Debugging
Duration:
03:42
Udacity Robot edited angielski subtitles for Favorite Bug Stories - Software Debugging
Fran Ontanaya edited angielski subtitles for Favorite Bug Stories - Software Debugging
Amara Bot added a translation

English subtitles

Revisions Compare revisions