Welcome! Log In Create A New Profile

Advanced

memcache buffer overflow?

May 18, 2009 03:11PM
Dear all,

I am trying to get memcache with nginx to work to improve the performance of my php web application. However, while my configuration is working fine for small outputs, if output size exceeds 20k I only get garbage characters posted back to the client. The test was carried out on debian lenny, with nginx version nginx/0.6.32

Test Code:

--- snip
<?php
$length = 20;

$memcache = new Memcache;
$memcache->connect('localhost', '11211');
$x='';
for($i=0;$i<$length*1024;$i++) {
$x .= 'x';
}
$memcache->set('/k',$x, 0, 6100);
echo strlen($memcache->get('/k'));
--- snap

If I run this code with length set to 20, the string is correctly stored in memcache (as verified by reading from the memcache). However, nginx returns garbage characters only - especially NULL strings.

If length is reduced to 19, both the memcache module and the script correctly output the x's.

I would be very grateful if this bug could be fixed. Please do not hesistate to contact me if you need more information.

Kind regards,

batrick
Subject Author Posted

memcache buffer overflow?

batrick May 18, 2009 03:11PM

Re: memcache buffer overflow?

Anton Yuzhaninov May 18, 2009 05:29PM

Re: memcache buffer overflow?

batrick May 18, 2009 06:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready