免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 732 | 回复: 0
打印 上一主题 下一主题

khttpd problems [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-25 16:37 |只看该作者 |倒序浏览
khttpd problems
khttpd
, the first http accellerator
built into the Linux kernel, is very fast, especially at serving
small files.  However, it appears to have some stability problems.
It is fairly easy to cause a server running khttpd on some versions of linux
to crash.
As of 2.4.17, it looks like you have to run with only 1 thread, and
avoid quickly cycling it up and down, to have any hope of stability -- and
even then, abruptly terminating client connections causes
an oops fairly frequently.
In 2.4.17, in my initial testing with khttpd, I couldn't fetch .http files
from khttpd because DecodeHeader was getting -EFAULT
back from sock_recvmsg!  Here's the scenario:
  • khttpd starts.  InitWaitHeaders is called, which allocates Buffer[] in waitheaders.c.
  • Operator stops khttpd.  StopWaitingForHeaders is called, which frees Buffer[] in waitheaders.c.
  • Operator restarts khttpd.  *InitWaitHeaders is not called again*.  When WaitForHeaders gets
    a header, it calls DecodeHeader, which calls sock_recvmsg with Buffer[] as a buffer, which
    causes an EFAULT as the buffer has not been allocated.
    This same problem can be triggered by bringing khttpd up and down in a loop.
    Here's a
    test script
    to do that, and
    a not-very-enlightening
    crash traceback
    .
    Another minor problem was
    found by the Stanford checker
    : a value
    that cannot be NULL was being checked against NULL.
    Patches
    Here are patches to fix up khttpd:

    I
    submitted the first of these to khttpd-users
    , but have not asked Marcello to apply the
    to the 2.4 kernel.  I probably should.
                   
                   
                   

    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1938/showart_132448.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP