154 Comments
- sephiroth965, on 05/11/2008, -17/+234Unix ≠ BSD
- jiqiren, on 05/11/2008, -1/+209Hey! What is this? Real tech news on digg?!?!?!
;) - santaliqueur, on 05/11/2008, -6/+169Why dig out the character map to use ≠ when you could use != ? On a programming article, too.
- HappyScrappy, on 05/11/2008, -3/+105A friend of mine had to work around this issue over 10 years ago. It comes up when you try to delete all items in a directory. If you do "del *" (or the code equivalent) because that actually evaluates all items in the directory before deleting any of them (because of globbing in the shell case).
But if you try to do the straightforward case of iterating through all items in the directory, going to item 0, then deleting it, then going to item 1, then deleting it, you only end up deleting half the items in the directory. This is because finding item 1 returns item 2, since after deleting item 0, everything shifts down.
In the old method, where you opened the directory as a file and parsed the entries directly, you would hit all the items, since the file doesn't "shift down" as you delete entry 0. After deleting entry 0, there just no longer is no entry 0, but the next item is still item 1. If you make the straightforward code substitution of using readdir, etc. instead of reading directly, you create the delete every other file case above because of the new operation described.
I don't know how he made it work right, he told me so long ago I forgot what it was.
I'm not sure I agree with the "fix" above. It seems like more of a workaround for those who improperly translated their code to use readdir. The real fix would be to fix all those things that do what is described above to just repeatedly delete item 0 over and over instead of skipping forward. That's the proper way to delete all items (another way is to go in reverse order). - doctechnical, on 05/11/2008, -1/+93Because programmers would much rather write new code than go back and maintain old code.
- rockmanac, on 05/11/2008, -7/+80How was this allowed to exist for 25 years?
- cyssero, on 04/18/2009, -2/+51What is this, 2005 all over again!?
- santaliqueur, on 05/11/2008, -5/+49No big deal, you just demonstrated the difference between slashdot and Digg.
- doctechnical, on 05/11/2008, -1/+44I am a geek :) so I appreciate the story for it's geek factor, but for non-geeks you should appreciate the bigger story - this bug was well known (well, it's presence was well known) but rather than go to the effort of finding out what was wrong, everyone just programmed around it. Sort of like having a leak in the roof and just walking around the wet spot rather than repair it. For 25 years! Which is several geological ages in computer time.
What that says about the human condition I leave to your interpretation. - skywake, on 05/11/2008, -5/+42yes lets argue what way of saying not equals is cooler.....
- Protoss, on 05/11/2008, -1/+37Wow...I actually understood that explanation, thanks!
- santaliqueur, on 05/11/2008, -1/+29If I don't have a "¬" key, it's not simpler.
- jsebrech, on 05/11/2008, -0/+26It's just because all the non-geeks are not behind their screens. As soon as the weather worsens, we'll go back to videos of japanese people doing something weird and the latest "why obama will win" articles.
- wyrdness, on 05/11/2008, -6/+32You're really splitting hairs here. If 'Unix' is used in its generic sense, then BSD has *always* been Unix. If it's used in its precise trademarked sense, then some versions of BSD are also Unix.
BSD was always considered to be Unix when I first used it back in the 1980s. - inactive, on 05/11/2008, -3/+28You just did...thanks
- zadadka, on 05/11/2008, -7/+32A rare bug in a stable operating system is far better than vast numbers of bugs in a rarely stable operating system.
- picpak, on 05/11/2008, -2/+25Anyone else read Ballmer instead of Balmer?
- megagram, on 05/11/2008, -5/+30Maybe he was using a Mac? Option (alt) key plus = key yields ≠. No character map needed. Much cooler than != (unless, of course, you actually are a programmer).
- kamisama, on 05/11/2008, -0/+22It's not a bug, it's a feature.
- santaliqueur, on 05/11/2008, -15/+36Must everything be anti-Apple?
By the way, Windows is the king of bugs. Even the trolls know that. - trogdoor, on 05/11/2008, -2/+21I seem to be able to reproduce this bug on OpenBSD on UFS but not OpenBSD on ext2 or Tiger running on HFS+ ( the default file system for OSX )
- PathDaemon, on 05/11/2008, -3/+20My sarcasm detector, it's not giving a clear reading!!
- headzoo, on 05/11/2008, -5/+23Any source code comment (or docs) that starts with "This code will not work as expected when" should probably be rewritten sooner rather than later. Specially not 25 years later.
- Eddible, on 05/11/2008, -0/+17MADNESS!
- kennu, on 05/11/2008, -5/+18Silly to put UNIX in the submission title, when even the original title clearly stated it was a *BSD* bug.
- archlich, on 05/11/2008, -1/+15PC Load Letter, the fsck does that mean?
- GreenAlien, on 05/11/2008, -0/+13It doesnt mean the same thing. "¬A" means "not A" and "A != B" means "A is not equal to B". In programming "¬A" would be the same as "!A".
- gurellia53, on 05/11/2008, -3/+15But this is digg. I'm surprised that this wasn't titled "The 25 Year Old Ubuntu Bug"
- inactive, on 05/11/2008, -7/+19it was a virtual Moth...
- doctechnical, on 05/11/2008, -4/+17Because it was open source, someone was able to fix the bug, eventually. You have no such opportunity with closed source. There might be a hundred bugs older than this running around in the DOS code that's still in Windows. How would we ever know?
- zeptobyte, on 05/11/2008, -0/+11This little bug's fix was *actually fairly trivial* (as is common with these sorts of long-standing bugs):
"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()."
O.o - ferggo, on 05/11/2008, -0/+11"Code wants to be wrong" -Steve Gibson
- Skooma714, on 05/11/2008, -3/+13lol BSD is buggy switch to Windows.
- inactive, on 05/11/2008, -0/+9yeah as many have commented it seems the original posted doesnt know the difference between unix and bsd, which is a fork of unix that happened long long ago. Regardless of this, they werent the only one that had the same fundamental problem of skipping things, coherent (pc based unix available in the 80s) had a similar problem with ksh where it would skip over entries.
I wonder if this affects the unix subsystem microsoft has which is based in part on BSD code. Microsoft basically bought up the company that made it and made it free instead of you having to pay for it. They then bundled in some extra stuff like the ability to print to BSD printers (lpr) and the ability to mount NFS drives. Unfortunately they kinda stopped doing work on this at about that time as well. Interix is different from and in some ways better than cygwin since its not a sandbox. But anyway, it may have the same issues and due to its relative obscurity (most people dont know about all the free addons that MS has) its probably overlooked in things like this. - sexybobo, on 05/11/2008, -5/+13Sounded like it had an easy work around that made it not cause any problems.
If it works don't fix it? - allah6464, on 05/11/2008, -0/+8I love how the submitter copy-and-pasted the title and first sentence from the article... then replaced both instances of "BSD" with "UNIX".
- HappyScrappy, on 05/11/2008, -1/+9Whoops, I kinda muffed that. In the first paragraph, I meant to say it doesn't come up in the "del *" case. Because you make a list of items and delete them by name. The case I describe below which uses the iterative case is the one where it can come up if you wrote your code wrong.
- aladrin, on 05/11/2008, -2/+10So this was a security risk how?
- inactive, on 05/11/2008, -0/+9BSD = Unix
BSD != UNIX ® - frazw, on 05/11/2008, -0/+8Normally I wouldn't bother with this but in this case the implication is that anything derived from UNIX has the bug whereas it is only the BSD family that has it. At least that's what I understood from the article. Therefore it is more appropriate here to be more specific.
- dudeguy1234, on 05/11/2008, -0/+7Operating system A is used by 5 people and has 10 bugs. Operating system B is used by 5,000 people and has 5 bugs. If Operating System A grows to 10,000 users, it will still have 10 bugs. If Operating system B sinks to 10 users, it will still have 5 bugs. Number of users != Number of bugs
- FKnight, on 05/11/2008, -3/+13Linux: UNIX for Teens.
- alex4u2nv, on 05/11/2008, -1/+8However, BSD could be UNIX based on it's heritage, and based on whether or not its current distro adheres to the UNIX standards. See here: http://www.unix.org/.
OSX is certified UNIX. - santaliqueur, on 05/11/2008, -3/+12Nice try on the twist. The funny thing is, for 1 user or 1 million, it still has more bugs. That number is user-independent.
- ToadLeg, on 05/11/2008, -6/+13Maybe it's because it was told as a story and didn't really say anything about the bug. What systems does it effect, and are there any that it has already been fixed on (has it been imported to/fixed on Linux or other Unix derivatives)? What exactly do you have to do to reproduce the bug, and what happens?
- eanbowman, on 05/11/2008, -0/+7Okay, so the act of working around this bug is called a kludge.
Kludges have always existed - mostly because someone else owns the code and you'd rather not muck with it lest other versions of the code make your code unusable. Even if you fixed this bug and released the source - that could mean that millions of other programs need to be changed because they rely on the incorrect behaviour instead of the correct behaviour.
For the Apple detractors - Apple isn't responsible for BSDs and as another member noted - he was unable to reproduce the bug in Darwin. You're being r-tards ;D (FTL?)
Have you ever programmed for the Windows API? Kludge is the name of the game. So is inconsistency, bloat and sheer madness. Probably the main reason for bugs in Windows is that when developers expect a piece of code to work in a certain way - there's next to no guarantee that it will. :P
That and not cleaning up the garbage... d'oh! :3 - aladrin, on 05/11/2008, -2/+8In an ideal world, that's true. But then, it just should have been written to work 'as expected' in the first place... And probably would have been, if it could. (Probably.)
- irgeorge, on 05/11/2008, -4/+10using ≠ != really cooler than !=
- rusty0101, on 05/11/2008, -0/+7Since the bug is over 18 years old, it's coming out party is news. The parents usually aim for 16...
- tian2992, on 05/11/2008, -0/+5GNU/Hurd
For the Hippie in you! -
Show 51 - 100 of 154 discussions




What is Digg?