Closed aaronovz1 closed 6 years ago
Fixed in libzmq 4.2.4
@bluca I see some discussion around this mutex issue. However, I'm using the latest stable release zmq 4.2.5 and still see this core stack.
ZMQ: https://github.com/zeromq/libzmq/tree/v4.2.5 OS: Linux
Can you please help to debug?
Thank you.
Either use a new enough compiler:
#if __cplusplus >= 201103L \
|| (defined(__cpp_threadsafe_static_init) \
&& __cpp_threadsafe_static_init >= 200806)
Or use libsodium
Thank you for the quick response @bluca .
I even tried using libsodium, but it failed here to make a syscall for getrandom. I'm using Linux kernel 4.1.2 so this syscall should be supported.
Let me know if there is anything else to be installed/updated.
(gdb) bt
Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
#0 0x45dee2dc in syscall () from /tmp/rtsplus/lib/libc.so.6
#1 0x462cd70c in _randombytes_linux_getrandom (size=<optimized out>, buf=<optimized out>) at /usr/src/debug/libsodium/1.0.3-r0.0/git/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:144
#2 randombytes_linux_getrandom (buf_=<optimized out>, size=16) at /usr/src/debug/libsodium/1.0.3-r0.0/git/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:161
#3 0x462cd7c8 in randombytes_sysrandom_init () at /usr/src/debug/libsodium/1.0.3-r0.0/git/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:181
#4 randombytes_sysrandom_stir () at /usr/src/debug/libsodium/1.0.3-r0.0/git/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:209
#5 0x462cc950 in sodium_init () at /usr/src/debug/libsodium/1.0.3-r0.0/git/src/libsodium/sodium/core.c:20
#6 0x46344b68 in manage_random (init=true) at /usr/src/debug/libzmq/4.2.5-r0/zeromq-4.2.5/src/random.cpp:152
#7 zmq::random_open () at /usr/src/debug/libzmq/4.2.5-r0/zeromq-4.2.5/src/random.cpp:162
#8 0x46320e5c in zmq::ctx_t::ctx_t (this=0x35630) at /usr/src/debug/libzmq/4.2.5-r0/zeromq-4.2.5/src/ctx.cpp:91
#9 0x46368348 in zmq_ctx_new () at /usr/src/debug/libzmq/4.2.5-r0/zeromq-4.2.5/src/zmq.cpp:135
#10 0x463684e4 in zmq_init (io_threads_=1) at /usr/src/debug/libzmq/4.2.5-r0/zeromq-4.2.5/src/zmq.cpp:196
#11 0x463d2b24 in zctx__initialize_underlying (self=0x35128) at /usr/src/debug/libczmq/3.0.2-r0.0/git/src/zctx.c:272
#12 0x463d2bdc in zctx__socket_new (self=0x35128, type=1178414044, type@entry=8) at /usr/src/debug/libczmq/3.0.2-r0.0/git/src/zctx.c:286
#13 0x463d8978 in zsocket_new (ctx=<optimized out>, type=type@entry=8) at /usr/src/debug/libczmq/3.0.2-r0.0/git/src/zsocket.c:34
I have no idea - but try to use your distro's library rather than rebuilding it
@bluca I use the below config in my bitbake recipe so it should take the distro's libsodium version only. PACKAGECONFIG ??= "libsodium" PACKAGECONFIG[libsodium] = "--with-libsodium, --without-libsodium, libsodium"
Anyways, I'm looking around for ways to resolve it. Appreciate your help. :)
When compiling against latest libzmq release 4.2.3, static builds throw an abort on app closure when destructing the static context in actor (actor_pipectx).
I believe this is because libzmq now has a global static mutex in random.cpp (random_sync) and it is being destructed before actor_pipectx because the order of destruction of these globals can not be controlled.