]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: lua-thread: some parts must be initialized once
authorThierry Fournier <thierry.fournier@ozon.io>
Fri, 4 Dec 2020 10:47:47 +0000 (11:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2020 10:55:05 +0000 (11:55 +0100)
commitaafc777854e55ec0956b0c64484025ca7293dc1c
tree995a94dd99c84ede67cb4d15a57a6890d5ce826e
parent51058d64a68d147f8396016c1917e64f5d3e5c72
BUG/MEDIUM: lua-thread: some parts must be initialized once

Lua dedicated TCP, HTTP and SSL socket and proxies must be initialized
once. Right now, they are initialized from the Lua init state, but since
commit 59f11be43 ("MEDIUM: lua-thread: Add the lua-load-per-thread
directive") this function is called one time per lua context. This
caused some fields to be cleared and overwritten, and pre-allocated
object to be lost. This is why the address sanitizer detected memory
leaks from the socket_ssl server initialization.

Let's move all the state-independent part of the function to the
hlua_init() function to avoid this.

No backport is needed, this is only 2.4-dev.
src/hlua.c