【发布时间】:2018-04-14 22:20:14
【问题描述】:
当我调用我的多线程 perl 脚本时,在少数情况下,它会抛出一些类似于以下内容的异常。很抱歉我无法共享代码。但如果真的需要,我可以尝试构建一个 sn-p(如果真的需要)。因为我想这应该有一些理论上的答案。
*** glibc detected *** perl: double free or corruption (!prev): 0x00007f775401e9a0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3d74c75e66]
/lib64/libc.so.6[0x3d74c789b3]
/lib64/libc.so.6[0x3d74c7b880]
/lib64/libc.so.6(realloc+0xe5)[0x3d74c7baf5]
/usr/lib/../lib64/libcrypto.so.10(CRYPTO_realloc+0x5f)[0x7f775907bd8f]
/usr/lib/../lib64/libcrypto.so.10(lh_insert+0xee)[0x7f77590f763e]
/usr/lib/../lib64/libcrypto.so.10(OBJ_NAME_add+0x6b)[0x7f775907f12b]
/usr/lib/../lib64/libcrypto.so.10(EVP_add_cipher+0x27)[0x7f7759102387]
/usr/lib/../lib64/libcrypto.so.10(OpenSSL_add_all_ciphers+0x4b7)[0x7f7759106a07]
/usr/lib/../lib64/libcrypto.so.10(OPENSSL_add_all_algorithms_noconf+0xe)[0x7f775910653e]
/usr/local/lib/libssh2.so.1(libssh2_init+0x39)[0x7f77596800b9]
为什么会出现这样的错误?
我正在使用 Thread::Queue;使用线程::共享;请让我知道您的看法。
以下是线程库版本信息。
use threads; - installed v2.15 (latest - 2.16)
use Thread::Queue; - installed v3.12 (up to date)
use threads::shared; - installed v1.56 (latest - 1.57)
perl - installed v5.26.1
其他库有::
use YAML::XS 'LoadFile'; - 0.66 up to date
use Net::Netconf::Manager; - 1.02 up to date
use Config::Properties; - 1.80 up to date
use Sys::Syslog; - 0.35 up to date
use DateTime::Format::Strptime; - 1.74 up to date
use DateTime; - 1.44 up to date
use XML::LibXML; - 2.0129 (latest 2.0139)
use Regexp::Common qw/net/; - 2017060201 up to date
use Getopt::Long; - 2.5 up to date
【问题讨论】:
-
我们至少需要知道您正在使用哪些其他库(包括版本和 perl 版本)。但是如果没有一段可重现的代码,我们就无法可靠地回答。
-
你的截图提到
Net::SSH2:About Net::SSH2 thread safety
标签: multithreading perl memory-management scripting threadpool