Skip to content

NPE in Surface.createOrUpdateSurface #154402

@kpsroka

Description

@kpsroka

Steps to reproduce

  1. Navigate to https://app.superlist.com/ (in Firefox, Chrome, or Edge)
  2. ???.
  3. Notice errors thrown in console. (no profit)

While I'm not sure how to consistently reproduce this, some Superlist users seem to do. It's hard to guess what's the actual impact on user experience as well, but our Sentry gets hammered with this. Given that these can happen repeatedly for a single client I'd assume that process actually doesn't crash.

Expected results

No crashes reported!

Actual results

Crashes are reported :(

Code sample

Sadly it's too deep in the bowels of engine to figure out user-side code.

Screenshots or Video

Stack trace

The code lines don't match very well, but calls do.

minified:aIP: Null check operator used on a null value
  at Surface.createOrUpdateSurface(org-dartlang-sdk:///lib/_engine/engine/canvaskit/surface.dart:249:24)
  at OffscreenCanvasViewRasterizer.rasterizeToCanvas.a5X.prototypebaf(org-dartlang-sdk:///lib/_engine/engine/canvaskit/offscreen_canvas_rasterizer.dart:61:16)
  at ViewRasterizer.draw(org-dartlang-sdk:///lib/_engine/engine/canvaskit/rasterizer.dart:60:5)
  at _wrapJsFunctionForAsync(org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/async_patch.dart:303:19)
  at _wrapJsFunctionForAsync.<anonymous function>(org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/async_patch.dart:328:23)
  at _asyncStartSync(org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/async_patch.dart:233:3)
  at ViewRasterizer.draw(org-dartlang-sdk:///lib/_engine/engine/canvaskit/rasterizer.dart:45:19)
  at ViewRasterizer.draw(org-dartlang-sdk:///lib/_engine/engine/canvaskit/rasterizer.dart:45:19)
  at CanvasKitRenderer._renderScene(org-dartlang-sdk:///lib/_engine/engine/canvaskit/renderer.dart:433:11)
  at _wrapJsFunctionForAsync(org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/async_patch.dart:303:19)
JS code snippet

This is where the StackTrace points to from in the compiled JS code:

if(!g.d){s=g.cy
if(s!=null&&d===s.a&&a.b===s.b){r=$.lg().d
if(r==null){d=self.window.devicePixelRatio
r=d===0?1:d}if(g.c&&r!==g.ay)g.Ks()
d=g.a
d.toString [<-- this line]

It corresponds very neatly with web_ui/lib/src/engine/canvaskit/surface.dart

Logs

No response

Flutter Doctor output

Doctor output
[!] Flutter (Channel master, 3.24.0-1.0.pre.565, on macOS 14.6.1 23G93 darwin-arm64, locale en-GB)
    • Flutter version 3.24.0-1.0.pre.565 on channel master at /Users/krzysztof/Workspace/superlist/.flutter
    ! Warning: `flutter` on your path resolves to /Users/krzysztof/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at
      /Users/krzysztof/Workspace/superlist/.flutter. Consider adding /Users/krzysztof/Workspace/superlist/.flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/krzysztof/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/krzysztof/Workspace/superlist/.flutter.
      Consider adding /Users/krzysztof/Workspace/superlist/.flutter/bin to the front of your path.
    ! Upstream repository https://github.com/superlistapp/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/superlistapp/flutter.git to dismiss this error.
    • Framework revision f2ba204917 (2 weeks ago), 2024-08-13 11:20:08 -0400
    • Engine revision 77cd5447b9
    • Dart version 3.6.0 (build 3.6.0-144.0.dev)
    • DevTools version 2.38.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/krzysztof/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2023.2)
    • 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.9+0-17.0.9b1087.7-11185874)

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

[✓] Connected device (4 available)
    • iPhone SE RED (mobile)          • 00008110-001931D414E0401E • ios            • iOS 17.3.1 21D61
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 128.0.6613.113

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

! Doctor found issues in 1 category.

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consolee: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions