I should be able to try this out tonight (&gt;12 hours from now).  I&#39;ll let you know how it works.  Thanks for looking into this for me.<br><br><div class="gmail_quote">On Tue, May 3, 2011 at 4:46 AM, Maxim Dounin <span dir="ltr">&lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello!<br>
<div class="im"><br>
On Mon, May 02, 2011 at 04:45:13PM -0700, Stephen Weeks wrote:<br>
<br>
&gt; Sure!  I&#39;ve added it to the post on github.  I&#39;ve slightly edited the log<br>
&gt; out of paranoia (replacing a customer ID and auth key).<br>
&gt;<br>
&gt; I can confirm now that I ran this proxy with the upstreamfair module<br>
&gt; overnight and it didn&#39;t crash at all.  I can&#39;t get it to preferentially<br>
&gt; serve to localhost, though, as it doesn&#39;t support &#39;backup&#39; as a server<br>
&gt; attribute, and doesn&#39;t seem to really use the weights, so that&#39;s suboptimal.<br>
&gt;<br>
&gt; Anything else I can add to help troubleshooting this?  Anything you&#39;d like<br>
&gt; from the core dump?<br>
<br>
</div>Ok, thank you, it looks like I see the problem.<br>
<br>
Allocation for &quot;tried&quot; flags doesn&#39;t take into account number of<br>
backup servers, and if there are more backup servers than normal<br>
ones (and backup servers are in fact used) - this may cause memory<br>
corruption.<br>
<br>
Please try the attached patch.<br>
<font color="#888888"><br>
Maxim Dounin<br>
</font><div><div></div><div class="h5"><br>
&gt;<br>
&gt; On Mon, May 2, 2011 at 2:04 PM, Maxim Dounin &lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hello!<br>
&gt; &gt;<br>
&gt; &gt; On Sun, May 01, 2011 at 05:54:17PM -0700, Stephen Weeks wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; I&#39;ve currently got a pool of systems running nginx proxying to a pool of<br>
&gt; &gt; &gt; systems running apache.  I&#39;m trying to move to running nginx locally on<br>
&gt; &gt; the<br>
&gt; &gt; &gt; apache hosts instead of separate systems to avoid the extra network hop,<br>
&gt; &gt; &gt; make more-efficient use of resources, and enable some future development<br>
&gt; &gt; &gt; (including migrating to running our application on nginx via fastcgi<br>
&gt; &gt; instead<br>
&gt; &gt; &gt; of apache, ideally).  we&#39;ve currently got some significant architecture<br>
&gt; &gt; &gt; built up around apache, so converting right now is uncomfortable.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Ideally, I&#39;d like nginx to just serve from localhost, but fail over to<br>
&gt; &gt; the<br>
&gt; &gt; &gt; rest of the pool when localhost in unavailable, so in my upstream I have<br>
&gt; &gt; &gt; every server except for localhost set as &#39;backup&#39;.  I&#39;m otherwise running<br>
&gt; &gt; &gt; identical configurations of apache and nginx on a single system together<br>
&gt; &gt; as<br>
&gt; &gt; &gt; used in the rest of the two pools.  This works exactly as expected,<br>
&gt; &gt; except<br>
&gt; &gt; &gt; that I get a few crashes of nginx workers every minute.  This only<br>
&gt; &gt; happens<br>
&gt; &gt; &gt; when proxying to the local system.  If I proxy anywhere else, it works<br>
&gt; &gt; &gt; fine.  Other proxies can serve from this system without trouble.  I see<br>
&gt; &gt; this<br>
&gt; &gt; &gt; same behaviour on other hosts when I build them the same way, so it&#39;s not<br>
&gt; &gt; an<br>
&gt; &gt; &gt; error with the host.  I see this crash on 0.7.65, 0.8.54, and 1.0.0,<br>
&gt; &gt; running<br>
&gt; &gt; &gt; on Ubuntu 10.04 LTS.  I see this crash whether I&#39;m connecting to<br>
&gt; &gt; 127.0.0.1<br>
&gt; &gt; &gt; or the host&#39;s local IP.  I see this crash whether I&#39;m listening on *:80<br>
&gt; &gt; or<br>
&gt; &gt; &gt; &lt;public ip&gt;:80.  I see this crash whether I&#39;m connecting to :80 or<br>
&gt; &gt; running<br>
&gt; &gt; &gt; apache on a different port and connecting to :81.  I see this crash<br>
&gt; &gt; whether<br>
&gt; &gt; &gt; I&#39;m running ubuntu&#39;s &quot;nginx-light&quot; configuration, or their &quot;nginx-full&quot;<br>
&gt; &gt; &gt; configuration.  I see no errors logged from apache.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; 1) I&#39;d really love to make this work, so if there&#39;s anything else I can<br>
&gt; &gt; try,<br>
&gt; &gt; &gt; any additional debugging information I can give, I&#39;d appreciate it.<br>
&gt; &gt; &gt; 2) Nginx has been very useful to me so far, so I thought you&#39;d appreciate<br>
&gt; &gt; a<br>
&gt; &gt; &gt; bug report.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Posted on github, I have a problem description, section of a debug log,<br>
&gt; &gt; my<br>
&gt; &gt; &gt; (slightly edited: flattened includes and stripped an IP) nginx.conf, a<br>
&gt; &gt; gdb<br>
&gt; &gt; &gt; backtrace, and some additional information I was asked for when looking<br>
&gt; &gt; for<br>
&gt; &gt; &gt; help on IRC.  This is everything I&#39;ve been able to come up with that<br>
&gt; &gt; sounds<br>
&gt; &gt; &gt; plausibly relevant.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; <a href="https://gist.github.com/1574dbaf3a3dcda920a2" target="_blank">https://gist.github.com/1574dbaf3a3dcda920a2</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any help?<br>
&gt; &gt;<br>
&gt; &gt; Could you please provide:<br>
&gt; &gt;<br>
&gt; &gt; 1. nginx -V output<br>
&gt; &gt;<br>
&gt; &gt; 2. Full debug log for &#39;*60&#39; connection (the one which triggered<br>
&gt; &gt; abort in glibc), the one you provided contatins only last part of<br>
&gt; &gt; the connection in question.  Running grep -F &#39; 27772#0: *60 &#39; on<br>
&gt; &gt; original debug log should produce something useable.<br>
&gt; &gt;<br>
&gt; &gt; Maxim Dounin<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; nginx mailing list<br>
&gt; &gt; <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
&gt; &gt; <a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
&gt; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; nginx mailing list<br>
&gt; <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
&gt; <a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br>
</div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br></blockquote></div><br>