buaazp / zimg

A lightweight and high performance image storage and processing system.
http://zimg.buaa.us
BSD 3-Clause "New" or "Revised" License
2.69k stars 403 forks source link

当上传一个破损的jpg文件的时候http服务器宕掉了 #27

Closed qiutiaoming closed 10 years ago

qiutiaoming commented 10 years ago

w020120210611376489131

上面的是一张破损的图片. 命令行中输出错误栈信息


 *** glibc detected *** ./zimg: double free or corruption (out): 0x00007f4c60000020 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x760e6)[0x7f4c77f0f0e6]
/lib64/libc.so.6(+0x78c13)[0x7f4c77f11c13]
./zimg(get_img+0x460)[0x409160]
./zimg(send_document_cb+0x751)[0x40cf21]
./zimg[0x4119b0]
./zimg(htparser_run+0xbfb)[0x41642b]
./zimg[0x412b61]
/usr/local/lib/libevent-2.0.so.5(+0x19ee5)[0x7f4c79027ee5]
/usr/local/lib/libevent-2.0.so.5(event_base_loop+0x53c)[0x7f4c7901fe0c]
./zimg[0x40f3a2]
/lib64/libpthread.so.0(+0x7851)[0x7f4c78233851]
/lib64/libc.so.6(clone+0x6d)[0x7f4c77f8190d]
======= Memory map: ========
00400000-00455000 r-xp 00000000 fd:02 50727537                           /home/zimg/zimg/bin/zimg
00655000-00656000 rw-p 00055000 fd:02 50727537                           /home/zimg/zimg/bin/zimg
00656000-00657000 rw-p 00000000 00:00 0
01f26000-01f47000 rw-p 00000000 00:00 0                                  [heap]
7f4c58000000-7f4c58021000 rw-p 00000000 00:00 0
7f4c58021000-7f4c5c000000 ---p 00000000 00:00 0
7f4c60000000-7f4c60087000 rw-p 00000000 00:00 0
buaazp commented 10 years ago

是你上面这张图吗? https://cloud.githubusercontent.com/assets/5118099/3790280/d2efb4ba-1af5-11e4-8022-8e9214ee212d.jpg

我试了一下没有出现这个问题,麻烦把你的测试图片上传到我的demo服务器上,然后告诉我一下MD5:

http://demo.buaa.us/

qiutiaoming commented 10 years ago

http://yourhostname:80/52b70ebfcf23a0dcffb2306d392e2e44?w=width&h=height&p=proportion&g=isgray

奇怪,我在我我的服务器上上传这张图片,http服务器总是挂掉,为什么在你的上面不会有问题呢?

buaazp commented 10 years ago

我在Demo服务器上用的是最新版所以没有崩溃,切到2.2版本之后进行调试这个问题已经找到原因了,最新的代码已修复,请验证一下,非常感谢反馈这个问题。

qiutiaoming commented 10 years ago

image

http://hostname:4869 没有上传的组件了 curl 的方式成功了返回 404 not found

buaazp commented 10 years ago

配置文件里的指定的文件被你删了或者移动位置了

root_path='/www/index.html'
qiutiaoming commented 10 years ago

好的。我过段时间看看代码,也加入进来。