Skip to content

Commit

Permalink
folly: futexWaitUntilImpl: avoid abort triggered via tao/queues tests
Browse files Browse the repository at this point in the history
Summary:
* folly/test/DeterministicSchedule.cpp (folly): Tao/queues tests exposed
an unhandled case in this code: when (futex->data == expected) happens,
we would call futexErrnoToFutexResult with a futexErrno value of 0,
which would cause an abort (unhandled valued in switch).
Here's a stack trace from the abort: https://phabricator.fb.com/P12558008
showing the invalid futexErrno value in frame #4.

Test Plan:
fbconfig -r --platform-all=gcc-4.8.1-glibc-2.17 --sanitize=address tao/queues:TimeoutWorkQueueTests
_bin/tao/queues/WorkQueueTests -fbunit_test_regexp '^mt\_stress\_deterministic$'

Reviewed By: [email protected]

FB internal diff: D1404572

Tasks: 4494871
  • Loading branch information
meyering authored and Gownta committed Jun 27, 2014
1 parent 8ee3ba5 commit b27ed0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions folly/test/DeterministicSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ FutexResult futexWaitUntilImpl(Futex<DeterministicAtomic>* futex,
break;
}
}
} else {
futexErrno = EWOULDBLOCK;
}
futexLock.unlock();
DeterministicSchedule::afterSharedAccess();
Expand Down

0 comments on commit b27ed0f

Please sign in to comment.