Fix a segfault in folly::window
Summary: If the callback passed to `window` throws an exception, the process will segfault. This happens because `Core::doCallback` will execute a callback that throws an exception twice. Once with the original arguments, and again with the wrapped exception: https://fburl.com/wdmztc4l In the case of `window`, the callback in question moves its `ctx` to the next iteration of `spawn`, and so the second call to the callback segfaults. This prevents the issue by wrapping the call to `func` in a future, which captures the exception and returns it to the caller, rather than allowing it to bubble out and break things. Reviewed By: yfeldblum Differential Revision: D6802396 fbshipit-source-id: 3595c622e8e8f58209c7b20f553f7642bc49c089
Showing
Please register or sign in to comment