33-Year-Old Unix Bug Fixed In OpenBSD
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."
I bet you they're not talking about the system stack pointer. Remember, yacc is a parser generator; parsing algorithms always use some sort of stack data structure. So, the "stack pointer" in question is just a plain old pointer, pointing into a stack that yacc's generated code uses.
Are you adequate?
While I'm sure you're trolling, I feel I should point out that, 1) I agree with you, and 2) this has apparently been fixed, on Linux:
http://agnimidhun.blogspot.com/2007/08/vi-editor-causes-brain-damage-ha-ha-ha.html
Sit, Ubuntu, sit. Good dog.
Yes. But OpenBSD fixed it, so they get credit for the fix. It's up to the maintainers of the other unix(ish) versions to implement the fix.
For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
Now, looking at it just as a bug, if the yacc script overflowed the buffer, yacc can either stop cleanly or crash untidily. It has the same effect - nothing much happens - unless, for some weird reason, the kernel holds onto the memory. That would be a kernel bug, though, the yacc bug would merely be a catalyst for exposing it.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Instead of "ls a*"? Seriously? Hopefully, someone will mod you funny.
Unix has extremely low overhead spawning processes. If you prelink and have a little cache this is plenty fast :P
Seriously though, this is a serious annoyance in the way Unix does business. Shell globbing is very convenient for programmers, but not so convenient for users in an awful lot of situations.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
yacc is not a compiler,
Excuse me?
Yet Another Compiler Compiler most definitely is a compiler.
How we know is more important than what we know.
if you want ls -l style output, "find -name 'a*' -exec ls -l {} \;"
Yeah, because nothing endears you with the greybeards like racing through the process table as fast as possible. Use something more sane like:
which only spawns a new process every few thousand entries or so.
Dewey, what part of this looks like authorities should be involved?
It's both. The kernel is responsible for setting up the execution environment, and in the past it used a fixed 32 pages for the arguments. 32 pages on an ordinary PC is 128KiB, which is the old limit. The new limit is that any one argument can be up to 32 pages, and all the arguments taken together can be 0x7FFFFFFF bytes, which is ~2GiB.
Here's the diff: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b6a2fea39318e43fee84fa7b0b90d68bed92d2ba;hp=bdf4c48af20a3b0f01671799ace345e3d49576da
After that, it was up to libc people to fix the globbing routines. Ulrich Drepper, taking some time off from his full-time job of being an asshole on mailing lists, managed to work this into glibc 2.8:
http://sourceware.org/ml/libc-alpha/2008-04/msg00050.html
OpenBSD still uses GCC, version 3.3.5 on i386. I can't say which version is used on the other platforms.
You are talking of PCC, which is being worked on by some of the OpenBSD developers, but I think its a parallel project, see http://pcc.ludd.ltu.se/
for more information.
Jem Matzen talked of this too, see http://www.thejemreport.com/mambo/content/view/369/
On modern systems, find -name 'a*' -exec ls -l {} +
Personally, however, I prefer find -name a\* -exec ls -l {} +
Also, you probably want to add a -type f before the -exec, unless you also want to list directories.
Either that, or make the command ls -ld to not list the contents of directories.
tar tf archive.tar | while read FILENAME ; do
rm "$FILENAME"
done
Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
Jesus F Christ people, did you just list 50 different ways of enumerating the files in a directory, all of them using a single platform (Linux + bash), all of them riddled with bugs due to whitespace, other special characters the shell might interpret, plus Unicode where applicable - and none of you considers there might be some issue with it?