<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 27, 2013 at 9:13 AM, Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Sep 26, 2013 at 09:37:54PM -0400, Matt Causey wrote:<br>
&gt; I can&#39;t seem to do anything that will cause this segfault to happen<br>
&gt; w/valgrind.  :-(  What do you think about this:<br>
</div><div class="im">&gt; ==25997== ERROR SUMMARY: 155711 errors from 129 contexts (suppressed: 27<br>
&gt; from 6)<br>
&gt;<br>
&gt; I&#39;ve attached the full and compressed valgrind log, though it may end up<br>
&gt; being scrubbed by the server.<br>
<br>
</div>Thanks! This is a good example where valgrind ends up hiding the<br>
segfault when a program accesses freed memory. Such a bug is a critical<br>
issue always so it does not really matter whether the program crashes or<br>
not (with or without valgrind).<br>
<br>
I was able to reproduce this by replaying the scan results and the<br>
configuration you were using. The issue is triggered by a removal of the<br>
oldest BSS entry at a very inconvenient time and yes, this was very much<br>
related to the large number of BSSes in the scan results. For this to<br>
show up, you would need to have at least 200 BSSes that match a network<br>
configuration block in the scan results. And well, you did have 739 such<br>
BSSes.. ;-)<br>
<br>
This commit fixes the issue:<br>
<a href="http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=a3cbf82e6d2b494e4c5e87b4101af2f941482400" target="_blank">http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=a3cbf82e6d2b494e4c5e87b4101af2f941482400</a><br>

<br>
In addition, while reviewing the implementation, I found another<br>
potential issue that could result in somewhat similar problems. Though,<br>
I don&#39;t think this should happen with nl80211 driver interface. Anyway,<br>
the fix is here:<br>
<a href="http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=25b65a142dec4770a79f7a17867f0db93111f843" target="_blank">http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=25b65a142dec4770a79f7a17867f0db93111f843</a><br>

<br>
Please let me know if these address the issues you were seeing.<br></blockquote><div><br></div><div>I&#39;ll do it straight-away.  Thanks for all your help!  Shall I expect these patches to apply cleanly to the wpa_supplicant-2.0 release or should we migrate to hostap.git HEAD in our stack?<br>
<br>--<br></div><div>Matt<br> <br></div></div></div></div>