Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Oct 30, 2023

Speculative fix for the first crash noted in flutter/flutter#136628 (comment)

nextDrawble can return null if the method times out.

Fixes flutter/flutter#136525

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.


auto* mtl_layer = (CAMetalLayer*)layer;

auto drawable = impeller::SurfaceMTL::GetMetalDrawableAndValidate(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be nullptr, see

if (context == nullptr || !context->IsValid() || layer == nil) {
return nullptr;
}
id<CAMetalDrawable> current_drawable = nil;
{
TRACE_EVENT0("impeller", "WaitForNextDrawable");
current_drawable = [layer nextDrawable];
}
if (!current_drawable) {
VALIDATION_LOG << "Could not acquire current drawable.";
return nullptr;
}

@zanderso
Copy link
Member

zanderso commented Nov 2, 2023

Should this have a test, or does it need a test exemption?

@jonahwilliams
Copy link
Contributor Author

Based on our discussion this week, this needs a test and I plan on adding one ... a bit later. :)

@jonahwilliams
Copy link
Contributor Author

I have added tests.

sources += [ "gpu_surface_metal_impeller_unittests.mm" ]
}

if (is_mac) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider combining back-to-back if (is_mac)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L GEE TEE EM

@jonahwilliams
Copy link
Contributor Author

Tests are working for real!

@jonahwilliams
Copy link
Contributor Author

nvm still not working.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 8, 2023
@auto-submit auto-submit bot merged commit b0310da into flutter:main Nov 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 8, 2023
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Nov 8, 2023
…138096)

flutter/engine@117d47a...b0310da

2023-11-08 jonahwilliams@google.com [Impeller] null check drawable. (flutter/engine#47488)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Impeller] Upgrading to 3.13.0 lead to EXC_BAD_ACCESS error

4 participants