The 25-Year-Old BSD Bug

All topics about coding, designing, etc. goes in here.
Post Reply
User avatar
Ron2K
Forum Technical Administrator
Posts: 9050
Joined: 04 Jul 2006, 16:45
Location: Upper Hutt, New Zealand
Contact:

The 25-Year-Old BSD Bug

Post by Ron2K »

http://it.slashdot.org/it/08/05/11/1339228.shtml
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."
Makes you wonder if there's similar problems with other pieces of software (*cough* Microsoft)...

On a related note, I fixed a bug in one of my applications this morning that had been there ever since I wrote the app a year ago. Up until Saturday afternoon, it had gone undetected. :P
Kia kaha, Kia māia, Kia manawanui.
User avatar
hamin_aus
Forum Moderator
Posts: 18363
Joined: 28 Aug 2003, 02:00
Processor: Intel i7 3770K
Motherboard: GA-Z77X-UP4 TH
Graphics card: Galax GTX1080
Memory: 32GB G.Skill Ripjaws
Location: Where beer does flow and men chunder
Contact:

Re: The 25-Year-Old BSD Bug

Post by hamin_aus »

Ron2K wrote:Makes you wonder if there's similar problems with other pieces of software (*cough* Microsoft)...
Oh, well done dipstick!

You posted an article about a quarter-century old 'nix bug that nobody saw until now, and managed to get a dig at MS in there.
Thats sort of championship douchebaggery might have gotten you laid - if there were any girls who used BSD :P
Image
User avatar
Ron2K
Forum Technical Administrator
Posts: 9050
Joined: 04 Jul 2006, 16:45
Location: Upper Hutt, New Zealand
Contact:

Post by Ron2K »

LOL!

Reading the comments on that article, it appears that the Samba development team did encounter this bug a few years back - however, their course of action was to implement a workaround.

And to explain the reasons for my dig at Microsoft... in the open-source environment, someone who encounters a bug can look at the source, identify the bug, and notify the developers, possibly providing a patch as well. This isn't possible in a closed-source system because you don't have access to the source code. Additionally, because no-one can review the source code, what's to stop the relevant developers from just claiming that it's not a bug, or even worse, just ignore it entirely?

This is the main problem that I, as a developer, have with closed-source software. If I find issues with a third-party application or library, I have to implement some sort of workaround for the issue. Whereas, with the open-source libraries that I use, if I find issues, I can a) change their source code and b) notify their developers of the issue and tell them what I did to solve it so that it can be incorporated in a future release.

My dig at Microsoft was not intended for them alone, but for closed-source software in general.
Kia kaha, Kia māia, Kia manawanui.
Post Reply