I see. What do you suggest should be done about the luadbi-mysql port? Surely I can ship prosody with libpthread being preloaded, but that feels pretty hacky and dirty.
Shouldn't other software using the MySQL driver be affected by this as well? On Tue, Feb 16, 2016 at 11:45:13AM +0000, Stuart Henderson wrote: > libpthread is special because it overrides various functions in libc > via weak symbols. In order for this to work properly, libpthread must > be loaded before the main process starts running. > > When you do 'require("dbdmysql")' it loads dbdmysql.so dynamically at > runtime, this pulls in libmysqlcient and its dependencies (including > libpthread) but by this point it's too late to load libpthread. > Using LD_PRELOAD ensures that libpthread is pulled in early enough > that it can be used. > > $ echo 'require("dbdmysql")' | lua51 > lua51: error loading module 'dbdmysql' from file > '/usr/local/lib/lua/5.1/dbdmysql.so': > Cannot load specified object > stack traceback: > [C]: ? > [C]: in function 'require' > stdin:1: in main chunk > [C]: ? > $ echo 'require("dbdmysql")' | LD_PRELOAD=/usr/lib/libpthread.so lua51 > $ >