Bug 1939 - Aggregating the same object to two nodes produce unexpected results
Aggregating the same object to two nodes produce unexpected results
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P5 critical
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-23 13:03 UTC by Tommaso Pecorella
Modified: 2016-05-24 18:13 UTC (History)
2 users (show)

See Also:


Attachments
test script (4.10 KB, application/octet-stream)
2014-06-23 13:03 UTC, Tommaso Pecorella
Details
Proposed bugfix (1.27 KB, patch)
2016-04-09 19:18 UTC, Alexander Krotov
Details | Diff
Updated bugfix (1.80 KB, patch)
2016-04-09 19:22 UTC, Alexander Krotov
Details | Diff
Proposed patch (1.79 KB, patch)
2016-04-09 19:39 UTC, Alexander Krotov
Details | Diff
Proposed patch (1.60 KB, patch)
2016-04-10 05:51 UTC, Tommaso Pecorella
Details | Diff
Proposed patch (1.60 KB, patch)
2016-04-10 12:23 UTC, Alexander Krotov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2014-06-23 13:03:40 UTC
Created attachment 1852 [details]
test script

This is nasty, and it has been found by Abdulhalim Dandoush <adandoush@gmail.com>. A serendipitous finding, as he didn't recognize the bug. Still, credits to him.

When you aggregate an object (in the example case an EnergySource) to more than a node, then funny things happens.
An example: installing the Internet stack on one of the nodes will install it in all the others as well. Just... the SAME object.

Basically, aggregating the same object to two different nodes will make them have the very same list of aggregated objects, and when you add one object to the first node, then all the other nodes will have it as well.

About the resolution: I guess that the easier thing is to just throw an error if an object is aggregated to more than another object. How... dunno yet.
Comment 1 Alexander Krotov 2016-04-09 19:18:49 UTC
Created attachment 2378 [details]
Proposed bugfix
Comment 2 Alexander Krotov 2016-04-09 19:22:29 UTC
Created attachment 2379 [details]
Updated bugfix

The original check is not needed anymore, so I amended its removal to my bugfix.

The fix just checks that each aggregate of the "other" object can not be reached by doing GetObject on "this" object. Before, the check was performed only on the primary type of the "other" object.
Comment 3 Alexander Krotov 2016-04-09 19:39:23 UTC
Created attachment 2380 [details]
Proposed patch

Cleaned up the patch and commit message a bit.
Comment 4 Tommaso Pecorella 2016-04-10 05:51:33 UTC
Created attachment 2381 [details]
Proposed patch

Clarified evermore the error message and updated the commit message to the new "standard" format
Comment 5 Alexander Krotov 2016-04-10 12:23:33 UTC
Created attachment 2382 [details]
Proposed patch

Fixed email
Comment 6 Tommaso Pecorella 2016-05-24 18:13:32 UTC
Pushet in changeset 12135:046554f2f0fa