squid coss文件系统的一个bug,运行程序core down

cache_mem 16 MB
cache_replacement_policy heap LRU
maximum_object_size_in_memory  32 KB
cache_dir coss /home/shihao/work/squid/var/cache0/coss0 100 membufs=10 overwrite-percent=100 max-size=262144
cache_swap_log /home/shihao/work/squid/var/logs/swap.state
http_port 3128

访问squidclient -T 3000 http://10.1.1.111:8081/1000 ~ http://10.1.6.111:8081/5000
其中 http://10.1.1.111:8081/1000 ~ http://10.1.1.111:8081/5000 每个文件大小为65146字节
因为要存储网页缓存头信息,http://10.1.1.111:8081/1000 这个网页缓存头信息390个字节(不同的机器和链接头字节数有可能不一样)

10.1.1.111机器的处理器为Intel(R) Xeon(R) CPU 5120 @ 1.86GHz

 

coss-bug@squid-2.7.STABLE7/src/fs/coss/store_io_coss.c: line 182

configure options:  '--prefix=/home/shihao/work/squid' '--with-large-files' '--with-coss-membuf-size=1048576' '--enable-async-io=32' '--enable-storeio=ufs,coss,aufs,diskd


 
((cs->current_offset + allocsize) == ((off_t) SD->max_size << 10) 时,  @line:  182
((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10))  结果为 false,
但是 ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) 为 true.


那么会进入 else if ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) //@line: 203语句中,

会执行 assert(cs->curstripe < (cs->numstripes - 1))//@line: 215, 程序出现 core down.

正确 : } else if ((cs->current_offset + allocsize) >= ((off_t) SD->max_size << 10)) { @line:  182
 
/* Check if we have overflowed the disk .. */
} else if ((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10)) {
 /*
  * tried to allocate past the end of the disk, so wrap
  * back to the beginning
  */
 coss_stats.disk_overflows++;
 cs->current_membuf->flags.full = 1;
 cs->numfullstripes++;
 cs->current_membuf->diskend = cs->current_offset;
 storeCossMaybeWriteMemBuf(SD, cs->current_membuf);
 /* cs->current_membuf may be invalid at this point */
 cs->current_offset = 0; /* wrap back to beginning */
 debug(79, 2) ("storeCossAllocate: %s: wrap to 0/n", stripePath(SD));
 newmb = storeCossCreateMemBuf(SD, 0, checkf, &coll);
 cs->current_membuf = newmb;
 if (newmb == NULL) {
     cs->sizerange_max = SD->max_objsize;
     return -1;
 }
 /* Check if we have overflowed the MemBuf */
} else if ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) {
 /*
  * Skip the blank space at the end of the stripe. start over.
  */
 coss_stats.stripe_overflows++;
 cs->current_membuf->flags.full = 1;
 cs->numfullstripes++;
 cs->current_offset = cs->current_membuf->diskend;
 storeCossMaybeWriteMemBuf(SD, cs->current_membuf);
 /* cs->current_membuf may be invalid at this point */
 debug(79, 3) ("storeCossAllocate: %s: New offset - %" PRId64 "/n", stripePath(SD),
     (int64_t) cs->current_offset);
 assert(cs->curstripe < (cs->numstripes - 1));
 newmb = storeCossCreateMemBuf(SD, cs->curstripe + 1, checkf, &coll);
 cs->current_membuf = newmb;
 if (newmb == NULL) {
     cs->sizerange_max = SD->max_objsize;
     return -1;
 }
}
 
 squid-3.0.STABLE24: store_io_coss.cc: @line 80
(current_offset + allocsize) > ((off_t)max_size << 10)
I don't know  whether it has the same problem.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值