Welcome! Log In Create A New Profile

Advanced

Re: nginx tries to allocate a huge number of memory and fails

Maxim Dounin
August 04, 2011 02:30AM
Hello!

On Thu, Aug 04, 2011 at 11:47:08AM +0800, Mauro Stettler wrote:

> hi
>
> i'm having a strange case where nginx is trying to allocate some
> really huge amount of memory. we created a new vhost on nginx to
> provide an internal interface to flush the apc cache of php. in most
> of the cases i can request this and get what i expected, only in
> around 20% of the request nginx is trying to allocate a huge number of
> memory and fails, so it returns 500 internal server error.
>
> 2011/08/04 05:14:00 [emerg] 41529#0: *89012062 malloc()
> 18446744073709545066 bytes failed (12: Cannot allocate memory),
> client: 192.168.1.195, server: *.kaufmich.vpn, request: "GET
> /web1/apc/flushApc.php HTTP/1.1", host: "static.kaufmich.vpn"
>
>
>
> does anybody have an idea why that would happen? i thought this almost
> has to be a bug because the amount of bytes it is trying to allocate
> is just so huge it just cant be right.

[...]

> # nginx -V
> nginx version: nginx/0.7.65

[...]

> if ($request_uri ~* /(.+)/(.+\.php)) {
> set $prod_server $1;
> set $action $2;
> set $script $3;
> set $parameters "";

This is a problem with using unitialized $n variables. Note the
above regexp has only 2 captures but following "set" uses variable
"$3".

This problem is fixed in 0.8.25+. Please upgrade.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx tries to allocate a huge number of memory and fails

replay August 03, 2011 11:48PM

Re: nginx tries to allocate a huge number of memory and fails

Maxim Dounin August 04, 2011 02:30AM

Re: nginx tries to allocate a huge number of memory and fails

replay August 04, 2011 02:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready