- 主题:[KBS2.0]Telnet发文章掉线
我觉得不是,他这个是调 updatelastpost 的时候 boardname 指针无效
而 after_post 里面调 updatelastpost 之前有过 bid = getbid(boardname, &bh);
而且显然是正常运行的,文章都发到版面上了说明 after_post 写入 .DIR 正常
所以应该是 after_post 里面加 boardname 这个变量的 watch,也许能抓到什么
代码非法的改了它的值
【 在 stiger (Software like sex,better when it's free) 的大作中提到: 】
: #3 0x080dd10c in after_post (user=0xd057cac0, fh=0x8046a50,
: boardname=0xd1040240 <Address 0xd1040240 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
: 既然是经常会出现,那得看看post_article里什么时候currboard->filename变了。
: 继续调?反正经常掉,呵呵,容易。
--
FROM 128.12.150.*
准备发文
gdb挂上
(gdb) b after_post
...
(gdb) c
...
发文
提示breakpoint
(gdb) watch boardname
...
(gdb) c
【 在 linton (难得糊涂) 的大作中提到: 】
: 怎样在after_post 里加 boardname 这个变量的 watch ?
--
FROM 128.12.150.*
啥毛病也没看出来。。。
【 在 linton (难得糊涂) 的大作中提到: 】
: 下面的调试步骤可否有问题? 还需怎样进一步的调试?
: (gdb) attach 13659
: Attaching to program `/export/home0/bbs/bin/bbsd', process 13659
: ...................
--
FROM 128.12.150.*
一条条n吧兄弟。。。
【 在 linton (难得糊涂) 的大作中提到: 】
: (gdb) b after_post
: Breakpoint 1 at 0x80dccfb: file article.c, line 1098.
: (gdb) c
: ...................
--
FROM 128.12.150.*
ft看来还真的是这里?...
watch用不了那你就n一条就打印一次boardname,看什么时候变了...
辛苦了!
faint solaris...
【 在 linton (难得糊涂) 的大作中提到: 】
: (gdb) b after_post
: Breakpoint 1 at 0x80dccfb: file article.c, line 1098.
: (gdb) c
: ...................
--
FROM 128.12.150.*
我已经明白了,这个问题我早就提过不过忘记了:(
http://cvs.kcn.cn/core.cgi/kbs_bbs/libBBS/bcache.c?view=log&pathrev=v1_2
bcache_setreadonly()函数会重新mmap .BOARDS,这之后currboard指针可能会变化,
而boardname还是指向老的地方。你看看1.2分支上flyriver做的两个对
bcache_setreadonly函数的修改,应该会有帮助...
【 在 linton (难得糊涂) 的大作中提到: 】
: 不辛苦,虽然比较菜,有什么尽管吩咐
--
FROM 128.12.150.*
那我也得找得到一台能断线又能用的solaris...我昨天找了一台solaris光是
configure就configure了好几个小时。。。。。。。。。。。。。。。
【 在 linton (难得糊涂) 的大作中提到: 】
: 老大,在主分支里面改一下吧
: 这两个问题,学了不少东西,再次感谢~~~
--
FROM 128.12.150.*