Bugzilla – Full Text Bug Listing |
Summary: | Problem stopping ns3::TapBridgeDevice | ||
---|---|---|---|
Product: | ns-3 | Reporter: | alina <aquereilhac> |
Component: | devices | Assignee: | Tom Goff <tgoff> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | tgoff, tomh |
Priority: | P5 | ||
Version: | pre-release | ||
Hardware: | All | ||
OS: | All |
Description
alina
2010-08-05 13:09:59 EDT
Is this related to bug 903? Does the patch posted there resolve the problem? The patch proposed in http://www.nsnam.org/bugzilla/show_bug.cgi?id=903 does not solve the problem, but in order to reproduce the bug I am reporting it is necessary to invoke Simulator::ScheduleDestroy (&TapBridge::StopTapDevice, this) (Which is the addition done by that patch). The bug can be reproduced after applying http://www.nsnam.org/bugzilla/attachment.cgi?id=859 by running the ns-3 tap example 'tap-csma.cc' and making sure there is no traffic in the tap device other than the generated by the simulation. So the bug doesn't only occur when the simulation is run using python as I originally thought. Below is the excerpt of the strace output for the tap-csma.cc example that shows that after the main thread (pid 29485) invokes a close on the the tap fd (close(8)) while the other thread(pid 29485) is doing a read(8, ), the main thread blocks in a futex ( m_readThread->Join (); ) waiting for the other thread to exit. So, unless some traffic makes the read return the program never exits. [pid 29485] read(8, <unfinished ...> [pid 29478] <... futex resumed> ) = 0 [pid 29478] futex(0xe00140, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 29478] futex(0xe0016c, FUTEX_WAIT_PRIVATE, 109, {0, 1795986}) = -1 ETIMEDOUT (Connection timed out) [pid 29478] futex(0xe00140, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 29478] futex(0xe0016c, FUTEX_WAIT_PRIVATE, 111, {3, 825482687} <unfinished ...> [pid 29485] <... read resumed> "33\0\0\0\2\0\0\0\0\0\1\206\335`\0\0\0\0\20:\377\376\200\0\0\0\0\0\0\2\0"..., 65536) = 70 [pid 29485] futex(0xe0016c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xe00168, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 [pid 29485] read(8, <unfinished ...> [pid 29478] <... futex resumed> ) = 0 [pid 29478] futex(0xe00140, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 29478] futex(0xe0016c, FUTEX_WAIT_PRIVATE, 113, {0, 1685728}) = -1 ETIMEDOUT (Connection timed out) [pid 29478] futex(0xe00140, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 29478] futex(0xe0016c, FUTEX_WAIT_PRIVATE, 115, {0, 177472329}) = -1 ETIMEDOUT (Connection timed out) [pid 29478] futex(0xe00140, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 29478] close(8) = 0 [pid 29478] futex(0x7f63786fd9e0, FUTEX_WAIT, 29485, NULL |