]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: logs/threads: properly split the log area upon startup
authorWilly Tarreau <w@1wt.eu>
Sun, 5 May 2019 08:11:39 +0000 (10:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 5 May 2019 08:16:13 +0000 (10:16 +0200)
commit55e2f5ad14a6d9ec39c218296ad3f1a521cc74a1
tree029d67fea0a823a84e1561e2cd133e0b10cc0ef9
parent4fc49a9aabacc8028877e2dcbdb54d8a19c398c4
BUG/MINOR: logs/threads: properly split the log area upon startup

If logs were emitted before creating the threads, then the dataptr pointer
keeps a copy of the end of the log header. Then after the threads are
created, the headers are reallocated for each thread. However the end
pointer was not reset until the end of the first second, which may result
in logs emitted by multiple threads during the first second to be mangled,
or possibly in some cases to use a memory area that was reused for something
else. The fix simply consists in reinitializing the end pointers immediately
when the threads are created.

This fix must be backported to 1.9 and 1.8.
src/log.c