Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in RenderObject.getTransformTo #148656

Open
nikorehnback opened this issue May 20, 2024 · 6 comments
Open

Crash in RenderObject.getTransformTo #148656

nikorehnback opened this issue May 20, 2024 · 6 comments
Labels
a: production Issues experienced in live production apps c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. needs repro info Automated crash report whose cause isn't yet known P2 Important issues not at the top of the work list team-framework Owned by Framework team triaged-framework Triaged by Framework team

Comments

@nikorehnback
Copy link

nikorehnback commented May 20, 2024

Steps to reproduce

Not sure how to reproduce the scenario. Got thousands of crashes reported into Crashlytics.

Expected results

Flutter framework shouldn't crash. Looking at the source code owner is force casted to non null:

final RenderObject? rootNode = owner!.rootNode;

Actual results

Flutter framework crashes with null pointer exception. Would be nice to understand if this is a bug in Flutter and if not, in which scenario this can happen.

Code sample

Screenshots or Video

No response

Logs

Logs
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown .
#00 pc 0x365b13 com.app.redacted (RenderObject.getTransformTo [object.dart:3337]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#01 pc 0x365bb3 com.app.redacted (RenderBox.localToGlobal [box.dart:2619]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#02 pc 0x3e4f23 com.app.redacted (_PlatformViewPlaceholderBox.performLayout.<anonymous closure> [platform_view.dart:1279]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#03 pc 0x9f0d3b com.app.redacted (SchedulerBinding._invokeFrameCallback [binding.dart:1386]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#04 pc 0x9f0b7f com.app.redacted (SchedulerBinding.handleDrawFrame [binding.dart:1322]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#05 pc 0x3a8997 com.app.redacted (SchedulerBinding._handleDrawFrame [binding.dart:1169]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#06 pc 0x3a884b com.app.redacted (SchedulerBinding._handleDrawFrame [binding.dart:1151]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#07 pc 0x325f63 com.app.redacted (_invoke [hooks.dart:312]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#08 pc 0x3280b7 com.app.redacted (PlatformDispatcher._drawFrame [platform_dispatcher.dart:399]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#09 pc 0x32806b com.app.redacted (_drawFrame [hooks.dart:283]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#10 pc 0x3280e7 com.app.redacted (_drawFrame [hooks.dart:281]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.5, on macOS 13.5 22G74 darwin-arm64, locale en-GB)
    • Flutter version 3.19.5 on channel stable at /Users/developer/Downloads/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (8 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
    • Android SDK at /Users/developer/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0-rc2
    • ANDROID_HOME = /Users/developer/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.86.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.82.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.5 22G74 darwin-arm64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 124.0.6367.208

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@jonahwilliams
Copy link
Member

super.performLayout();
// A call to `localToGlobal` requires waiting for a frame to render first.
SchedulerBinding.instance.addPostFrameCallback((_) {
onLayout(size, localToGlobal(Offset.zero));
}, debugLabel: 'PlatformViewPlaceholderBox.onLayout');

Not sure what happens if this placeholder gets unmounted before the postframe callback fires (or if that can happen). But I think that would result in the renderbox check failing.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 20, 2024
@darshankawar
Copy link
Member

Labeling for team's tracking.

@darshankawar darshankawar added framework flutter/packages/flutter repository. See also f: labels. a: production Issues experienced in live production apps needs repro info Automated crash report whose cause isn't yet known team-framework Owned by Framework team c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels May 20, 2024
@goderbauer
Copy link
Member

Yeah, looks like the frame callback is missing a check for attached.

@goderbauer goderbauer added P2 Important issues not at the top of the work list triaged-framework Triaged by Framework team labels May 21, 2024
@pamafe1976
Copy link

Getting several crash reports due to this error too. in my case, they are all happening in IOS.

@wxjrkm520
Copy link

I am experiencing the same issue. It currently occurs at least with Lottie and ClipPath.

@wxjrkm520
Copy link

they are all happening in IOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: production Issues experienced in live production apps c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. needs repro info Automated crash report whose cause isn't yet known P2 Important issues not at the top of the work list team-framework Owned by Framework team triaged-framework Triaged by Framework team
Projects
None yet
Development

No branches or pull requests

6 participants