Bugzilla – Bug 919
minstrel does not pass valgrind tests
Last modified: 2010-06-04 01:38:49 UTC
the following does not pass valgrind tests: examples/wireless/multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager when this is fixed, it should be added to test.py
Created attachment 875 [details] valgrind trace
(In reply to comment #0) > the following does not pass valgrind tests: > examples/wireless/multirate --totalTime=0.3s > --rateManager=ns3::MinstrelWifiManager > > when this is fixed, it should be added to test.py Valgrind complains about the allocation in line 240 and 241 in minstrel-wifi-manager.cc 240 station->m_minstrelTable = MinstrelRate(GetNSupported (station)); 241 station->m_sampleTable = SampleRate(GetNSupported (station), I thought c++ STL automatically handles allocation and deallocation? Any suggestions?
> Valgrind complains about the allocation in line 240 and 241 in > minstrel-wifi-manager.cc > > 240 station->m_minstrelTable = MinstrelRate(GetNSupported (station)); > 241 station->m_sampleTable = SampleRate(GetNSupported (station), > > I thought c++ STL automatically handles allocation and deallocation? Any > suggestions? We could move those two lines and allocate memory in WifiRemoteStation * MinstrelWifiManager::DoCreateStation However, GetNSupported (station) values have not been initialized yet in the DoCreateStation, this is why I defer and initialize them in WifiMode MinstrelWifiManager::DoGetDataMode
Created attachment 881 [details] patched memory leak this patch fixed the memory leak problem in minstrel. m_stations do not seem to be able to allocate and de-allocate memory correctly, so I placed all the allocation back in the MinstrelWifiManager as in my original implementation. I did a valgrind run with on minstrel with wifi-adhoc and multirate they both passed the memory leak successfully. I am not sure if Bug 802 is related or not, but the valgrind runs points to ==4079== Invalid read of size 4 ==4079== at 0x47D129E: ns3::TimeUnit<1>::operator=(ns3::TimeUnit<1> const&) (nstime.h:424) ==4079== by 0x4DFF96F: ns3::MinstrelWifiManager::UpdateStats(ns3::MinstrelWifiRemoteStation*) (minstrel-wifi-manager.cc:574)
changeset: 6337:92c95748a915 tag: tip user: Duy Nguyen <duy@soe.ucsc.edu> date: Thu Jun 03 22:38:44 2010 -0700 summary: Fixed Bug 802 and Bug 919