hi, I got stucked when debug vsftpd

My work environment is Red Hat Linux 9.0, gdb is installed when I install the system, ( How can I find the version ? ). I downloaded the source code "VSFtpd" from "http://vsftpd.beasts.org", I failed to debug in child process with an error SIGSTOP.

Here comes the procedures :
1. Do some preparations :
edit code standalone.c::vsf_standalone_main() line 166 --- line 174;
Code:

......................
new_child = vsf_sysutil_fork_failok(); // create child process here
if (new_child != 0)
{
/* Parent context */
vsf_sysutil_close(new_client_sock);
if (new_child > 0)
{
hash_add_entry(s_p_pid_ip_hash, (void*)&new_child, p_raw_addr);
}
else
{
/* fork() failed, clear up! */
--s_children;
drop_ip_count(p_raw_addr);
} // line 166
/* Fall through to while() loop and accept() again */
wait(0); // Add this one to wait until the child process end ;
}
else
{
sleep(30);// Add sleep() to find out the process id and attach it by GDB ;
/* Child context */
vsf_sysutil_close(listen_sock);line 174
prepare_child(new_client_sock);
............................


After that theb make VSFtpd with -g option ;

2. Open a terminal, run gdb VSFtpd, then input "run" to put the server running .....
3. Open a new terminal, run "ftp localhost" to connect the server;
4. Find the child process id from terminal, then run "gdb program id" attempting to control the child process, set the breakpoint to standalone.c line 174 ( after the sleep() ), and input "return" to return the child process.

5. above seems work well . when I input "c" ( means continue [gdb command] ), then the parent process ended with a signal "SIGSTOP" which is out of our control.

The following is the details :


[terminal 1] running parent process:
[root@localhost sbin]# gdb vsftpd
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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 "i386-redhat-linux-gnu"...
(gdb) r
Starting program: /usr/local/sbin/vsftpd
[New Thread 1074592416 (LWP 4681)]

I add... wait the client to connect
When I input the "c" (continue) to run child process, the following message appear

Program received signal SIGSTOP, Stopped (signal).
[Switching to Thread 1074592416 (LWP 4681)]
0xffffe002 in ?? ()


[terminal 2] child process
[root@localhost sbin]# gdb program 4689
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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 "i386-redhat-linux-gnu"...program: No such file or directory.

Attaching to process 4689
Reading symbols from /usr/local/sbin/vsftpd...done.
Reading symbols from /lib/libpam.so.0...done.
Loaded symbols for /lib/libpam.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libutil.so.1...done.
Loaded symbols for /lib/libutil.so.1
Reading symbols from /lib/libcap.so.1...done.
Loaded symbols for /lib/libcap.so.1
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/tls/libpthread.so.0...done.
[New Thread 1074592416 (LWP 4681)]
Error while reading shared library symbols:
Can't attach LWP 4681: Operation not permitted
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xffffe002 in ?? ()
(gdb) b standalone.c:174
Breakpoint 1 at 0x8058572: file standalone.c, line 174.
(gdb) return
Make selected stack frame return now? (y or n) y

#0 0x0805856f in vsf_standalone_main () at standalone.c:172
172 sleep(30);
(gdb) n
Cannot find bounds of current function
(gdb) c
Continuing.
Couldn't get registers: No such process.


I googled the error "Couldn't get registers: No such process", somebody says it is a bug of GDB,
I am not sure, can you find any problem ?

Thank you !

wxuf