4 Feb 2004 Spooky   » (Master)

Time for a rant: Patches to fix bugs are, in theory, a good idea. In practice there tends to be a problem.

A typical bug report for a segfault in a C program from a person with most of a clue looks is:

Program foo segfaults at line 123 because pointer y is NULL. Here is a patch.

The patch then invariably looks something like:

if (!y)
  return;

Inserted just before line 123.

This is wrong.

It doesn't fix the bug. The bug is not "the program segfaults", the bug is "y is NULL". Bug reports are good. Stack traces are good. Identifying the symptoms is good. Identifying the cause is excellent. Patches which fix a symptom rather than the cause are a menace to society.

Thank you for your attention, I'll go and take my pills now.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!