<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#333333">
    <div class="moz-cite-prefix">Hi Michel,<br>
      <br>
      It doesn't appear to be related to that.  I added CloseHandle's
      and got the same result.<br>
      <br>
      Here are my updated findings... The following simple program still
      causes the same Handle Leaks...<br>
      <br>
      Important findings:<br>
      <br>
      <b>1) </b> If    SSL_library_init() and SSL_load_error_strings()
      are <b>removed</b> (which are the only 2 OpenSSL functions I'm
      using).... the handle leaks go away.. <br>
      <br>
      <b>2)</b>  If    SSL_library_init() and SSL_load_error_strings()
      are <b>kept</b> but the creation of the thread is <b>removed</b> 
      -- no more handle leaks..<br>
      <br>
      So the problem is something related to the combination of loading
      OpenSSL and creating a thread (even though that thread does
      nothing whatsoever related to OpenSSL).  Very odd.<br>
      <br>
      <br>
      DWORD __stdcall thread1(LPVOID l)<br>
      {<br>
          while(1)<br>
          {   Sleep(1000);    }<br>
      }<br>
      int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
      LPSTR lpCmdLine, int nCmdShow) {<br>
      <br>
      <br>
      <b>     SSL_library_init();</b><b>   // if these 2 lines removed<br>
      </b><b>    SSL_load_error_strings();  </b><b>// no more handle
        leaks</b><br>
          DWORD t1;<br>
          <br>
          HANDLE h1=CreateThread(0,0,thread1,0,0,&t1);  if(h1==0) 
      {  return 0;     }      CloseHandle(h1);  <b>//if  </b><b>SSL_library_init();</b><b>
      </b>and <b>SSL_load_error_strings();  </b>are <b>kept  </b>but
      this line is <b>removed... no more handle leaks</b><br>
      <br>
      <br>
          while(1)<br>
          {<br>
              Sleep(1000);<br>
          }<br>
      }<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      Address / Handle: 0x0000C001<br>
      shmem-win32.c<br>
      sslleak.exe <br>
      Atom<br>
      0 bytes<br>
      Thread ID: 6736<br>
      1/22 18:48:09 990ms (Lifetime:00:01:45:503ms)<br>
      Sequence: 11<br>
      sslleak.exe  ___shmem_grab : [shmem-win32.c Line 0]<br>
      sslleak.exe  _fc_key_init_once : [unwind-sjlj.c Line 0]<br>
      sslleak.exe  _main : [crt0_c.c Line 0]<br>
      sslleak.exe  ___tmainCRTStartup : [crtexe.c Line 0]<br>
      kernel32.dll  BaseThreadInitThunk : [{FUNC}BaseThreadInitThunk
      Line 0]<br>
      ntdll.dll  RtlInitializeExceptionChain :
      [{FUNC}RtlInitializeExceptionChain Line 0]<br>
      <br>
      <br>
      <br>
      Address / Handle: 0x0000C00F<br>
      shmem-win32.c<br>
      sslleak.exe <br>
      Atom<br>
      0 bytes<br>
      Thread ID: 6736<br>
      1/22 18:48:09 990ms (Lifetime:00:02:29:683ms)<br>
      Sequence: 97<br>
      sslleak.exe  ___shmem_grab : [shmem-win32.c Line 0]<br>
      sslleak.exe  ___shmem_grab : [shmem-win32.c Line 0]<br>
      <br>
      <br>
      Address / Handle: 0x0000C016<br>
      shmem.c<br>
      sslleak.exe <br>
      Atom<br>
      0 bytes<br>
      Thread ID: 6736<br>
      1/22 18:48:09 990ms (Lifetime:00:03:02:693ms)<br>
      Sequence: 143<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      <br>
      <br>
      Address / Handle: 0x0000C009<br>
      shmem.c<br>
      sslleak.exe <br>
      Atom<br>
      0 bytes<br>
      Thread ID: 6736<br>
      1/22 18:48:09 990ms (Lifetime:00:03:22:364ms)<br>
      Sequence: 61<br>
      sslleak.exe  ___shmem_winpthreads_grab : [shmem.c Line 0]<br>
      sslleak.exe  _mutex_static_init : [mutex.c Line 0]<br>
      sslleak.exe  _pop_pthread_mem : [thread.c Line 0]<br>
      sslleak.exe  _pop_pthread_mem : [thread.c Line 0]<br>
      <br>
      <br>
      <br>
      On 1/24/2015 5:34 AM, Michel SALES wrote:<br>
    </div>
    <blockquote
      cite="mid:004e01d037c1$61615950$24240bf0$@sales@OnLine.fr"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:#333333;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Just
            a quick answer : I didn't find any call to CloseHandle()
            function in your code.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best
            regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michel.<o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
openssl-users mailing list
To unsubscribe: <a class="moz-txt-link-freetext" href="https://mta.openssl.org/mailman/listinfo/openssl-users">https://mta.openssl.org/mailman/listinfo/openssl-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>