Bug 2776 - MacLow::StartTransmission ends up in segmentation fault
MacLow::StartTransmission ends up in segmentation fault
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P2 major
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-21 04:58 UTC by Akin Soysal
Modified: 2017-08-23 16:48 UTC (History)
1 user (show)

See Also:


Attachments
proposed mac_low_fix. (827 bytes, patch)
2017-08-21 04:58 UTC, Akin Soysal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Akin Soysal 2017-08-21 04:58:29 UTC
Created attachment 2905 [details]
proposed mac_low_fix.

Hello,

I have discovered and fixed a nasty bug. It came up in changeset 12571.

When MacLow::StartTransmission is called, first m_currentDca = dca; assignment is done and then CancelAllEvents (); is called. However, if there is any active timer exists, CancelAllEvents() empties the member m_currentDca inside. Since the assignment of dca is done before CancelAllEvents(), new dca is also emptied and whenever MacLow() calls its member m_currentDca, segmentation fault is thrown. Bug can be fixed by moving the assignment after the CancelAllEvents() function call.

I am not sure about the frequency of this bug but its severity is high and I have encountered it when I have applied our new fading channel.

After this fix, our curves seemed a lot smoother, it is also possible that it does not cause segmentation fault but also other problems, so I think this should be fixed ASAP!

Bugfix is in the attachment.

Regards,
Akın
Comment 1 sebastien.deronne 2017-08-23 16:48:52 UTC
Thanks Akin for the fix.
Pushed in changeset 13050:969140f099bb.