> -----Original Message-----
> From: owner-openssl-us...@openssl.org [mailto:owner-openssl-
> us...@openssl.org] On Behalf Of Dr. Stephen Henson
> Sent: Wednesday, January 15, 2014 6:30 PM
> To: openssl-users@openssl.org
> Subject: Re: Deadlock in openssl1.0.1e.
> 
> On Wed, Jan 15, 2014, Tayade, Nilesh wrote:
> 
> >
> >
> > Thanks for your suggestions. I did try capturing the debug information and
> below is how the state of the locks is. The array per lock stores information 
> of
> the owner, file and lock_present i.e. lock is held or not.
> > I see that the lock # 18 is held but when thread 19 was waiting, it was 
> > trying
> for lock # 19. Not sure what's going on.
> >
> > (gdb) p ssl_locks[18]
> > $22 = {
> >    thread_id = 140003803043584,
> >    file_name = "md_rand.c", '\000' <repeats 30 times>,
> >    file_name_len = 9,
> >    line = 384,
> >    lock_present = 1
> > }
> > (gdb) p ssl_locks[19]
> > $23 = {
> >    thread_id = 140003803043584,
> >    file_name = "md_rand.c", '\000' <repeats 30 times>,
> >    file_name_len = 9,
> >    line = 389,
> >    lock_present = 0
> > }
> >
> >
> 
> By that I'm assuming it has acquired lock 18 and is attempting to get 19 but
> failing because another thread already has it?
> 
> If so you need to know which thread has lock 19 and why it hasn't released it.
> One way to do that is to store the details of each lock in a static array.
> 

Thanks. I have already captured the lock details in an array. Please see below. 
The leftmost digit is lock number index.
Lock 19 was taken by same thread and it was released (lock_present = 0). And 
this is causing confusion for me.

0 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
1 {thread_id = 140009934862112,     file_name = "err.c", '\000' <repeats 34 
times>, file_name_len = 5, line = 408, lock_present = 0},
2 {thread_id = 140003819828992,  file_name = "ex_data.c", '\000' <repeats 30 
times>, file_name_len = 9, line = 511, lock_present = 0},
3 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
4 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
5 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
6 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
7 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
8 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
9 {thread_id = 140003803043584, file_name = "rsa_eay.c", '\000' <repeats30 
times>, file_name_len = 9, line = 313, lock_present = 0},
10 {thread_id = 140003819828992, file_name = "p_lib.c", '\000' <repeats 32 
times>, file_name_len = 7, line = 393, lock_present = 0},
11 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
12 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
13 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
14 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
15 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
16 {thread_id = 140009934862112,file_name = "ssl_ciph.c", '\000' <repeats 29 
times>, file_name_len = 10, line = 481, lock_present = 0},
17 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
18 {thread_id = 140003803043584, file_name = "md_rand.c", '\000' <repeats 30 
times>, file_name_len = 9, line = 384, lock_present = 1},
19 {thread_id = 140003803043584, file_name = "md_rand.c", '\000' <repeats 30 
times>, file_name_len = 9, line = 389, lock_present = 0},
20 {thread_id = 140009934862112, file_name = "mem_dbg.c", '\000' <repeats 30 
times>, file_name_len = 9, line = 282, lock_present = 0},
21 {thread_id = 140003819828992, file_name = "bio_lib.c", '\000' <repeats 30 
times>, file_name_len = 9, line = 117, lock_present = 0},
22 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
23 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
24 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
25 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
26 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
27 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
28 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
29 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0},
30 {thread_id = 140009934862112,file_name = "tb_asnmth.c", '\000' <repeats 28 
times>, file_name_len = 11, line = 244, lock_present = 0}
31 {thread_id = 0, file_name = '\000' <repeats 39 times>, file_name_len = 0, 
line = 0, lock_present = 0} *<repeats 11 times>*}


> Steve.
> --
> Dr Stephen N. Henson. OpenSSL project core developer.
> Commercial tech support now available see: http://www.openssl.org

--
Thanks,
Nilesh

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to