Bug 1939

Summary: Aggregating the same object to two nodes produce unexpected results
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: coreAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: critical CC: krotov, ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: test script
Proposed bugfix
Updated bugfix
Proposed patch
Proposed patch
Proposed patch

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