<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>nginx: Bug Report: ngx_palloc.c:ngx_reset_pool&amp;quot;</title>
<description>--- 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-&amp;gt;large = NULL;
+ pool-&amp;gt;d.last = (u_char *) pool + sizeof(ngx_pool_t);
- for (p = pool; p; p = p-&amp;gt;d.next) {
- p-&amp;gt;d.last = (u_char *) p + sizeof(ngx_pool_t);
+ for (p = pool-&amp;gt;d.next; p; p = p-&amp;gt;d.next) {
+ p-&amp;gt;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-&amp;gt;last to pool + sizeof(ngx_pool_t) and therefore creating
an unsued memory chunk through further allocations.
The program should reset d-&amp;gt;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</description><link>http://forum.nginx.org/read.php?29,98287,98287#msg-98287</link><lastBuildDate>Wed, 19 Jun 2013 14:17:11 -0400</lastBuildDate>
<generator>Phorum 5.2.16</generator>
<item>
<guid>http://forum.nginx.org/read.php?29,98287,98287#msg-98287</guid>
<title>nginx: Bug Report: ngx_palloc.c:ngx_reset_pool&quot;</title><link>http://forum.nginx.org/read.php?29,98287,98287#msg-98287</link><description><![CDATA[--- nginx-0.8.35/src/core/ngx_palloc.c 2009-12-17 04:25:46.000000000<br />-0800<br />+++ nginx-0.8.35.fixed/src/core/ngx_palloc.c 2010-04-18<br />19:28:43.680353209 -0700<br />@@ -105,9 +105,10 @@<br />}<br /><br />pool-&gt;large = NULL;<br />+ pool-&gt;d.last = (u_char *) pool + sizeof(ngx_pool_t);<br /><br />- for (p = pool; p; p = p-&gt;d.next) {<br />- p-&gt;d.last = (u_char *) p + sizeof(ngx_pool_t);<br />+ for (p = pool-&gt;d.next; p; p = p-&gt;d.next) {<br />+ p-&gt;d.last = (u_char *) p + sizeof(ngx_pool_data_t);<br />}<br />}<br /><br />This is my first time bug reporting so please be careful reading this bug<br />report.<br /><br />Only the first pool in the linked list uses ngx_pool_t, the others use<br />ngx_pool_data_t.<br />The problem is when the pools resets through ngx_reset_pool it resets all<br />pools d-&gt;last to pool + sizeof(ngx_pool_t) and therefore creating<br />an unsued memory chunk through further allocations.<br /><br />The program should reset d-&gt;last of the first pool to pool +<br />sizeof(ngx_pool_t) and the rest to pool + sizeof(ngx_pool_data_t).<br /><br />Best regards, Fredrik Yhlen<br />_______________________________________________<br />nginx-devel mailing list<br />nginx-devel@nginx.org<br />http://nginx.org/mailman/listinfo/nginx-devel]]></description>
<dc:creator>kanelglass</dc:creator>
<category>Nginx Development</category><pubDate>Tue, 15 Jun 2010 01:44:01 -0400</pubDate></item>
</channel>
</rss>