lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 23 Mar 2021, at 09:09, Sean Conner <sean@conman.org> wrote:

It was thus said that the Great Fontana Nicola once stated:
Il giorno mar, 23/03/2021 alle 00.24 +0000, Thijs Schreijer ha scritto:

If there are any issues, please let me know.

I've been pointed out that passing a "perishable" string to `openlog`
could led to memory corruption because on some systems that pointer is
cached. I solved by applying the following patch:

   https://github.com/ntd/luasyslog/commit/95bdbd389e207931a9c75a8c4d800129b88c690

 I solved that issue by saving the ident string in the Lua registry, and
removing it when calling the wrapper for closelog().

 -spc

@Nicola thx for the heads up, sorry to see I missed your work, could have saved me some.

@Sean I like the registry usage, but was wondering; shouldn’t “close” be called when the library unloads (Lua terminates)? The docs explicitly mention dynamically loaded libraries, and the need to call “close” on unloading.

Thijs


PS. Link referencing the issue: https://www.gnu.org/software/libc/manual/html_node/openlog.html