captures in regex location

Igor Sysoev is at rambler-co.ru
Wed Mar 11 14:08:05 MSK 2009


On Wed, Mar 11, 2009 at 01:26:24PM +0300, Vladimir Sopot wrote:

> On Mar 11, 2009, at 8:10 AM, Igor Sysoev wrote:
> 
> >On Wed, Mar 11, 2009 at 12:35:13AM +0300, Vladimir Sopot wrote:
> >
> >>
> >>On Mar 10, 2009, at 11:26 PM, Igor Sysoev wrote:
> >>
> >>>On Tue, Mar 10, 2009 at 10:54:03PM +0300, Vladimir Sopot wrote:
> >>>
> >>>>а вот еще одна
> >>>
> >>>А если вернуться к старому конфигу без captures, но с версией  
> >>>0.7.40 ?
> >>
> >>Я боялся этого вопроса :) Пришлось сделать
> >>
> >>if ($host ~* "................") {
> >>       set $myvar $1;
> >>}
> >>
> >>после каждого server_name "...........";
> >>
> >># ../sbin/nginx -V
> >>nginx version: nginx/0.7.40
> >>падает. Даже без "--with-debug" пишет корку (это нормально?):
> >>
> >>2009/03/11 00:13:42 [alert] 24836#0: worker process 24850 exited on
> >>signal 11 (core dumped)
> >>2009/03/11 00:13:43 [alert] 24836#0: worker process 24843 exited on
> >>signal 11 (core dumped)
> >>
> 
> >>Возвращаем последнюю работавшую до captures версию -
> >>
> >># ../sbin/nginx -V
> >>nginx version: nginx/0.7.33
> >>
> >>10 минут - полет нормальный. какую версию следующую пробовать?
> >
> >0.7.39.
> 
> 30 минут - полет нормальный, без патчей.
> 
> Кстати, посмотрел на еще одной сервере (AMD vs Intel, OpenSUSE 10.3 vs  
> 11.1) - nginx точно так же падает.

Патч для 0.7.40, который, вероятно, поможет.


-- 
Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
Index: src/http/ngx_http_request.c
===================================================================
--- src/http/ngx_http_request.c	(revision 1874)
+++ src/http/ngx_http_request.c	(working copy)
@@ -1662,9 +1662,9 @@
 
             if (sn[i].captures && r->captures == NULL) {
 
-                ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int);
+                ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
 
-                r->captures = ngx_palloc(r->pool, ncaptures);
+                r->captures = ngx_palloc(r->pool, ncaptures * sizeof(int));
                 if (r->captures == NULL) {
                     return NGX_ERROR;
                 }
Index: src/http/ngx_http_core_module.c
===================================================================
--- src/http/ngx_http_core_module.c	(revision 1874)
+++ src/http/ngx_http_core_module.c	(working copy)
@@ -1380,9 +1380,9 @@
 
             if ((*clcfp)->captures && r->captures == NULL) {
 
-                len = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int);
+                len = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
 
-                r->captures = ngx_palloc(r->pool, len);
+                r->captures = ngx_palloc(r->pool, len * sizeof(int));
                 if (r->captures == NULL) {
                     return NGX_ERROR;
                 }


More information about the nginx-ru mailing list