]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: trace: fix a typo causing an incorrect startup error
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Nov 2019 18:43:31 +0000 (19:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Nov 2019 18:47:22 +0000 (19:47 +0100)
Since commit 88ebd40 ("MINOR: trace: add allocation of buffer-sized
trace buffers") we have a trace buffer allocated at boot time. But
there was a copy-paste error there making the test verify that the
trash was allocated instead of the trace buffer. The result is that
depending on the link order either the test will succeed or fail,
preventing haproxy from starting at all.

No backport is needed.

src/trace.c

index 220bf66b6ca92ddfa305e1c4dfe55a5421d45f10..06fec4a2b5f81b8ced5ca339ca48c1bdfb39cb0e 100644 (file)
@@ -37,7 +37,7 @@ THREAD_LOCAL struct buffer trace_buf = { };
 static int alloc_trace_buffers_per_thread()
 {
        chunk_init(&trace_buf, my_realloc2(trace_buf.area, global.tune.bufsize), global.tune.bufsize);
-       return !!trash.area;
+       return !!trace_buf.area;
 }
 
 static void free_trace_buffers_per_thread()