Bug 2927 - Valgrind error in lena-x2-handover example
Valgrind error in lena-x2-handover example
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: lte
ns-3-dev
All All
: P3 normal
Assigned To: Manuel Requena
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-08 06:10 UTC by Manuel Requena
Modified: 2019-05-31 10:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Requena 2018-06-08 06:10:15 UTC
Running the following (in Fedora 26 and Ubuntu 16):

$ ./waf configure --enable-examples --disable-gtk
$ ./waf build
$ ./waf --command-template="valgrind --track-origins=yes %s" --run lena-x2-handover

generates valgrind errors:
==89724== Use of uninitialised value of size 8
==89724==  Uninitialised value was created by a heap allocation
==89724== Conditional jump or move depends on uninitialised value(s)

in radio-bearer-stats-calculator

==89724==    by 0x5662FEC: ns3::RadioBearerStatsCalculator::WriteDlResults(std::basic_ofstream<char, 
std::char_traits<char> >&) (radio-bearer-stats-calculator.cc:354)
==89724==    by 0x5661FC8: 
ns3::RadioBearerStatsCalculator::ShowResults() 
(radio-bearer-stats-calculator.cc:265)
==89724==    by 0x5664018: ns3::RadioBearerStatsCalculator::EndEpoch() 
(radio-bearer-stats-calculator.cc:409)
Comment 1 Manuel Requena 2018-06-08 06:19:22 UTC
A first investigation shows that []operator is used in a map. So, if element is not present, it is created with uninitialized values (so, the valgrind error).

Added some checks in changeset:   13640:709f3122a16a

But now we have a crash. It means something is wrong with the connection of the stats.