ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *** glibc detected ***



On Thu, Jan 29, 2009 at 04:09:28PM +0600, Artem Bokhan wrote:

> Igor Sysoev пишет:
> >On Wed, Jan 28, 2009 at 10:08:55PM +0600, Artem Bokhan wrote:

> >>2009/01/28 20:33:51 [error] 15446#0: *1435 delta-motors.cris.net could 
> >>not be resolved (3: Host not found) while in resolving client hostname, 
> >>client: 212.110.138.16, server: 0.0.0.0:33333
> >>2009/01/28 20:33:51 [error] 15446#0: *1437 sr-194-33-140-118-on-nets.com 
> >>could not be resolved (3: Host not found) while in resolving client 
> >>hostname, client: 118.140.33.194, server: 0.0.0.0:33333
> >>2009/01/28 20:33:51 [error] 15446#0: *1444 92.84.40.233 could not be 
> >>resolved (3: Host not found) while in resolving client address, client: 
> >>92.84.40.233, server: 0.0.0.0:33333
> >>2009/01/28 20:33:51 [error] 15446#0: *1446 
> >>ABTS-North-Dynamic-179.81.161.122.airtelbroadband.in could not be 
> >>resolved (3: Host not found) while in resolving
> >>client hostname, client: 122.161.81.179, server: 0.0.0.0:33333
> >>2009/01/28 20:33:51 [error] 15446#0: *1432 58.187.117.32 could not be 
> >>resolved (3: Host not found) while in resolving client address, client: 
> >>58.187.117.32,
> >>server: 0.0.0.0:33333
> >>2009/01/28 20:33:52 [error] 15446#0: *1451 89.113.142.101 could not be 
> >>resolved (3: Host not found) while in resolving client address, client: 
> >>89.113.142.101, server: 0.0.0.0:33333
> >>2009/01/28 20:33:52 [error] 15446#0: *1455 190.144.22.254 could not be 
> >>resolved (3: Host not found) while in resolving client address, client: 
> >>190.144.22.254, server: 0.0.0.0:33333
> >>*** glibc detected *** free(): invalid pointer: 0x0000000000564c58 ***
> >>2009/01/28 20:33:52 [alert] 13643#0: worker process 15446 exited on 
> >>signal 6
> >>    
> >
> >Хорошо бы разрешить корки и прислать мне backtrace из gdb.
> >  
> Ушло в личный ящик.

Патч.


-- 
Игорь Сысоев
http://sysoev.ru
Index: src/core/ngx_resolver.c
===================================================================
--- src/core/ngx_resolver.c     (revision 1801)
+++ src/core/ngx_resolver.c     (revision 1804)
@@ -578,6 +578,7 @@
 ngx_int_t
 ngx_resolve_addr(ngx_resolver_ctx_t *ctx)
 {
+    u_char               *name;
     ngx_resolver_t       *r;
     ngx_resolver_node_t  *rn;
 
@@ -601,19 +602,21 @@
 
             ngx_queue_insert_head(&r->addr_expire_queue, &rn->queue);
 
-            ctx->name.len = rn->nlen;
-            ctx->name.data = ngx_resolver_dup(r, rn->name, rn->nlen);
-            if (ctx->name.data == NULL) {
+            name = ngx_resolver_dup(r, rn->name, rn->nlen);
+            if (name == NULL) {
                 goto failed;
             }
 
+            ctx->name.len = rn->nlen;
+            ctx->name.data = name;
+
             /* unlock addr mutex */
 
             ctx->state = NGX_OK;
 
             ctx->handler(ctx);
 
-            ngx_resolver_free(r, ctx->name.data);
+            ngx_resolver_free(r, name);
 
             return NGX_OK;
         }
@@ -1336,7 +1339,7 @@
              ctx->handler(ctx);
         }
 
-        if (naddrs) {
+        if (naddrs > 1) {
             ngx_resolver_free(r, addrs);
         }
 
@@ -1523,7 +1526,11 @@
 
     if (len != (size_t) rn->nlen || ngx_strncmp(name.data, rn->name, len) != 0)
     {
-        ngx_resolver_free(r, rn->name);
+        if (rn->nlen) {
+            ngx_resolver_free(r, rn->name);
+        }
+
+        rn->nlen = len;
         rn->name = name.data;
 
         name.data = ngx_resolver_dup(r, rn->name, len);


 




Copyright © Lexa Software, 1996-2009.