Mailing List Archive

#1860: ESI-related memory leaks
#1860: ESI-related memory leaks
--------------------+-------------------
Reporter: daghf | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: 4.1.2
Severity: normal | Keywords:
--------------------+-------------------
Did a quick ASAN run w/ the leak checking enabled for 4.1.2.

For most (all?) of the ESI fetch VTCs, it detects a couple of leaks that
we probably want to look into.

1)
{{{
*** v1 3.2 debug| Info: Child (26687) said Direct leak of 40 byte(s)
in 1 object(s) allocated from:\n
*** v1 3.2 debug| Info: Child (26687) said #0 0x4cea62 in malloc
(/home/daghf/varnish-master/bin/varnishd/.libs/lt-varnishd+0x4cea62)\n
*** v1 3.2 debug| Info: Child (26687) said #1 0x7f5313479762 in
VSB_new /home/daghf/varnish-master/lib/libvarnish/vsb.c:226:6\n
*** v1 3.2 debug| Info: Child (26687) said #2 0x577bd4 in
VEP_Parse /home/daghf/varnish-
master/bin/varnishd/cache/cache_esi_parse.c:889:20\n
*** v1 3.2 debug| Info: Child (26687) said #3 0x56a18b in
vfp_esi_pull /home/daghf/varnish-
master/bin/varnishd/cache/cache_esi_fetch.c:254:3\n
*** v1 3.2 debug| Info: Child (26687) said #4 0x5ba8c8 in VFP_Suck
/home/daghf/varnish-master/bin/varnishd/cache/cache_fetch_proc.c:172:8\n
*** v1 3.2 debug| Info: Child (26687) said #5 0x5b621e in
vbf_fetch_body_helper /home/daghf/varnish-
master/bin/varnishd/cache/cache_fetch.c:511:10\n
*** v1 3.2 debug| Info: Child (26687) said #6 0x5aeb07 in
vbf_stp_fetch /home/daghf/varnish-
master/bin/varnishd/cache/cache_fetch.c:670:3\n
*** v1 3.2 debug| Info: Child (26687) said #7 0x59d235 in
vbf_fetch_thread /home/daghf/varnish-
master/bin/varnishd/../../include/tbl/steps.h:63:1\n
*** v1 3.2 debug| Info: Child (26687) said #8 0x7191f6 in
Pool_Work_Thread /home/daghf/varnish-
master/bin/varnishd/cache/cache_wrk.c:341:4\n
*** v1 3.2 debug| Info: Child (26687) said #9 0x716a0d in
WRK_Thread /home/daghf/varnish-
master/bin/varnishd/cache/cache_wrk.c:121:2\n
*** v1 3.2 debug| Info: Child (26687) said #10 0x715d27 in
pool_thread /home/daghf/varnish-
master/bin/varnishd/cache/cache_wrk.c:371:2\n
*** v1 3.2 debug| Info: Child (26687) said #11 0x7f53120a2283 in
start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7283)\n
}}}


2)

{{{
*** v1 2.5 debug| Info: Child (747) said Direct leak of 64 byte(s) in
1 object(s) allocated from:\n
*** v1 2.5 debug| Info: Child (747) said #0 0x4cebdb in calloc
(/home/daghf/varnish-master/bin/varnishd/.libs/lt-varnishd+0x4cebdb)\n
*** v1 2.5 debug| Info: Child (747) said #1 0x568ebd in
vfp_esi_init /home/daghf/varnish-
master/bin/varnishd/cache/cache_esi_fetch.c:227:2\n
*** v1 2.5 debug| Info: Child (747) said #2 0x5b96ab in VFP_Open
/home/daghf/varnish-master/bin/varnishd/cache/cache_fetch_proc.c:137:17\n
*** v1 2.5 debug| Info: Child (747) said #3 0x5ad2d3 in
vbf_stp_fetch /home/daghf/varnish-
master/bin/varnishd/cache/cache_fetch.c:624:6\n
*** v1 2.5 debug| Info: Child (747) said #4 0x59d235 in
vbf_fetch_thread /home/daghf/varnish-
master/bin/varnishd/../.n./include/tbl/steps.h:63:1\n
*** v1 2.5 debug| Info: Child (747) said #5 0x7191f6 in
Pool_Work_Thread /home/daghf/varnish-
master/bin/varnishd/cache/cache_wrk.c:341:4\n
*** v1 2.5 debug| Info: Child (747) said #6 0x716a0d in WRK_Thread
/home/daghf/varnish-master/bin/varnishd/cache/cache_wrk.c:121:2\n
*** v1 2.5 debug| Info: Child (747) said #7 0x715d27 in
pool_thread /home/daghf/varnish-
master/bin/varnishd/cache/cache_wrk.c:371:2\n
*** v1 2.5 debug| Info: Child (747) said #8 0x7fac5de0e283 in
start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7283)\n
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1860>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1860: ESI-related memory leaks [ In reply to ]
#1860: ESI-related memory leaks
--------------------+--------------------
Reporter: daghf | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: 4.1.2
Severity: normal | Resolution:
Keywords: |
--------------------+--------------------

Comment (by daghf):

To reproduce, build with

{{{
./autogen.des CC=clang --without-jemalloc CFLAGS="-fno-omit-frame-pointer
-fsanitize=address -fsanitize-recover"
}}}

The -fsanitize-recover option lets asan continue after spotting an error
if you also do
{{{
export ASAN_OPTIONS=halt_on_error=0
}}}

to get symbols in the output you also need to set ASAN_SYMBOLIZER_PATH to
point at your llvm-symbolizer application, e.g.
{{{
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6
}}}

Be warned that the signal to noise ratio in the resulting make check test-
suite.log is rather staggering.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1860#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1860: ESI-related memory leaks [ In reply to ]
#1860: ESI-related memory leaks
--------------------+--------------------
Reporter: daghf | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: 4.1.2
Severity: normal | Resolution:
Keywords: |
--------------------+--------------------

Comment (by phk):

It seems like the leak-sanitizer part of address-sanitizer is only
available on Linux:

http://clang.llvm.org/docs/LeakSanitizer.html#id2

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1860#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1860: ESI-related memory leaks [ In reply to ]
#1860: ESI-related memory leaks
--------------------+----------------------------------------
Reporter: daghf | Owner: Poul-Henning Kamp <phk@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: build | Version: 4.1.2
Severity: normal | Resolution: fixed
Keywords: |
--------------------+----------------------------------------
Changes (by Poul-Henning Kamp <phk@…>):

* owner: => Poul-Henning Kamp <phk@…>
* status: new => closed
* resolution: => fixed


Comment:

In [29313f17d58cd36e8926103316ad4e866e195527]:
{{{
#!CommitTicketReference repository=""
revision="29313f17d58cd36e8926103316ad4e866e195527"
Always close the VFP stack, also on BS_NONE.

Fixes: #1860
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1860#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1860: ESI-related memory leaks [ In reply to ]
#1860: ESI-related memory leaks
--------------------+----------------------------------------
Reporter: daghf | Owner: Poul-Henning Kamp <phk@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: build | Version: 4.1.2
Severity: normal | Resolution: fixed
Keywords: |
--------------------+----------------------------------------

Comment (by Lasse Karstensen <lkarsten@…>):

In [36f80ab5c2cb743c78d67c6e0771c3ff972568e2]:
{{{
#!CommitTicketReference repository=""
revision="36f80ab5c2cb743c78d67c6e0771c3ff972568e2"
Always close the VFP stack, also on BS_NONE.

Fixes: #1860
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1860#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs