【 在 atppp (Big Mouse) 的大作中提到: 】
: gdb> frame 3
: gdb> p currboard
# gdb /export/home0/bbs/bin/bbsd
GNU gdb 6.0
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-pc-solaris2.9"...
(gdb) attach 20707
Attaching to program `/export/home0/bbs/bin/bbsd', process 20707
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/local/lib/libz.so.1...done.
Loaded symbols for /usr/local/lib/libz.so.1
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/local/lib/libltdl.so.3...done.
Loaded symbols for /usr/local/lib/libltdl.so.3
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
sol-thread active.
Retry #1:
Retry #2:
Retry #3:
Retry #4:
[New LWP 1 ]
[New Thread 1 (LWP 1)]
Symbols already loaded for /usr/lib/libnsl.so.1
Symbols already loaded for /usr/lib/libsocket.so.1
Symbols already loaded for /usr/local/lib/libz.so.1
Symbols already loaded for /usr/lib/libpthread.so.1
Symbols already loaded for /usr/local/lib/libltdl.so.3
Symbols already loaded for /usr/lib/libdl.so.1
Symbols already loaded for /usr/lib/libc.so.1
Symbols already loaded for /usr/lib/libmp.so.2
Symbols already loaded for /usr/local/lib/libgcc_s.so.1
Symbols already loaded for /usr/lib/libthread.so.1
[Switching to Thread 1 (LWP 1)]
0xd118d26d in _poll () from /usr/lib/libc.so.1
(gdb) c
Continuing.
Program exited normally.
(gdb) bt
No stack.
(gdb) frame 3
No stack.
(gdb) p currboard
$1 = (struct boardheader *) 0x0
(gdb) quit
# ps -ef|grep bbs
bbs 20728 1 0 08:31:05 ? 0:00 bin/chatd
bbs 19630 1 0 23:26:08 ? 0:00 ./bbslogd
bbs 19633 1 0 23:26:13 ? 0:00 ./bbsd -p 23
root 20731 20704 0 08:32:48 pts/2 0:00 grep bbs
bbs 19618 19617 0 23:26:02 ? 0:00 ./miscd daemon
bbs 19616 1 0 23:26:02 ? 0:00 ./miscd daemon
bbs 19617 19616 0 23:26:02 ? 0:00 ./miscd daemon
bbs 20729 19633 0 08:32:35 ? 0:00 ./bbsd -p 23
bbs 19619 19618 0 23:26:02 ? 0:00 ./miscd daemon
-----------------掉线的GDB信息--------------------------------------------
# gdb /export/home0/bbs/bin/bbsd
GNU gdb 6.0
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-pc-solaris2.9"...
(gdb) attach 20729
Attaching to program `/export/home0/bbs/bin/bbsd', process 20729
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/local/lib/libz.so.1...done.
Loaded symbols for /usr/local/lib/libz.so.1
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/local/lib/libltdl.so.3...done.
Loaded symbols for /usr/local/lib/libltdl.so.3
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
sol-thread active.
Retry #1:
Retry #2:
Retry #3:
Retry #4:
[New LWP 1 ]
[New Thread 1 (LWP 1)]
Symbols already loaded for /usr/lib/libnsl.so.1
Symbols already loaded for /usr/lib/libsocket.so.1
Symbols already loaded for /usr/local/lib/libz.so.1
Symbols already loaded for /usr/lib/libpthread.so.1
Symbols already loaded for /usr/local/lib/libltdl.so.3
Symbols already loaded for /usr/lib/libdl.so.1
Symbols already loaded for /usr/lib/libc.so.1
Symbols already loaded for /usr/lib/libmp.so.2
Symbols already loaded for /usr/local/lib/libgcc_s.so.1
Symbols already loaded for /usr/lib/libthread.so.1
[Switching to Thread 1 (LWP 1)]
0xd118d26d in _poll () from /usr/lib/libc.so.1
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0xd117f6f4 in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0 0xd117f6f4 in strlen () from /usr/lib/libc.so.1
#1 0xd11b8640 in _doprnt () from /usr/lib/libc.so.1
#2 0xd11bb278 in sprintf () from /usr/lib/libc.so.1
#3 0x080cc393 in showtitle (title=0xd10a38f8 "系统维护选单",
mid=0x8047880 "KBS测试站") at newmain_single.c:1275
#4 0x080cc75e in docmdtitle (title=0xd10a38f8 "系统维护选单",
prompt=0x81014fd "目前选择:") at newmain_single.c:1392
#5 0x08087a30 in domenu_screen (dopm=0xd10a0f28,
cmdprompt=0x81014fd "目前选择:") at comm_lists.c:469
#6 0x080883de in domenu (menu_name=0xd10a20df "M_ADMIN") at comm_lists.c:655
#7 0x080883bf in domenu (menu_name=0x810ef08 "TOPMENU") at comm_lists.c:651
#8 0x080cbe41 in main_bbs (convit=0, argv=0x8047eac "bbsd:linton")
at newmain_single.c:1141
#9 0x080c4be9 in bbs_main (argv=0x8047eac "bbsd:linton") at bbsd_single.c:771
#10 0x080c4db0 in bbs_standalone_main (argv=0x8047eac "bbsd:linton")
at bbsd_single.c:914
#11 0x080c4eec in main (argc=3, argv=0x8047dd4) at bbsd_single.c:1009
(gdb) frame 3
#3 0x080cc393 in showtitle (title=0xd10a38f8 "系统维护选单",
mid=0x8047880 "KBS测试站") at newmain_single.c:1275
1275 sprintf(note, "讨论区 [%s]", currboard->filename);
(gdb) p currboard
$1 = (struct boardheader *) 0xd1040000
(gdb) l
1270 if (colour == YELLOW)
1271 colour = RED;
1272 }
1273
1274 if (selboard)
1275 sprintf(note, "讨论区 [%s]", currboard->filename);
1276 else {
1277 int bid;
1278 bid = getbnum(DEFAULTBOARD);
1279 if (bid==0) {
(gdb)
--
FROM 202.193.15.*