<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 07/15/2015 08:41 AM, Yousf Ateya
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAFoy26ccw-t4RkDh5CAO1CY-6c7zqGDN9o_LSDDQ==Fuxq4y2A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Dear,<br>
            <br>
          </div>
          I started to see a  strange deadlock in some asterisk nodes.
          For every call, when calling pthread_exit from pbx_thread, the
          caller thread is stuck inside pthread_exit.<br>
          <br>
        </div>
        <div>After a while, there will be tens-of-thousands of threads
          having the same backtrace. After some googling, I found this
          happens because of the default lazy linking of gcc linker.<br>
          <br>
        </div>
        <div>Related issue of stackoverflow: <a moz-do-not-send="true"
href="http://stackoverflow.com/questions/11954527/dlopen-malloc-deadlock">http://stackoverflow.com/questions/11954527/dlopen-malloc-deadlock</a><br>
          <br>
        </div>
        <div>Tried to recompile asterisk using:<br>
          export LDFLAGS=-Wl,-z,now<br>
        </div>
        <div>./configure && make && make install<br>
          <br>
        </div>
        <div>and this deadlock problem didn't happen again; the problem
          cause is lazy binding with libgcc.<br>
          <br>
        </div>
        <div>Shall we add this option by default or add it in
          menuselect?<br>
        </div>
      </div>
    </blockquote>
    <br>
    <snip><br>
    <br>
    <blockquote
cite="mid:CAFoy26ccw-t4RkDh5CAO1CY-6c7zqGDN9o_LSDDQ==Fuxq4y2A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div><br>
            </div>
            <div>-- <br>
              <div class="gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>Yousf Ateya,<br>
                      </div>
                      <div>StarkBits</div>
                      <div><a moz-do-not-send="true"
                          href="http://www.starkbits.com"
                          target="_blank">www.starkbits.com</a></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
    </blockquote>
    <br>
    Thanks for this report. Based solely on the man page for ld(1), it
    sounds like load-time binding would, at most, cause module loading
    to take longer. Are there any other potential issues to making this
    change?<br>
    <br>
    Mark Michelson<br>
  </body>
</html>