linux下C使用openssl, 采用多线程,在执行ssl3_connect 时core
大家好!
第一次提问,希望能解决问题。
i have a Problem by using Multithread with openssl .
the Environment:
Linux centOS232 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
the core stack:
#0 asn1_d2i_ex_primitive (pval=0x640280, in=0x7ffff6ffe140, inlen=9, it=0x7ffff77f0840, tag=-1, aclass=0, opt=0 '\000',
ctx=0x7ffff6ffebd0) at tasn_dec.c:770
#1 0x00007ffff75413f2 in ASN1_item_ex_d2i (pval=0x640280, in=0x7ffff6ffe140, len=9, it=0x7ffff77f0840, tag=-1,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:233
#2 0x00007ffff7541ba9 in asn1_template_noexp_d2i (val=0x640280, in=0x7ffff6ffe290, len=9, tt=0x7ffff77f6a40, opt=<value optimized out>,
ctx=0x7ffff6ffebd0) at tasn_dec.c:746
#3 0x00007ffff7541eac in asn1_template_ex_d2i (val=0x640280, in=0x7ffff6ffe290, inlen=<value optimized out>, tt=0x7ffff77f6a40,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:607
#4 0x00007ffff75415ca in ASN1_item_ex_d2i (pval=0x7ffff6ffe328, in=0x7ffff6ffe330, len=9, it=0x7ffff77f01e0, tag=<value optimized out>,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:448
#5 0x00007ffff7541c8f in asn1_template_noexp_d2i (val=0x7ffff6ffe518, in=0x7ffff6ffe520, len=11, tt=0x7ffff77f6aa0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:706
#6 0x00007ffff7541eac in asn1_template_ex_d2i (val=0x7ffff6ffe518, in=0x7ffff6ffe520, inlen=<value optimized out>, tt=0x7ffff77f6aa0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:607
#7 0x00007ffff75414c5 in ASN1_item_ex_d2i (pval=0x7ffff6ffe518, in=0x7ffff6ffe520, len=98, it=0x7ffff77f0220, tag=-1,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:195
#8 0x00007ffff7541c8f in asn1_template_noexp_d2i (val=0x7ffff6ffe6e0, in=0x7ffff6ffe6e8, len=98, tt=0x7ffff77f6ae0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:706
#9 0x00007ffff7541eac in asn1_template_ex_d2i (val=0x7ffff6ffe6e0, in=0x7ffff6ffe6e8, inlen=<value optimized out>, tt=0x7ffff77f6ae0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:607
#10 0x00007ffff75414c5 in ASN1_item_ex_d2i (pval=0x7ffff6ffe6e0, in=0x7ffff6ffe6e8, len=410, it=0x7ffff77f0260, tag=-1,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:195
#11 0x00007ffff753a705 in x509_name_ex_d2i (val=0x63d6f8, in=0x7ffff6ffe830, len=<value optimized out>, it=<value optimized out>,
tag=<value optimized out>, aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at x_name.c:186
#12 0x00007ffff7541083 in ASN1_item_ex_d2i (pval=0x63d6f8, in=0x7ffff6ffe830, len=410, it=0x7ffff77f6a00, tag=-1,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:239
#13 0x00007ffff7541ba9 in asn1_template_noexp_d2i (val=0x63d6f8, in=0x7ffff6ffe980, len=410, tt=0x7ffff77f6b98,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:746
#14 0x00007ffff7541eac in asn1_template_ex_d2i (val=0x63d6f8, in=0x7ffff6ffe980, inlen=<value optimized out>, tt=0x7ffff77f6b98,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:607
#15 0x00007ffff75415ca in ASN1_item_ex_d2i (pval=0x63d620, in=0x7ffff6ffea20, len=410, it=0x7ffff77f02e0, tag=<value optimized out>,
aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:448
#16 0x00007ffff7541ba9 in asn1_template_noexp_d2i (val=0x63d620, in=0x7ffff6ffeb70, len=587, tt=0x7ffff77f6cc0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:746
#17 0x00007ffff7541eac in asn1_template_ex_d2i (val=0x63d620, in=0x7ffff6ffeb70, inlen=<value optimized out>, tt=0x7ffff77f6cc0,
opt=<value optimized out>, ctx=0x7ffff6ffebd0) at tasn_dec.c:607
#18 0x00007ffff75415ca in ASN1_item_ex_d2i (pval=0x7ffff6ffebf8, in=0x7ffff6ffec20, len=587, it=0x7ffff77f0320,
tag=<value optimized out>, aclass=<value optimized out>, opt=0 '\000', ctx=0x7ffff6ffebd0) at tasn_dec.c:448
#19 0x00007ffff7542024 in ASN1_item_d2i (pval=0x7ffff6ffebf8, in=<value optimized out>, len=<value optimized out>,
it=<value optimized out>) at tasn_dec.c:136
#20 0x00007ffff7830c3c in ssl3_get_server_certificate (s=0x62a870) at s3_clnt.c:1125
#21 0x00007ffff7832332 in ssl3_connect (s=0x62a870) at s3_clnt.c:334
#22 0x00007ffff783a3bc in ssl23_get_server_hello (s=0x62a870) at s23_clnt.c:743
#23 ssl23_connect (s=0x62a870) at s23_clnt.c:226
#24 0x00007ffff7ab85fa in ZCY_SSL_create (ssl=0x626940, ssl_ctx=<value optimized out>, bio_ctx=0x626948) at ssl_cliapi.c:267
#25 0x00007ffff701bf12 in Cli_Login (gid=0x7ffff6fff7a0, err=0x7ffff6fff390) at capi.c:1146
#26 0x00007ffff7a89568 in Login (gid=0x7ffff6fff7a0, err=0x7ffff6fff390) at tmcapi.c:137
#27 0x00000000004022cb in send_msg (argv=0x605ed0) at ssl_get_send.c:337
#28 0x0000003efd407851 in start_thread () from /lib64/libpthread.so.0
#29 0x0000003efd0e811d in clone () from /lib64/libc.so.6
thread Support:
i have setted the callback in the ssl code, like the example in "crypto/threads/mttest.c" .
question:
but the same code in the other machine2[Linux ph-suse 2.6.27.19-5-default #1 SMP 2009-02-28 04:40:21 +0100 x86_64 x86_64 x86_64 GNU/Linux] is success。 i used the 'ldd' to check whether the libs is different in machine2, but they are same.
who can help me? thank you!