<div dir="ltr"><div><div>Here is the difference in loading time (on Intel i5 machine):<br><br></div>The default (with lazy linking): 1.422 seconds<br></div>With non-lazy linking: 1.852 seconds<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 6:04 PM, Mark Michelson <span dir="ltr"><<a href="mailto:mmichelson@digium.com" target="_blank">mmichelson@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <div>On 07/15/2015 08:41 AM, Yousf Ateya
      wrote:<br>
    </div>
    <blockquote 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 href="http://stackoverflow.com/questions/11954527/dlopen-malloc-deadlock" target="_blank">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></span>
    <snip><span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div><br>
            </div>
            <div>-- <br>
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>Yousf Ateya,<br>
                      </div>
                      <div>StarkBits</div>
                      <div><a href="http://www.starkbits.com" target="_blank">www.starkbits.com</a></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
    </blockquote>
    <br></span>
    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?<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Mark Michelson<br>
  </font></span></div>

<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Yousf Ateya,<br></div><div></div><div>StarkBits</div><div><a href="http://www.starkbits.com" target="_blank">www.starkbits.com</a></div></div></div></div></div>
</div>

<br>
<pre><font size="1" face="Courier New">This e-mail message is intended only for the use of the intended recipient(s).
The information contained therein may be confidential or privileged,
and its disclosure or reproduction is strictly prohibited.
If you are not the intended recipient, please return it immediately to its sender 
at the above address and destroy it. 
</font></pre>