【发布时间】:2017-06-03 12:06:16
【问题描述】:
我在文件中的属性构造函数“ConnectionInit”中有这样的代码,用C编写。
SSL_load_error_strings();
SSL_library_init();
DefaultSSLConnectionContext = SSL_CTX_new(SSLv23_client_method ());
当我将它与 protobuf 生成的 pb.cc 文件链接时(不调用它的代码,只是链接),它以这样的转储为核心:
#0 0x00007f269454acea in pthread_rwlock_wrlock () from /lib64/libpthread.so.0
#0 0x00007f269454acea in pthread_rwlock_wrlock () from /lib64/libpthread.so.0
#1 0x00007f26843dbcbb in ?? () from /usr/lib64/libcrypto.so.10
#2 0x00007f26843dba0b in ?? () from /usr/lib64/libcrypto.so.10
#3 0x00007f26843db3bc in ?? () from /usr/lib64/libcrypto.so.10
#4 0x00007f26843dc9b1 in ERR_load_ERR_strings () from /usr/lib64/libcrypto.so.10
#5 0x00007f26843dcb99 in ERR_load_crypto_strings () from /usr/lib64/libcrypto.so.10
#6 0x00007f268471ced9 in SSL_load_error_strings () from /usr/lib64/libssl.so.10
#7 0x00007f26778414f9 in ConnectionInit (verbose=0) at connection.c:79
#8 0x00007f2695a5f74f in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#9 0x00007f2695a63f75 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#10 0x00007f2695a5f366 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00007f2695a6371a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#12 0x00007f2693fa8f66 in dlopen_doit () from /lib64/libdl.so.2
#13 0x00007f2695a5f366 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#14 0x00007f2693fa929c in _dlerror_run () from /lib64/libdl.so.2
#15 0x00007f2693fa8ee1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
我检查了 protobuf 是否使用 libssl。但事实并非如此。 *.pb.cc 文件如何影响我的 openSSL 初始化?
【问题讨论】:
-
请说明OpenSSL的位置;并显示您的编译和链接命令。您不需要显示所有正在编译的源文件;只是一些,所以我们可以看到你是如何编译的。
-
相关,
SSL_CTX_new(SSLv23_client_method ())有一些改进的机会。查看 OpenSSL wiki 上的 TLS Client。它在 SSL 上下文中做得更多。 -
这可能是相关的... OpenSSL 最近遇到了 1.1.0 Master 的问题。看起来它很快就被修复了,但它影响了一些 Debian 系统。我猜那些受影响的人启用了测试或提议。见Issue 3615, thread issues on thread termination。
标签: c openssl protocol-buffers core protobuf-c