(gdb) b after_post
Breakpoint 1 at 0x80dccfb: file article.c, line 1098.
(gdb) c
Continuing.
Breakpoint 1, after_post (user=0xd057cac0, fh=0x8046a50, boardname=0xd1045580 "news",
re=0x0, poststat=1, session=0x8147900) at article.c:1098
1098 article.c: No such file or directory.
in article.c
(gdb) watch boardname
Watchpoint 2: boardname
(gdb) p boardname
$1 = 0xd1045580 "news"
(gdb) bt
#0 after_post (user=0xd057cac0, fh=0x8046a50, boardname=0xd1045580 "news", re=0x0,
poststat=1, session=0x8147900) at article.c:1098
#1 0x080654bf in post_article (conf=0x8046e20, q_file=0x80f7f8a "", re_file=0x0) at bbs.c:2869
#2 0x08063a44 in do_post (conf=0x8046e20, fileinfo=0x816d9a0, extraarg=0x0) at bbs.c:2283
#3 0x080ed810 in read_key (conf=0x8046e20, command=16) at newread.c:228
#4 0x080c6247 in do_select_internal (conf=0x8046e20, key=16) at select.c:368
#5 0x080c62d1 in list_select (conf=0x8046e20, key=16) at select.c:388
#6 0x080c660f in list_select_loop (conf=0x8046e20) at select.c:486
#7 0x080ee966 in new_i_read (cmdmode=DIR_MODE_NORMAL, direct=0x8046fe0 "boards/news/.DIR",
dotitle=0x805f8c1 <readtitle>, doentry=0x805fe79 <readdoent>, rcmdlist=0x813c140, ssize=140)
at newread.c:675
#8 0x0806cddf in Read () at bbs.c:6214
#9 0x080bc270 in fav_onselect (conf=0x80477d0) at boards_t.c:714
#10 0x080c5d8d in do_select_internal (conf=0x80477d0, key=4099) at select.c:268
#11 0x080c6443 in list_select (conf=0x80477d0, key=13) at select.c:425
#12 0x080c660f in list_select_loop (conf=0x80477d0) at select.c:486
#13 0x080bde0a in choose_board (newflag=1, boardprefix=0xd10a2809 "2", group=0, favmode=0)
at boards_t.c:1437
#14 0x080ba4d2 in EGroup (cmd=0xd10a25be "2Campus") at boards_t.c:23
#15 0x080883bf in domenu (menu_name=0xd10a1f61 "M_EGROUP") at comm_lists.c:651
#16 0x080883bf in domenu (menu_name=0x810ef48 "TOPMENU") at comm_lists.c:651
#17 0x080cbe6c in main_bbs (convit=0, argv=0x8047e78 "bbsd:linton") at newmain_single.c:1141
#18 0x080c4c14 in bbs_main (argv=0x8047e78 "bbsd:linton") at bbsd_single.c:771
#19 0x080c4ddb in bbs_standalone_main (argv=0x8047e78 "bbsd:linton") at bbsd_single.c:914
#20 0x080c4f17 in main (argc=3, argv=0x8047d98) at bbsd_single.c:1009
(gdb) c
Continuing.
Watchpoint 2 deleted because the program has left the block in
which its expression is valid.
0xd117f790 in strncmp () from /usr/lib/libc.so.1
(gdb) watch boardname
No symbol "boardname" in current context.
(gdb) p boardname
No symbol "boardname" in current context.
(gdb) bt
#0 0xd117f790 in strncmp () from /usr/lib/libc.so.1
#1 0x08046a9c in ?? ()
#2 0x08128db1 in post_sufix.0 ()
#3 0x00000004 in ?? ()
#4 0x08045c58 in ?? ()
#5 0xd10dccf1 in read () from /usr/lib/libthread.so.1
#6 0x080654bf in post_article (conf=0x8046e20, q_file=0x80f7f8a "", re_file=0x0) at bbs.c:2869
#7 0x08063a44 in do_post (conf=0x8046e20, fileinfo=0x816d9a0, extraarg=0x0) at bbs.c:2283
#8 0x080ed810 in read_key (conf=0x8046e20, command=16) at newread.c:228
#9 0x080c6247 in do_select_internal (conf=0x8046e20, key=16) at select.c:368
#10 0x080c62d1 in list_select (conf=0x8046e20, key=16) at select.c:388
#11 0x080c660f in list_select_loop (conf=0x8046e20) at select.c:486
#12 0x080ee966 in new_i_read (cmdmode=DIR_MODE_NORMAL, direct=0x8046fe0 "boards/news/.DIR",
dotitle=0x805f8c1 <readtitle>, doentry=0x805fe79 <readdoent>, rcmdlist=0x813c140, ssize=140)
at newread.c:675
#13 0x0806cddf in Read () at bbs.c:6214
#14 0x080bc270 in fav_onselect (conf=0x80477d0) at boards_t.c:714
#15 0x080c5d8d in do_select_internal (conf=0x80477d0, key=4099) at select.c:268
#16 0x080c6443 in list_select (conf=0x80477d0, key=13) at select.c:425
#17 0x080c660f in list_select_loop (conf=0x80477d0) at select.c:486
#18 0x080bde0a in choose_board (newflag=1, boardprefix=0xd10a2809 "2", group=0, favmode=0)
at boards_t.c:1437
#19 0x080ba4d2 in EGroup (cmd=0xd10a25be "2Campus") at boards_t.c:23
#20 0x080883bf in domenu (menu_name=0xd10a1f61 "M_EGROUP") at comm_lists.c:651
#21 0x080883bf in domenu (menu_name=0x810ef48 "TOPMENU") at comm_lists.c:651
#22 0x080cbe6c in main_bbs (convit=0, argv=0x8047e78 "bbsd:linton") at newmain_single.c:1141
#23 0x080c4c14 in bbs_main (argv=0x8047e78 "bbsd:linton") at bbsd_single.c:771
#24 0x080c4ddb in bbs_standalone_main (argv=0x8047e78 "bbsd:linton") at bbsd_single.c:914
#25 0x080c4f17 in main (argc=3, argv=0x8047d98) at bbsd_single.c:1009
(gdb) n
Single stepping until exit from function strncmp,
which has no line number information.
after_post (user=0xd057cac0, fh=0x8046a50, boardname=0xd1045340 "News", re=0x0, poststat=1,
session=0x8147900) at article.c:1111
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0xd11ab4ee in strncasecmp () from /usr/lib/libc.so.1
(gdb) bt
#0 0xd11ab4ee in strncasecmp () from /usr/lib/libc.so.1
#1 0x080a2e7a in getboardnum (bname=0xd1045340 <Address 0xd1045340 out of bounds>, bh=0x0)
at bcache.c:329
#2 0x080a2334 in updatelastpost (board=0xd1045340 <Address 0xd1045340 out of bounds>)
at bcache.c:86
#3 0x080dd10c in after_post (user=0xd057cac0, fh=0x8046a50,
boardname=0xd1045340 <Address 0xd1045340 out of bounds>, re=0x0, poststat=1, session=0x8147900)
at article.c:1223
#4 0x080654bf in post_article (conf=0x8046e20, q_file=0x80f7f8a "", re_file=0x0) at bbs.c:2869
#5 0x08063a44 in do_post (conf=0x8046e20, fileinfo=0x816d888, extraarg=0x0) at bbs.c:2283
#6 0x080ed810 in read_key (conf=0x8046e20, command=16) at newread.c:228
【 在 atppp (Big Mouse) 的大作中提到: 】
: 啥毛病也没看出来。。。
--
修改:linton FROM 202.193.15.*
FROM 220.173.136.*