Bug 1208 - Spectrum module example causing valgrind errors
Spectrum module example causing valgrind errors
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: spectrum
ns-3-dev
All All
: P5 normal
Assigned To: Nicola Baldo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-05 21:13 UTC by Mitch Watrous
Modified: 2011-07-07 10:34 UTC (History)
1 user (show)

See Also:


Attachments
Output from running test.py using valgrind (31.84 KB, text/plain)
2011-07-05 21:13 UTC, Mitch Watrous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mitch Watrous 2011-07-05 21:13:46 UTC
Created attachment 1188 [details]
Output from running test.py using valgrind

This example:

    src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc

causes valgrind errors when it is run in test.py under valgrind.

I am attaching the output from valgrind with this report.
Comment 1 Nicola Baldo 2011-07-06 08:57:45 UTC
confirmed, I'm working on it
Comment 2 Nicola Baldo 2011-07-06 12:55:17 UTC
I have to confess that I don't have a clue, I get things like:

==7004== Conditional jump or move depends on uninitialised value(s)
==7004==    at 0x40C23BF: ns3::HalfDuplexIdealPhy::EndRx() (half-duplex-ideal-phy.cc:397)

which corresponds to:

  bool rxOk = m_interference.EndRx ();

  if (rxOk)


or another example:

==7004== Conditional jump or move depends on uninitialised value(s)
==7004==    at 0x4094AD2: ns3::MultiModelSpectrumChannel::StartTx(ns3::Ptr<ns3::PacketBurst>, ns3::Ptr<ns3::SpectrumValue>, ns3::SpectrumType, ns3::Time, ns3::Ptr<ns
3::SpectrumPhy>) (multi-model-spectrum-channel.cc:278)

which corresponds to:

   double gainDb = m_propagationLoss->CalcRxPower (0, txMobility, receiverMobility);
   if ( (-gainDb) > m_maxLossDb)

and I am sure valgrind is complaining about "gainDb", because the error persists if I change the if statement to

   if (gainDb > 0)


Any suggestion? Am I missing something?
Comment 3 Nicola Baldo 2011-07-07 10:34:41 UTC
I learned a bit more about valgrind today :-)

changeset:   7355:10599454e238
user:        Nicola Baldo <nbaldo@cttc.es>
date:        Thu Jul 07 15:39:44 2011 +0200
summary:     fixed Bug 1208 - Spectrum module example causing valgrind errors