<html><body bgcolor="#FFFFFF"><div>Hi,<br><br>On 19.05.2010, at 17:31, Maxim Dounin &lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><span>Hello!</span><br><span></span><br><span>On Wed, May 19, 2010 at 04:01:07PM +0400, Peter Leonov wrote:</span><br><span></span><br><blockquote type="cite"><span>On 18.05.2010, at 23:26, Maxim Dounin wrote:</span><br></blockquote><blockquote type="cite"><span></span></blockquote><span class="Apple-style-span" style="color: rgb(0, 80, 1);">[...]<br></span><blockquote type="cite"><blockquote type="cite"><span>Injecting random errors into allocation routines proven to be much </span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>more usable. &nbsp;Just for completeness: attached trivial patch which </span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I used while searching for allocation error handling bugs in nginx </span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>itself.</span><br></blockquote></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>That is near what I was looking for :)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>But it gives a very interesting results. For example a crash within the core:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>40740 Bus error &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(core dumped)</span><br></blockquote><blockquote type="cite"><span></span></blockquote><span class="Apple-style-span" style="color: rgb(0, 80, 1);">[...]<br></span><span>This may happen due to bugs in a module as well.</span></div></blockquote><div>And it is so. The module may forget to finalize with NGX_ERROR the request on OOM situation.</div><br><blockquote type="cite"><div><span>If you are able </span><br><span>to reproduce the problem without non-official modules/patches - </span><br><span>this probably worth further investigation.</span></div></blockquote><div>It is impossible because the test case is written in JavaScript in this module.</div><br><blockquote type="cite"><div><span>You may want to try to </span><br><span>reproduce the problem without optimization and/or share a way to </span><br><span>reproduce it.</span><br></div></blockquote><div>Reproducing with ngx_random() was a pain. Now it counts the calls to the alloc funcs and fails at a specific moment.</div><div><br></div><div>IMHO, such a functionality (manageable allocation fails) is good to have it built into nginx. With a candy configuration and command line options, debug points and so on ;)</div><br><blockquote type="cite"><div><span></span><br><span>Note well: last time I've tested nginx with these patches heavily </span><br><span>was before 0.8.0. &nbsp;But I don't see any immediate segfaults/bus </span><br><span>errors while running test suite against 0.8.37 with these patches.</span><br></div></blockquote><br><div>Thank you Maxim for your time and help, again :)</div><div><br></div><div>Best regards,</div><div>Peter.</div></body></html>