Bugzilla – Bug 1220
FdReader always stops with NS_FATAL_ERROR
Last modified: 2011-08-16 14:39:28 EDT
Created attachment 1204 [details] Validate m_stop in inner FdReader::Run() loop to prevent NS_FATAL_ERROR Validation is missing on m_stop in the inner loop of FdReader::Run(), to avoid always stopping with NS_FATAL_ERROR. This same bug is also present in ns-3.11.
Created attachment 1205 [details] Code used to test the problem. Code to test the problem.
Created attachment 1220 [details] Proposed fix I think the main issue is that the event pipe can be closed before the read thread completes. This patch closes the event pipe file descriptor after joining the read thread to avoid a possible race condition. It also makes error handling less permissive by treating most read errors as fatal.
(In reply to comment #2) > Created attachment 1220 [details] > Proposed fix > > I think the main issue is that the event pipe can be closed before the > read thread completes. > > This patch closes the event pipe file descriptor after joining the > read thread to avoid a possible race condition. It also makes error > handling less permissive by treating most read errors as fatal. This patch does not apply against ns-3-dev. Could you please produce one that does?
changeset: 17902e1844be