#0 __libc_do_syscall ()
at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:44
#1 0xb66f6d1e in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2 0xb66f9644 in __GI_abort () at abort.c:89
#3 0xb6f3d93e in zmq::zmq_abort (errmsg_=errmsg_@entry=0xa18f7de0 "\001")
at err.cpp:76
#4 0xb6f403b6 in zmq::msg_t::add_refs (this=0x2, this@entry=0xa18f7224,
refs_=-1233391444) at msg.cpp:252
#5 0xb6f3cc02 in zmq::dist_t::distribute (this=this@entry=0x87b30,
msg_=msg_@entry=0xa18f7224, flags_=flags_@entry=0) at dist.cpp:163
#6 0xb6f3cd30 in zmq::dist_t::send_to_matching (this=this@entry=0x87b30,
msg_=msg_@entry=0xa18f7224, flags_=flags_@entry=0) at dist.cpp:125
#7 0xb6f4eadc in zmq::xpub_t::xsend (this=0x87870, msg_=0xa18f7224, flags_=0)
at xpub.cpp:129
#8 0xb6f47b98 in zmq::socket_base_t::send (this=this@entry=0x87870,
msg_=msg_@entry=0xa18f7224, flags_=flags_@entry=0) at socket_base.cpp:656
#9 0xb6f52692 in s_sendmsg (s_=0x87870, msg_=0xa18f7224, flags_=
排查了好久,因为在其他设备上也运行过同样的代码,都是正常的,只是还了一个环境和编译器而已。以为是zmq的问题,后面一次偶然的打印,发现是前面调用编码函数的对象没有初始化,直接调用函数接口,有些版本编译器不会出段错误,有些就会偶发性出现段错误。这种直接调用未初始化对象的函数,是不安全的。