Hey, On Tue, Feb 16, 2016 at 11:08:58AM +0000, Stuart Henderson wrote: > Good point. Try adding > "prosody:setenv=LD_PRELOAD=/usr/lib/libpthread.so:tc=daemon:" to > /etc/login.conf and start it via the rc script.
This works. Seems that libpthread is not loaded by the linker automatically. Not sure I understand why, as it's already loaded before by the lua binary, in which case it works fine. ada ~ # LD_DEBUG="" LD_PRELOAD=/usr/lib/libpthread.so lua51 rtld loading: 'lua51' exe load offset: 0x8dd71400000 flags lua51 = 0x0 head lua51 obj lua51 has lua51 as head flags /usr/lib/libpthread.so.19.0 = 0x68 obj /usr/lib/libpthread.so.19.0 has lua51 as head objname /usr/lib/libpthread.so.19.0 is nodelete linking dep /usr/lib/libpthread.so.19.0 as child of lua51 examining: 'lua51' loading: libm.so.9.0 required by lua51 flags /usr/lib/libm.so.9.0 = 0x0 obj /usr/lib/libm.so.9.0 has lua51 as head loading: libc.so.80.1 required by lua51 flags /usr/lib/libc.so.80.1 = 0x0 obj /usr/lib/libc.so.80.1 has lua51 as head loading: libcurses.so.14.0 required by lua51 flags /usr/lib/libcurses.so.14.0 = 0x0 obj /usr/lib/libcurses.so.14.0 has lua51 as head loading: libedit.so.5.2 required by lua51 flags /usr/lib/libedit.so.5.2 = 0x0 obj /usr/lib/libedit.so.5.2 has lua51 as head linking dep /usr/lib/libm.so.9.0 as child of lua51 linking dep /usr/lib/libedit.so.5.2 as child of lua51 linking dep /usr/lib/libcurses.so.14.0 as child of lua51 linking dep /usr/lib/libc.so.80.1 as child of lua51 examining: '/usr/lib/libpthread.so.19.0' examining: '/usr/lib/libm.so.9.0' examining: '/usr/lib/libedit.so.5.2' examining: '/usr/lib/libcurses.so.14.0' examining: '/usr/lib/libc.so.80.1' flags /usr/libexec/ld.so = 0x0 obj /usr/libexec/ld.so has lua51 as head relocation took 0.001095 Start End Type Open Ref GrpRef Name 000008dd71400000 000008dd7182c000 exe 1 0 0 lua51 000008dfadcde000 000008dfae0f0000 rlib 0 2 0 /usr/lib/libpthread.so.19.0 000008dfa7b97000 000008dfa7fbf000 rlib 0 1 0 /usr/lib/libm.so.9.0 000008dfecb2b000 000008dfecf5e000 rlib 0 1 0 /usr/lib/libedit.so.5.2 000008dfae595000 000008dfae9ef000 rlib 0 1 0 /usr/lib/libcurses.so.14.0 000008e05408e000 000008e054568000 rlib 0 1 0 /usr/lib/libc.so.80.1 000008dfdc500000 000008dfdc500000 rtld 0 1 0 /usr/libexec/ld.so symcache lookups 367 hits 0 ratio 0% hits dynamic loading done, success. doing ctors obj 0x8dfb5237800 @0x8dfadce2ca0: [/usr/lib/libpthread.so.19.0] doing ctors obj 0x8e006c99000 @0x8dfa7b9b500: [/usr/lib/libm.so.9.0] doing ctors obj 0x8e006c98c00 @0x8dfecb32e80: [/usr/lib/libedit.so.5.2] doing ctors obj 0x8e006c99400 @0x8dfae5a7bc0: [/usr/lib/libcurses.so.14.0] doing ctors obj 0x8dfb5237c00 @0x8e0540ad8c0: [/usr/lib/libc.so.80.1] entry point: 0x8dd71406470 dlctl: _dl_thread_fnc set to 0x8dfadce4f50 dlctl: _dl_bind_lock_f set to 0x8dfadce4a60 Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio > require("dbdmysql") dlopen: loading: /usr/local/lib/lua/5.1/dbdmysql.so flags /usr/local/lib/lua/5.1/dbdmysql.so = 0x0 head /usr/local/lib/lua/5.1/dbdmysql.so obj /usr/local/lib/lua/5.1/dbdmysql.so has /usr/local/lib/lua/5.1/dbdmysql.so as head linking /usr/local/lib/lua/5.1/dbdmysql.so as dlopen()ed head [/usr/local/lib/lua/5.1/dbdmysql.so] examining: '/usr/local/lib/lua/5.1/dbdmysql.so' loading: libmysqlclient.so.25.0 required by /usr/local/lib/lua/5.1/dbdmysql.so flags /usr/local/lib/libmysqlclient.so.25.1 = 0x0 obj /usr/local/lib/libmysqlclient.so.25.1 has /usr/local/lib/lua/5.1/dbdmysql.so as head linking dep /usr/local/lib/libmysqlclient.so.25.1 as child of /usr/local/lib/lua/5.1/dbdmysql.so examining: '/usr/local/lib/libmysqlclient.so.25.1' loading: libssl.so.35.0 required by /usr/local/lib/libmysqlclient.so.25.1 flags /usr/lib/libssl.so.35.0 = 0x0 obj /usr/lib/libssl.so.35.0 has /usr/local/lib/lua/5.1/dbdmysql.so as head loading: libz.so.5.0 required by /usr/local/lib/libmysqlclient.so.25.1 flags /usr/lib/libz.so.5.0 = 0x0 obj /usr/lib/libz.so.5.0 has /usr/local/lib/lua/5.1/dbdmysql.so as head loading: libm.so.9.0 required by /usr/local/lib/libmysqlclient.so.25.1 loading: libpthread.so.19.0 required by /usr/local/lib/libmysqlclient.so.25.1 loading: libcrypto.so.35.0 required by /usr/local/lib/libmysqlclient.so.25.1 flags /usr/lib/libcrypto.so.35.0 = 0x0 obj /usr/lib/libcrypto.so.35.0 has /usr/local/lib/lua/5.1/dbdmysql.so as head loading: libstdc++.so.57.0 required by /usr/local/lib/libmysqlclient.so.25.1 flags /usr/lib/libstdc++.so.57.0 = 0x0 obj /usr/lib/libstdc++.so.57.0 has /usr/local/lib/lua/5.1/dbdmysql.so as head linking dep /usr/lib/libpthread.so.19.0 as child of /usr/local/lib/libmysqlclient.so.25.1 linking dep /usr/lib/libz.so.5.0 as child of /usr/local/lib/libmysqlclient.so.25.1 linking dep /usr/lib/libssl.so.35.0 as child of /usr/local/lib/libmysqlclient.so.25.1 linking dep /usr/lib/libcrypto.so.35.0 as child of /usr/local/lib/libmysqlclient.so.25.1 linking dep /usr/lib/libstdc++.so.57.0 as child of /usr/local/lib/libmysqlclient.so.25.1 linking dep /usr/lib/libm.so.9.0 as child of /usr/local/lib/libmysqlclient.so.25.1 examining: '/usr/lib/libz.so.5.0' examining: '/usr/lib/libssl.so.35.0' loading: libcrypto.so.35.0 required by /usr/lib/libssl.so.35.0 linking dep /usr/lib/libcrypto.so.35.0 as child of /usr/lib/libssl.so.35.0 examining: '/usr/lib/libcrypto.so.35.0' examining: '/usr/lib/libstdc++.so.57.0' loading: libm.so.9.0 required by /usr/lib/libstdc++.so.57.0 linking dep /usr/lib/libm.so.9.0 as child of /usr/lib/libstdc++.so.57.0 tail /usr/local/lib/lua/5.1/dbdmysql.so doing ctors obj 0x8dfaa8e1400 @0x8dfb9068de0: [/usr/lib/libz.so.5.0] doing ctors obj 0x8dfaa8e1c00 @0x8df7a162220: [/usr/lib/libcrypto.so.35.0] doing ctors obj 0x8dfaa8e1000 @0x8e03fc6ca80: [/usr/lib/libssl.so.35.0] doing ctors obj 0x8e006c98000 @0x8dfee47d1b0: [/usr/lib/libstdc++.so.57.0] doing ctors obj 0x8e006c98400 @0x8dfacf8f600: [/usr/local/lib/libmysqlclient.so.25.1] doing ctors obj 0x8e006c99c00 @0x8df73465bd0: [/usr/local/lib/lua/5.1/dbdmysql.so] dlopen: /usr/local/lib/lua/5.1/dbdmysql.so: done (success). dlsym: luaopen_dbdmysql in /usr/local/lib/lua/5.1/dbdmysql.so: 0x8df734663f0