meyerm@pegasus buffer $ gdb buggy
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run 123
Starting program: /home/meyerm/c/buffer/buggy 123
Cannot exec : No such file or directory.

Program exited with code 0177.
You can't do that without a process to debug.
(gdb)

That's real strange. Doing the same on SuSE works. There was a thread some time ago which stated, this is a permissions problem. And right, when I start gdb as root, it works.

But that can't be. I don't want to get root everytime I debug. I looked after suid but neither in gentoo nor in SuSE it is set. What else could it be? Any clues?

Thanks,
Marcel

BTW: Just to assure there are no "external execs" in my program, here it is (hey, it is just to test smashing the stack ):

sa@f ~ % gdb buggy
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run 123
Starting program: /home/sa/buggy 123
Alle zusammen: 123

Program exited normally.

may I suggest running "strace -o buggy_gdb.out gdb ./buggy"
then examining buggy_gdb.out for any clues.

ok it looks like your problem is happening with whatever vfork() runs.
try the following to make strace follow the vfork(),
"strace -v -F -ff -o foo gdb buggy"
this should create two files foo and foo.* try looking at foo.* and mabey compare it to strace ran as root. _hopefully_ this will tell you what is (or isnt) happening.

ok, I think I know what is wrong. I just tried running gdb after 'export SHELL=""' and I got the same error as you! try running `export SHELL=/bin/bash` and then running gdb, I think you can run chsh to fix it also.