<p>Not sure if this helps, each crash follows a slightly different path with-in 'modules/tls/tls_server.c' but always crashes in 'aes_ecb_cipher' at 'crypto/evp/e_aes.c:2699'.</p>
<p>Here's our most recent core dump.</p>
<p>(gdb) bt<br>
#0  0x00007f264161d6de in aes_ecb_cipher (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 "", in=0x7f25f5ad4398 "\251\333\023<code>a>EBi\r\035\216Z\241Z}\200\\\345/-\340{", len=0) at crypto/evp/e_aes.c:2699 #1  0x00007f264162b755 in evp_EncryptDecryptUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 "", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 "\251\333\023</code>a>EBi\r\035\216Z\241Z}\200\\345/-\340{", inl=16) at crypto/evp/evp_enc.c:333<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="41491271" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/2" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/2/hovercard" href="https://github.com/kamailio/kamailio/pull/2">#2</a>  0x00007f264162b9a0 in EVP_EncryptUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 "", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 "\251\333\023<code>a>EBi\r\035\216Z\241Z}\200\\\345/-\340{", inl=16) at crypto/evp/evp_enc.c:385 #3  0x00007f264162b38e in EVP_CipherUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 "", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 "\251\333\023</code>a>EBi\r\035\216Z\241Z}\200\\345/-\340{", inl=16) at crypto/evp/evp_enc.c:213<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="49856885" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/4" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/4/hovercard" href="https://github.com/kamailio/kamailio/pull/4">#4</a>  0x00007f2641669a01 in drbg_ctr_generate (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 "", outlen=32, adin=0x0, adinlen=0) at crypto/rand/drbg_ctr.c:340<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="51480460" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/5" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/5/hovercard" href="https://github.com/kamailio/kamailio/issues/5">#5</a>  0x00007f264166af15 in RAND_DRBG_generate (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 "", outlen=32, prediction_resistance=0, adin=0x0, adinlen=0) at crypto/rand/drbg_lib.c:638<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="51489870" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/6" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/6/hovercard" href="https://github.com/kamailio/kamailio/issues/6">#6</a>  0x00007f264166b043 in RAND_DRBG_bytes (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 "", outlen=32) at crypto/rand/drbg_lib.c:679<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="51492477" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/7" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/7/hovercard" href="https://github.com/kamailio/kamailio/issues/7">#7</a>  0x00007f264166b5bc in drbg_bytes (out=0x7f25f6afec90 "", count=32) at crypto/rand/drbg_lib.c:968<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="51499233" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/8" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/8/hovercard" href="https://github.com/kamailio/kamailio/issues/8">#8</a>  0x00007f264166cb2f in RAND_bytes (buf=0x7f25f6afec90 "", num=32) at crypto/rand/rand_lib.c:836<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="51703057" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/9" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/9/hovercard" href="https://github.com/kamailio/kamailio/issues/9">#9</a>  0x00007f26419f0d33 in def_generate_session_id (ssl=0x7f25f6a6c540, id=0x7f25f6afec90 "", id_len=0x7ffc6679a534) at ssl/ssl_sess.c:290<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52436308" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/10" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/10/hovercard" href="https://github.com/kamailio/kamailio/pull/10">#10</a> 0x00007f26419f0f22 in ssl_generate_session_id (s=0x7f25f6a6c540, ss=0x7f25f6afeb38) at ssl/ssl_sess.c:362<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52569646" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/11" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/11/hovercard" href="https://github.com/kamailio/kamailio/issues/11">#11</a> 0x00007f26419f113e in ssl_get_new_session (s=0x7f25f6a6c540, session=1) at ssl/ssl_sess.c:418<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52744476" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/12" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/12/hovercard" href="https://github.com/kamailio/kamailio/pull/12">#12</a> 0x00007f2641a188f0 in tls_early_post_process_client_hello (s=0x7f25f6a6c540) at ssl/statem/statem_srvr.c:1817<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52784350" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/13" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/13/hovercard" href="https://github.com/kamailio/kamailio/pull/13">#13</a> 0x00007f2641a19900 in tls_post_process_client_hello (s=0x7f25f6a6c540, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:2222<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52819753" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/14" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/14/hovercard" href="https://github.com/kamailio/kamailio/pull/14">#14</a> 0x00007f2641a173dc in ossl_statem_server_post_process_message (s=0x7f25f6a6c540, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:1220<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="52852064" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/15" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/15/hovercard" href="https://github.com/kamailio/kamailio/issues/15">#15</a> 0x00007f2641a03a04 in read_state_machine (s=0x7f25f6a6c540) at ssl/statem/statem.c:664<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53297477" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/16" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/16/hovercard" href="https://github.com/kamailio/kamailio/pull/16">#16</a> 0x00007f2641a03364 in state_machine (s=0x7f25f6a6c540, server=1) at ssl/statem/statem.c:434<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53387906" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/17" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/17/hovercard" href="https://github.com/kamailio/kamailio/pull/17">#17</a> 0x00007f2641a02e89 in ossl_statem_accept (s=0x7f25f6a6c540) at ssl/statem/statem.c:255<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53397137" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/18" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/18/hovercard" href="https://github.com/kamailio/kamailio/pull/18">#18</a> 0x00007f26419e952c in SSL_do_handshake (s=0x7f25f6a6c540) at ssl/ssl_lib.c:3599<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53511603" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/19" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/19/hovercard" href="https://github.com/kamailio/kamailio/pull/19">#19</a> 0x00007f26419e55f5 in SSL_accept (s=0x7f25f6a6c540) at ssl/ssl_lib.c:1643<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53562369" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/20" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/20/hovercard" href="https://github.com/kamailio/kamailio/pull/20">#20</a> 0x00007f26360480f2 in tls_accept (c=0x7f25f6aa1010, error=0x7ffc667ba98c) at tls_server.c:422<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53562546" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/21" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/21/hovercard" href="https://github.com/kamailio/kamailio/issues/21">#21</a> 0x00007f26360515fe in tls_read_f (c=0x7f25f6aa1010, flags=0x7ffc667bacc8) at tls_server.c:1119<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53569003" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/22" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/22/hovercard" href="https://github.com/kamailio/kamailio/pull/22">#22</a> 0x000055a6ac69fc43 in tcp_read_headers (c=0x7f25f6aa1010, read_flags=0x7ffc667bacc8) at core/tcp_read.c:469<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53897061" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/23" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/23/hovercard" href="https://github.com/kamailio/kamailio/pull/23">#23</a> 0x000055a6ac6a77e9 in tcp_read_req (con=0x7f25f6aa1010, bytes_read=0x7ffc667baccc, read_flags=0x7ffc667bacc8) at core/tcp_read.c:1496<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="53988785" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/24" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/24/hovercard" href="https://github.com/kamailio/kamailio/issues/24">#24</a> 0x000055a6ac6ac757 in handle_io (fm=0x7f264284c438, events=1, idx=-1) at core/tcp_read.c:1804<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="54025498" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/25" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/25/hovercard" href="https://github.com/kamailio/kamailio/pull/25">#25</a> 0x000055a6ac69a2c0 in io_wait_loop_epoll (h=0x55a6acb783a0 <io_w>, t=2, repeat=0) at core/io_wait.h:1065<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="54052425" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/26" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/26/hovercard" href="https://github.com/kamailio/kamailio/pull/26">#26</a> 0x000055a6ac6ae76a in tcp_receive_loop (unix_sock=86) at core/tcp_read.c:1974<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="54054848" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/27" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/27/hovercard" href="https://github.com/kamailio/kamailio/pull/27">#27</a> 0x000055a6ac561f12 in tcp_init_children () at core/tcp_main.c:4853<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="54070295" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/28" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/28/hovercard" href="https://github.com/kamailio/kamailio/pull/28">#28</a> 0x000055a6ac4994ac in main_loop () at main.c:1745<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="54103137" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/29" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/29/hovercard" href="https://github.com/kamailio/kamailio/issues/29">#29</a> 0x000055a6ac4a046e in main (argc=13, argv=0x7ffc667bb338) at main.c:2696</p>
<p>Here's the disas of aes_ecb_cipher, it was doing a move from memory pointed to in the %rax register plus an offset of 0xf8, to the %rax register.</p>
<p>(gdb) disas aes_ecb_cipher<br>
Dump of assembler code for function aes_ecb_cipher:<br>
0x00007f264161d67d <+0>:     push   %rbp<br>
0x00007f264161d67e <+1>:     mov    %rsp,%rbp<br>
0x00007f264161d681 <+4>:     sub    $0x40,%rsp<br>
0x00007f264161d685 <+8>:     mov    %rdi,-0x28(%rbp)<br>
0x00007f264161d689 <+12>:    mov    %rsi,-0x30(%rbp)<br>
0x00007f264161d68d <+16>:    mov    %rdx,-0x38(%rbp)<br>
0x00007f264161d691 <+20>:    mov    %rcx,-0x40(%rbp)<br>
0x00007f264161d695 <+24>:    mov    -0x28(%rbp),%rax<br>
0x00007f264161d699 <+28>:    mov    %rax,%rdi<br>
0x00007f264161d69c <+31>:    callq  0x7f264162cf2a <EVP_CIPHER_CTX_block_size><br>
0x00007f264161d6a1 <+36>:    cltq<br>
0x00007f264161d6a3 <+38>:    mov    %rax,-0x10(%rbp)<br>
0x00007f264161d6a7 <+42>:    mov    -0x28(%rbp),%rax<br>
0x00007f264161d6ab <+46>:    mov    %rax,%rdi<br>
0x00007f264161d6ae <+49>:    callq  0x7f264162cfe5 <EVP_CIPHER_CTX_get_cipher_data><br>
0x00007f264161d6b3 <+54>:    mov    %rax,-0x18(%rbp)<br>
0x00007f264161d6b7 <+58>:    mov    -0x40(%rbp),%rax<br>
0x00007f264161d6bb <+62>:    cmp    -0x10(%rbp),%rax<br>
0x00007f264161d6bf <+66>:    jae    0x7f264161d6c8 <aes_ecb_cipher+75><br>
0x00007f264161d6c1 <+68>:    mov    $0x1,%eax<br>
0x00007f264161d6c6 <+73>:    jmp    0x7f264161d71b <aes_ecb_cipher+158><br>
0x00007f264161d6c8 <+75>:    movq   $0x0,-0x8(%rbp)<br>
0x00007f264161d6d0 <+83>:    mov    -0x10(%rbp),%rax<br>
0x00007f264161d6d4 <+87>:    sub    %rax,-0x40(%rbp)<br>
0x00007f264161d6d8 <+91>:    jmp    0x7f264161d70c <aes_ecb_cipher+143><br>
0x00007f264161d6da <+93>:    mov    -0x18(%rbp),%rax<br>
=> 0x00007f264161d6de <+97>:    mov    0xf8(%rax),%rax<br>
0x00007f264161d6e5 <+104>:   mov    -0x18(%rbp),%rdx<br>
0x00007f264161d6e9 <+108>:   mov    -0x30(%rbp),%rsi<br>
0x00007f264161d6ed <+112>:   mov    -0x8(%rbp),%rcx<br>
0x00007f264161d6f1 <+116>:   add    %rcx,%rsi<br>
0x00007f264161d6f4 <+119>:   mov    -0x38(%rbp),%rdi<br>
0x00007f264161d6f8 <+123>:   mov    -0x8(%rbp),%rcx<br>
0x00007f264161d6fc <+127>:   add    %rdi,%rcx<br>
0x00007f264161d6ff <+130>:   mov    %rcx,%rdi<br>
0x00007f264161d702 <+133>:   callq  *%rax<br>
0x00007f264161d704 <+135>:   mov    -0x10(%rbp),%rax<br>
0x00007f264161d708 <+139>:   add    %rax,-0x8(%rbp)<br>
0x00007f264161d70c <+143>:   mov    -0x8(%rbp),%rax<br>
0x00007f264161d710 <+147>:   cmp    -0x40(%rbp),%rax<br>
0x00007f264161d714 <+151>:   jbe    0x7f264161d6da <aes_ecb_cipher+93><br>
0x00007f264161d716 <+153>:   mov    $0x1,%eax<br>
0x00007f264161d71b <+158>:   leaveq<br>
0x00007f264161d71c <+159>:   retq<br>
End of assembler dump.</p>
<p>If we look at the register, the problem is %rax is 0.</p>
<p>(gdb) i r<br>
rax            0x0      0<br>
rbx            0x50     80<br>
rcx            0x10     16<br>
rdx            0x7f25f5ad4398   139801012290456<br>
rsi            0x7f25f6afec90   139801029242000<br>
rdi            0x7f25f5ad4480   139801012290688<br>
rbp            0x7ffc6679a290   0x7ffc6679a290<br>
rsp            0x7ffc6679a250   0x7ffc6679a250<br>
r8             0x10     16<br>
r9             0x0      0<br>
r10            0x0      0<br>
r11            0x202    514<br>
r12            0x55a6ac8570b3   94174347358387<br>
r13            0x40000000       1073741824<br>
r14            0x10000000       268435456<br>
r15            0x6      6<br>
rip            0x7f264161d6de   0x7f264161d6de <aes_ecb_cipher+97><br>
eflags         0x10246  [ PF ZF IF RF ]<br>
cs             0x33     51<br>
ss             0x2b     43<br>
ds             0x0      0<br>
es             0x0      0<br>
fs             0x0      0<br>
gs             0x0      0</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1860#issuecomment-483156808">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZScfWbd4bRWaOsHy2YDUoMj-kWMXks5vhDesgaJpZM4bFbhy">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZVq5y4rKPgrwK1dZlvLGtRZA6UoKks5vhDesgaJpZM4bFbhy.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@shaunjstokes in #1860: Not sure if this helps, each crash follows a slightly different path with-in 'modules/tls/tls_server.c' but always crashes in 'aes_ecb_cipher' at 'crypto/evp/e_aes.c:2699'.\r\n\r\nHere's our most recent core dump.\r\n\r\n(gdb) bt\r\n#0  0x00007f264161d6de in aes_ecb_cipher (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 \"\", in=0x7f25f5ad4398 \"\\251\\333\\023`a\u003eEBi\\r\\035\\216Z\\241Z}\\200\\\\\\345/-\\340{\", len=0) at crypto/evp/e_aes.c:2699\r\n#1  0x00007f264162b755 in evp_EncryptDecryptUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 \"\", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 \"\\251\\333\\023`a\u003eEBi\\r\\035\\216Z\\241Z}\\200\\\\\\345/-\\340{\", inl=16) at crypto/evp/evp_enc.c:333\r\n#2  0x00007f264162b9a0 in EVP_EncryptUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 \"\", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 \"\\251\\333\\023`a\u003eEBi\\r\\035\\216Z\\241Z}\\200\\\\\\345/-\\340{\", inl=16) at crypto/evp/evp_enc.c:385\r\n#3  0x00007f264162b38e in EVP_CipherUpdate (ctx=0x7f25f5ad4480, out=0x7f25f6afec90 \"\", outl=0x7ffc6679a3a4, in=0x7f25f5ad4398 \"\\251\\333\\023`a\u003eEBi\\r\\035\\216Z\\241Z}\\200\\\\\\345/-\\340{\", inl=16) at crypto/evp/evp_enc.c:213\r\n#4  0x00007f2641669a01 in drbg_ctr_generate (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 \"\", outlen=32, adin=0x0, adinlen=0) at crypto/rand/drbg_ctr.c:340\r\n#5  0x00007f264166af15 in RAND_DRBG_generate (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 \"\", outlen=32, prediction_resistance=0, adin=0x0, adinlen=0) at crypto/rand/drbg_lib.c:638\r\n#6  0x00007f264166b043 in RAND_DRBG_bytes (drbg=0x7f25f5ad42b0, out=0x7f25f6afec90 \"\", outlen=32) at crypto/rand/drbg_lib.c:679\r\n#7  0x00007f264166b5bc in drbg_bytes (out=0x7f25f6afec90 \"\", count=32) at crypto/rand/drbg_lib.c:968\r\n#8  0x00007f264166cb2f in RAND_bytes (buf=0x7f25f6afec90 \"\", num=32) at crypto/rand/rand_lib.c:836\r\n#9  0x00007f26419f0d33 in def_generate_session_id (ssl=0x7f25f6a6c540, id=0x7f25f6afec90 \"\", id_len=0x7ffc6679a534) at ssl/ssl_sess.c:290\r\n#10 0x00007f26419f0f22 in ssl_generate_session_id (s=0x7f25f6a6c540, ss=0x7f25f6afeb38) at ssl/ssl_sess.c:362\r\n#11 0x00007f26419f113e in ssl_get_new_session (s=0x7f25f6a6c540, session=1) at ssl/ssl_sess.c:418\r\n#12 0x00007f2641a188f0 in tls_early_post_process_client_hello (s=0x7f25f6a6c540) at ssl/statem/statem_srvr.c:1817\r\n#13 0x00007f2641a19900 in tls_post_process_client_hello (s=0x7f25f6a6c540, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:2222\r\n#14 0x00007f2641a173dc in ossl_statem_server_post_process_message (s=0x7f25f6a6c540, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:1220\r\n#15 0x00007f2641a03a04 in read_state_machine (s=0x7f25f6a6c540) at ssl/statem/statem.c:664\r\n#16 0x00007f2641a03364 in state_machine (s=0x7f25f6a6c540, server=1) at ssl/statem/statem.c:434\r\n#17 0x00007f2641a02e89 in ossl_statem_accept (s=0x7f25f6a6c540) at ssl/statem/statem.c:255\r\n#18 0x00007f26419e952c in SSL_do_handshake (s=0x7f25f6a6c540) at ssl/ssl_lib.c:3599\r\n#19 0x00007f26419e55f5 in SSL_accept (s=0x7f25f6a6c540) at ssl/ssl_lib.c:1643\r\n#20 0x00007f26360480f2 in tls_accept (c=0x7f25f6aa1010, error=0x7ffc667ba98c) at tls_server.c:422\r\n#21 0x00007f26360515fe in tls_read_f (c=0x7f25f6aa1010, flags=0x7ffc667bacc8) at tls_server.c:1119\r\n#22 0x000055a6ac69fc43 in tcp_read_headers (c=0x7f25f6aa1010, read_flags=0x7ffc667bacc8) at core/tcp_read.c:469\r\n#23 0x000055a6ac6a77e9 in tcp_read_req (con=0x7f25f6aa1010, bytes_read=0x7ffc667baccc, read_flags=0x7ffc667bacc8) at core/tcp_read.c:1496\r\n#24 0x000055a6ac6ac757 in handle_io (fm=0x7f264284c438, events=1, idx=-1) at core/tcp_read.c:1804\r\n#25 0x000055a6ac69a2c0 in io_wait_loop_epoll (h=0x55a6acb783a0 \u003cio_w\u003e, t=2, repeat=0) at core/io_wait.h:1065\r\n#26 0x000055a6ac6ae76a in tcp_receive_loop (unix_sock=86) at core/tcp_read.c:1974\r\n#27 0x000055a6ac561f12 in tcp_init_children () at core/tcp_main.c:4853\r\n#28 0x000055a6ac4994ac in main_loop () at main.c:1745\r\n#29 0x000055a6ac4a046e in main (argc=13, argv=0x7ffc667bb338) at main.c:2696\r\n\r\nHere's the disas of aes_ecb_cipher, it was doing a move from memory pointed to in the %rax register plus an offset of 0xf8, to the %rax register.\r\n\r\n(gdb) disas aes_ecb_cipher\r\nDump of assembler code for function aes_ecb_cipher:\r\n   0x00007f264161d67d \u003c+0\u003e:     push   %rbp\r\n   0x00007f264161d67e \u003c+1\u003e:     mov    %rsp,%rbp\r\n   0x00007f264161d681 \u003c+4\u003e:     sub    $0x40,%rsp\r\n   0x00007f264161d685 \u003c+8\u003e:     mov    %rdi,-0x28(%rbp)\r\n   0x00007f264161d689 \u003c+12\u003e:    mov    %rsi,-0x30(%rbp)\r\n   0x00007f264161d68d \u003c+16\u003e:    mov    %rdx,-0x38(%rbp)\r\n   0x00007f264161d691 \u003c+20\u003e:    mov    %rcx,-0x40(%rbp)\r\n   0x00007f264161d695 \u003c+24\u003e:    mov    -0x28(%rbp),%rax\r\n   0x00007f264161d699 \u003c+28\u003e:    mov    %rax,%rdi\r\n   0x00007f264161d69c \u003c+31\u003e:    callq  0x7f264162cf2a \u003cEVP_CIPHER_CTX_block_size\u003e\r\n   0x00007f264161d6a1 \u003c+36\u003e:    cltq\r\n   0x00007f264161d6a3 \u003c+38\u003e:    mov    %rax,-0x10(%rbp)\r\n   0x00007f264161d6a7 \u003c+42\u003e:    mov    -0x28(%rbp),%rax\r\n   0x00007f264161d6ab \u003c+46\u003e:    mov    %rax,%rdi\r\n   0x00007f264161d6ae \u003c+49\u003e:    callq  0x7f264162cfe5 \u003cEVP_CIPHER_CTX_get_cipher_data\u003e\r\n   0x00007f264161d6b3 \u003c+54\u003e:    mov    %rax,-0x18(%rbp)\r\n   0x00007f264161d6b7 \u003c+58\u003e:    mov    -0x40(%rbp),%rax\r\n   0x00007f264161d6bb \u003c+62\u003e:    cmp    -0x10(%rbp),%rax\r\n   0x00007f264161d6bf \u003c+66\u003e:    jae    0x7f264161d6c8 \u003caes_ecb_cipher+75\u003e\r\n   0x00007f264161d6c1 \u003c+68\u003e:    mov    $0x1,%eax\r\n   0x00007f264161d6c6 \u003c+73\u003e:    jmp    0x7f264161d71b \u003caes_ecb_cipher+158\u003e\r\n   0x00007f264161d6c8 \u003c+75\u003e:    movq   $0x0,-0x8(%rbp)\r\n   0x00007f264161d6d0 \u003c+83\u003e:    mov    -0x10(%rbp),%rax\r\n   0x00007f264161d6d4 \u003c+87\u003e:    sub    %rax,-0x40(%rbp)\r\n   0x00007f264161d6d8 \u003c+91\u003e:    jmp    0x7f264161d70c \u003caes_ecb_cipher+143\u003e\r\n   0x00007f264161d6da \u003c+93\u003e:    mov    -0x18(%rbp),%rax\r\n=\u003e 0x00007f264161d6de \u003c+97\u003e:    mov    0xf8(%rax),%rax\r\n   0x00007f264161d6e5 \u003c+104\u003e:   mov    -0x18(%rbp),%rdx\r\n   0x00007f264161d6e9 \u003c+108\u003e:   mov    -0x30(%rbp),%rsi\r\n   0x00007f264161d6ed \u003c+112\u003e:   mov    -0x8(%rbp),%rcx\r\n   0x00007f264161d6f1 \u003c+116\u003e:   add    %rcx,%rsi\r\n   0x00007f264161d6f4 \u003c+119\u003e:   mov    -0x38(%rbp),%rdi\r\n   0x00007f264161d6f8 \u003c+123\u003e:   mov    -0x8(%rbp),%rcx\r\n   0x00007f264161d6fc \u003c+127\u003e:   add    %rdi,%rcx\r\n   0x00007f264161d6ff \u003c+130\u003e:   mov    %rcx,%rdi\r\n   0x00007f264161d702 \u003c+133\u003e:   callq  *%rax\r\n   0x00007f264161d704 \u003c+135\u003e:   mov    -0x10(%rbp),%rax\r\n   0x00007f264161d708 \u003c+139\u003e:   add    %rax,-0x8(%rbp)\r\n   0x00007f264161d70c \u003c+143\u003e:   mov    -0x8(%rbp),%rax\r\n   0x00007f264161d710 \u003c+147\u003e:   cmp    -0x40(%rbp),%rax\r\n   0x00007f264161d714 \u003c+151\u003e:   jbe    0x7f264161d6da \u003caes_ecb_cipher+93\u003e\r\n   0x00007f264161d716 \u003c+153\u003e:   mov    $0x1,%eax\r\n   0x00007f264161d71b \u003c+158\u003e:   leaveq\r\n   0x00007f264161d71c \u003c+159\u003e:   retq\r\nEnd of assembler dump.\r\n\r\nIf we look at the register, the problem is %rax is 0.\r\n\r\n(gdb) i r\r\nrax            0x0      0\r\nrbx            0x50     80\r\nrcx            0x10     16\r\nrdx            0x7f25f5ad4398   139801012290456\r\nrsi            0x7f25f6afec90   139801029242000\r\nrdi            0x7f25f5ad4480   139801012290688\r\nrbp            0x7ffc6679a290   0x7ffc6679a290\r\nrsp            0x7ffc6679a250   0x7ffc6679a250\r\nr8             0x10     16\r\nr9             0x0      0\r\nr10            0x0      0\r\nr11            0x202    514\r\nr12            0x55a6ac8570b3   94174347358387\r\nr13            0x40000000       1073741824\r\nr14            0x10000000       268435456\r\nr15            0x6      6\r\nrip            0x7f264161d6de   0x7f264161d6de \u003caes_ecb_cipher+97\u003e\r\neflags         0x10246  [ PF ZF IF RF ]\r\ncs             0x33     51\r\nss             0x2b     43\r\nds             0x0      0\r\nes             0x0      0\r\nfs             0x0      0\r\ngs             0x0      0"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1860#issuecomment-483156808"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1860#issuecomment-483156808",
"url": "https://github.com/kamailio/kamailio/issues/1860#issuecomment-483156808",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>