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

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Feb 5, 2024

Fixes flutter/flutter#141351 (speculatively - I have not directly reproduced this in an application, but without this change the added test crashes with a segfault in the submit callback).

If the rasterizer gets torn down, the surface gets released and the submit callback may fire on a collected object. Capturing this isn't safe. I'm not quite sure how that could happen from the linked stack trace though, since the draw call and the teardown call should be happening on the raster thread, and if the surface was reset then the draw call should've failed earlier...

The added test causes a segfault without the change.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

}
// Reset accumulated damage for current framebuffer
damage_[texture] = SkIRect::MakeEmpty();
damage[texture] = SkIRect::MakeEmpty();
Copy link
Member

Choose a reason for hiding this comment

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

Previously this had been clearing the texture's entry in the damage_ map within the GPUSurfaceMetalImpeller

IIUC that still needs to happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the damage map into a shared_ptr, which should also reduce some copying.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 5, 2024
@auto-submit auto-submit bot merged commit f8e24c0 into flutter:main Feb 5, 2024
@dnfield dnfield deleted the ios_impeller_surface branch February 5, 2024 21:20
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 6, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 6, 2024
…142954)

flutter/engine@9bd98bc...9c1b6c9

2024-02-05 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 5a5d4c262200 to b62066b42af0 (5 revisions) (flutter/engine#50366)
2024-02-05 tessertaha@gmail.com Fix iOS password autofill prompt dismissal causes layout to resize (flutter/engine#50364)
2024-02-05 31859944+LongCatIsLooong@users.noreply.github.com `visiblePassword` uses ASCII keyboard on iOS (flutter/engine#50293)
2024-02-05 dnfield@google.com [Impeller] Do not reference `this` in the submit callback for Metal GPU Surfaces (flutter/engine#50361)

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 matanl@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
@cuonghoang96
Copy link

Hi @dnfield , will this fix be available at Flutter 3.22 or Flutter 3.19?

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.

iOS Flutter 3.13.9 crash a lot devices on io.flutter.1.raster EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000000000b8

4 participants