Welcome! Log In Create A New Profile

Advanced

nginx: Bug Report: ngx_palloc.c:ngx_reset_pool"

June 15, 2010 01:44AM
--- nginx-0.8.35/src/core/ngx_palloc.c 2009-12-17 04:25:46.000000000
-0800
+++ nginx-0.8.35.fixed/src/core/ngx_palloc.c 2010-04-18
19:28:43.680353209 -0700
@@ -105,9 +105,10 @@
}

pool->large = NULL;
+ pool->d.last = (u_char *) pool + sizeof(ngx_pool_t);

- for (p = pool; p; p = p->d.next) {
- p->d.last = (u_char *) p + sizeof(ngx_pool_t);
+ for (p = pool->d.next; p; p = p->d.next) {
+ p->d.last = (u_char *) p + sizeof(ngx_pool_data_t);
}
}

This is my first time bug reporting so please be careful reading this bug
report.

Only the first pool in the linked list uses ngx_pool_t, the others use
ngx_pool_data_t.
The problem is when the pools resets through ngx_reset_pool it resets all
pools d->last to pool + sizeof(ngx_pool_t) and therefore creating
an unsued memory chunk through further allocations.

The program should reset d->last of the first pool to pool +
sizeof(ngx_pool_t) and the rest to pool + sizeof(ngx_pool_data_t).

Best regards, Fredrik Yhlen
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx: Bug Report: ngx_palloc.c:ngx_reset_pool"

kanelglass 3929 June 15, 2010 01:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
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