Don't execute things that may throw in Bridge/JSCExecutor dtors

Summary:In testing, I've found that there's no good way to return stack traces to the server for exceptions that happen in dtor's. If the dtor is not marked nothrow(false), the exceptions are uncatchable (and bubble up as a std::abort without exception info) and if annotated properly, the program instead crashes trying to resume the stack, again a std::abort without exception info.

Instead, I created a separate destroy method that can be called (and protected via fbjni) to make the dtor's no longer execute code that may throw. Note that we don't really expect the code that was previously in ~JSCExecutor() to throw, but it was in production and we had absolutely no info to help debug it.

Reviewed By: mhorowitz

Differential Revision: D2989999

fb-gh-sync-id: 4cf9de5e0592fe6830a9903375363a78e1339a94
shipit-source-id: 4cf9de5e0592fe6830a9903375363a78e1339a94
This commit is contained in:
Andy Street
2016-03-01 04:25:24 -08:00
committed by Facebook Github Bot 6
parent a72c2950d6
commit 58f86b2d91
10 changed files with 37 additions and 24 deletions

View File

@@ -235,6 +235,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
new Runnable() {
@Override
public void run() {
mBridge.destroy();
mBridge.dispose();
bridgeDisposeFuture.set(null);
}