From: Nathan Bronson Date: Wed, 7 Dec 2016 19:39:00 +0000 (-0800) Subject: fix FutureTest/RequestContext X-Git-Tag: v2016.12.12.00~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=65d64c0d7d7d23b5bf0c4e52d66d2caeb5f06ced;p=folly.git fix FutureTest/RequestContext Summary: Fix use-after-destroy of NewThreadExecutor. Detected by opt-ubsan tests. Reviewed By: yfeldblum Differential Revision: D4291900 fbshipit-source-id: 206f1d7b80fa04e1570e4b7a20e50b9a8ceb7bcb --- diff --git a/folly/futures/test/FutureTest.cpp b/folly/futures/test/FutureTest.cpp index 7d0275d6..5dc02dd2 100644 --- a/folly/futures/test/FutureTest.cpp +++ b/folly/futures/test/FutureTest.cpp @@ -822,8 +822,8 @@ TEST(Future, RequestContext) { }; Promise p1, p2; + NewThreadExecutor e; { - NewThreadExecutor e; folly::RequestContextScopeGuard rctx; RequestContext::get()->setContextData( "key", folly::make_unique(true));