mag
12Il baco 25enne
Filed Under (Blog) by Zarathustra3M on 12-05-2008
Tagged Under : BSD, Bug, Informatica, Storia, Tecnologia, Unix
Il 1983 è un anno importante per l’informatica moderna.
E’ l’anno del IBM PC XT, del Apple Lisa; è l’anno in cui il Pioneer 10 è uscito dal Sistema Solare. Ed è anche l’anno di nascita del più vecchio baco del mondo BSD (ma non solo), corretto solo pochi giorni fa.
Tutto ebbe inizio con un mail inviata, alcuni giorni fa, a Marc Balmer, uno sviluppatore OpenBSD, da parte di un utente OpenBSD. Nella mail, l’utente segnalava dei crash di SAMBA mentre venivano serviti alcuni client MS-DOS. Dopo i primi test del caso, il problema è apparso su TUTTI i sistemi BSD.
La prima reazione di Marc Balmer è stata di segnalare il problema al Team di Samba, ma prima ha indagato un pò più in profondità il problema. Incredibilmente, il problema era presente in TUTTI i BSD, liberi e non, perfino in Mac OS X. Andando indietro nel tempo tra le release, ecco trovato il ‘paziente zero’. 4.2BSD, rilasciato nell’agosto del 1983. Queste le parole di Marc Balmer:
This code will not work as expected when seeking to the second entry of a block where the first has been deleted: seekdir() calls readdir() which happily skips the first entry (it has inode set to zero), and advance to the second entry. When the user now calls readdir() to read the directory entry to which he just seekdir()ed, he does not get the second entry but the third.
Marshall Kirk McKusick, autore originale della libreria *dir(), ha commentato:
As the original author of the *dir() library, you probably fixed one of my bugs :-). Prior to the *dir() commands, programs just opened, read, and interpreted directories directly. I had to update a shocking 22 programs (a large percentage of the programs available on UNIX at the time) to replace their direct interpretation of directories with the *dir() library calls.
La correzione è stata banale:
The fix is surprisingly simple, not to say trivial: _readdir_unlocked() must not skip directory entries with inode set to zero when it is called from __seekdir().
Sorry that it took us almost twenty-five years to fix it.
ha commentato Marc Balmer scherzando :) .
Articolo originale:
http://osnews.com/story/19731/The_25_Year_Old_BSD_Bug

