Commit d6d7e551cb185c310a2a200ed9b3bcfd27653051

Colin Blundell 2023-04-24T14:42:06

[ContextEGL] Check for default FBO being null in onUnmakeCurrent https://chromium-review.googlesource.com/c/angle/angle/+/4451908 added restoring of the default FBO ID when making external contexts un-current. However, it turns out that onUnmakeCurrent() will be called during destruction even if it was previously called without an intervening makeCurrent() call [1], with the first call having un-set the default FBO [2]. Hence, we need to check for whether the default FBO exists in this flow to avoid crashes [3]. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/libANGLE/Context.cpp;l=766-787?q=Context.cpp&ss=chromium [2] https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/angle/src/libANGLE/Context.cpp;l=931;drc=a61b95c63b0b75c1cfe872d9c8cdf927c226046e;bpv=1;bpt=1 [3] https://crash.corp.google.com/browse?q=product_name%3D%22AndroidWebView%22+AND+EXISTS+%28SELECT+1+FROM+UNNEST%28expanded_custom_data.ChromeCrashProto.experiments.ids%29+expanded_custom_data_ChromeCrashProto_experiments_ids+WHERE+expanded_custom_data_ChromeCrashProto_experiments_ids%3D%2741e765a5-991da97%27%29+AND+product.Version%3D%27114.0.5730.0%27+AND+expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%27rx%3A%3AContextEGL%3A%3AonUnMakeCurrent%27+AND+EXISTS+%28SELECT+1+FROM+UNNEST%28CrashedStackTrace.StackFrame%29+WHERE+FunctionName%3D%27rx%3A%3AContextEGL%3A%3AonUnMakeCurrent%28gl%3A%3AContext+const*%29%27%29+AND+EXISTS+%28SELECT+1+FROM+UNNEST%28CrashedStackTrace.StackFrame%29+WHERE+FunctionName%3D%27rx%3A%3AContextEGL%3A%3AonUnMakeCurrent%28gl%3A%3AContext+const*%29%27%29&stbtiq=&reportid=&index=0 Bug: chromium:1434315, chromium:1436354 Change-Id: I676dad65dc249e87ee0cae169ba93f605f776341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4467147 Auto-Submit: Colin Blundell <blundell@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>