Slashdot Log In
The 25-Year-Old BSD Bug
Posted by
Soulskill
on Sun May 11, 2008 11:05 AM
from the better-late-than-never dept.
from the better-late-than-never dept.
sproketboy writes with news that a developer named Marc Balmer has recently fixed a bug in a bit of BSD code which is roughly 25 years old. In addition to the OSnews summary, you can read Balmer's comments and a technical description of the bug.
"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. Much to my surprise I not only found this problem in all other BSDs or BSD derived systems like Mac OS X, but also in very old BSD versions. I first checked 4.4BSD Lite 2, and Otto confirmed it is also in 4.2BSD. The bug has been around for roughly 25 years or more."
Related Stories
[+]
BSD: 33-Year-Old Unix Bug Fixed In OpenBSD 162 comments
Ste sends along the cheery little story of Otto Moerbeek, one of the OpenBSD developers, who recently found and fixed a 33-year-old buffer overflow bug in Yacc. "But if the stack is at maximum size, this will overflow if an entry on the stack is larger than the 16 bytes leeway my malloc allows. In the case of of C++ it is 24 bytes, so a SEGV occurred. Funny thing is that I traced this back to Sixth Edition UNIX, released in 1975."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
more proof (Score:5, Funny)
the developers probably knew about it (Score:5, Funny)
See? SEE? (Score:5, Funny)
This is the power of Open Source!
With all those eyes looking at the code, stuff like this gets ID'd and fixed LICKITY SPLIT!
(runs and hides)
Re:See? SEE? (Score:5, Insightful)
In comparison, Microsoft has been around for what... 20 years? And who knows what bugs in Windows are there, lurking, just waiting to bite us?
Parent
Re:Old Code (Score:5, Informative)
Only 4 years ago.
Parent
Trac (Score:5, Funny)
Samba knew, but didn't pass it on? (Score:5, Insightful)
Surely both the samba communities and the *BSD communities are active enough that this could have been passed on for further investigation by the *BSD crowd? (Sure, samba probably would still need a workaround, particularly given the long uptimes and widespread deployment of *BSDs)
I know nothing of the devs at Samba and *BSD, but seems a bit strange. Perhaps they did try..
Meanwhile, congrats to Marc on fixing a bug. One of the most touted benefits of open source (whatever your license) code.
--Q
Re:Samba knew, but didn't pass it on? (Score:5, Interesting)
Yes, Samba did pass on what it found and it appears they were promptly shot down by someone on the *BSD side.
The Samba e-mail archives contain a message from over 3 years ago [samba.org], but it doesn't give attribution to the *BSD source.
The Samba Bugzilla also has a bug reported more recently [samba.org] involving the same issue. Reading through the bug history, you can see there was one FreeBSD dev involved in the bug discussion, and he referenced a prior conversation between Tridge (Samba) and PHK (FreeBSD) where PHK said there was no bug in FreeBSD.
Parent
BSD is Dying! (Score:5, Funny)
Should it be fixed? (Score:5, Insightful)
Re:Should it be fixed? (Score:5, Informative)
Parent
Long live the Code (Score:5, Interesting)
Re:Wait... Would you ever hit this? (Score:5, Funny)
Parent
Re:Wait... Would you ever hit this? (Score:5, Informative)
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
Parent
Re:Many eyes make bugs shallow... (Score:5, Interesting)
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
Parent
Re:Many eyes make bugs shallow... (Score:5, Informative)
This bug has been around for a long time, but is only visible if you have large directories and delete files from them in between calls to readdir and seekdir. This is quite uncommon behaviour, and was incredibly uncommon 25 years ago when filesystems were much smaller and directories almost never contained enough files to require more than one or two disk blocks to store the directory.
When the Samba people found it, they decided to just code a work-around and not bother to report it to any of the BSD teams. If they had done, it would probably have been fixed in 22 years.
Now that it has been fixed in OpenBSD, the change can easily be taken and incorporated into FreeBSD, NetBSD, DragonFlyBSD and Darwin.
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
A quick googling of "many eyes make all bugs shallow" brings me the more complete statement that adage is simplified from: "Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix will be obvious to someone." (Linus via ESR). Clearly this 25-year-old bug is one of the exceptions that calls for the 'almost'.
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
Well. Just reading the source is part of it, but not all.
Fact is, if I run into odd behaviour when testing/using - if the source is available I can read it, I can breakpoint.
I cannot do that with a binary.
So yes. Things did occur as they were supposed to. Someone found something odd, they were able to look at code in question, and fix it.
The shallowness is the fact that there is a direct connection between the thousands of testers/users and the code in question.
Instant turnaround. No "user reports behaviour in detailed fashion, including testcase, to some corporate e-mail address, and maybe it eventually gets a to a developer three layers down who may be able to figure it out and fix it if he has the time"
Parent
Re:Many eyes make bugs shallow... (Score:5, Insightful)
Parent
Re:They actually do... (Score:5, Insightful)
Parent
Re:Now it's time for a little housekeeping (Score:5, Informative)
Parent
bug blassification, side effects and Insults! (Score:5, Funny)
1. I think this bug would be classified "archeological".
2. The question now is what happens to the Samba work-around patches. Now that the bug is fixed, do the patches cause a side-effect (i.e. "a new bug")?
3. This gives rise to a new meme of nerd insults. "You call yourself a programmer? Why I've fixed bugs older than you!" Of course, only one man is entitled to use that line.
Parent