GlobalRoutingHelper - CalculateAllPossibleRoutes SEGFAULTS - fix included
When calling ndn::GlobalRoutingHelper::CalculateAllPossibleRoutes() I did sometimes receive SEGFAULTS or similar crashes (e.g., 300 nodes created with BRITE).
After using valgrind and gdb I identified the problem:
A vector is initialized with .size() elements, though in the for loop the index "faceNumber" is used, which is incremented BEFORE it is used.
Therefore, for the last face in this list, you create an invalid write.
The fix is rather easy: do not increment faceNumber until the end of the loop. I've attached a .diff file (and the full file) to this bug report.
Updated by Spyros Mastorakis almost 5 years ago
Christian thank you very much for the sample scenario.
@Alex, I confirm that before the fix on Ubuntu 14.04 I got a segmentation fault. After the patch, the scenario run successfully.
On OS X 10.10, I did not test before the patch. I tested after the patch, though, and the scenario run successfully.