Skip to content

Reproducible wasm-only crash #191976

Closed

Description

@jthlim

Build Command & Compile Logs

$ flutter build web --wasm

Compilation succeeds, but Chrome crashes consistently. If it doesn't crash on start up, it will after scrolling up/down a little.

Target Browser & Version

Chrome 152.0.7977.65 (Official Build) (arm64) macOS

Blocking Packages / Dependencies

No extra

Steps to reproduce & Actual Behavior

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Wasm Failure',
      theme: ThemeData(colorScheme: .fromSeed(seedColor: Colors.deepPurple)),
      home: const MyHomePage(title: 'Wasm Failure Demo Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: ListView.builder(
        itemCount: 100,
        itemBuilder: (context, index) {
          return SizedBox(
            width: double.infinity,
            height: 64,
            child: CustomPaint(
              key: ValueKey(index),
              painter: RawPainter(index: index),
            ),
          );
        },
      ),
    );
  }
}

class RawPainter({required final int index}) extends CustomPainter {
  static const crashWasm = true;

  static const colors = [
    Colors.red,
    Colors.orange,
    Colors.yellow,
    Colors.green,
    Colors.blue,
    Colors.indigo,
  ];

  @override
  void paint(Canvas canvas, Size size) {
    final path = Path();
    path.moveTo(0, size.height);
    path.lineTo(size.width / 2, 0);
    path.lineTo(size.width, size.height);

    final color = colors[index % colors.length];

    final paint = Paint()
      ..style = PaintingStyle.stroke
      ..color = color
      ..strokeWidth = 1;

    if (crashWasm) {
      canvas.drawPath(path, paint);

      path.close();
      paint.style = PaintingStyle.fill;
      paint.color = color.withAlpha(32);
      canvas.drawPath(path, paint);
    } else {
      final path2 = Path.from(path);
      canvas.drawPath(path, paint);

      path2.close();
      paint.style = PaintingStyle.fill;
      paint.color = color.withAlpha(32);
      canvas.drawPath(path2, paint);
    }
  }

  @override
  bool shouldRepaint(RawPainter oldDelegate) => index != oldDelegate.index;
}

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.47.1, on macOS 27.0 26A5421a darwin-arm64, locale en-US)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[!] Xcode - develop for iOS and macOS (Xcode 27.0)
    ✗ Unable to get list of installed Simulator runtimes.
    ! CocoaPods not installed.
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
[✓] Chrome - develop for the web
[✓] Connected device (2 available)
    ! Error: Browsing on the local area network for Javelin. Ensure the device is unlocked and attached with a cable
      or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

Activity

  1. added
    platform-webWeb applications specifically
    e: wasmIssues related to the wasm build of Flutter Web.
    c: tfw4Issues filed during the 'Try Flutter Web with WebAssembly' (TFW^4) campaign
    on Aug 28, 2026
  2. jthlim commented on Aug 28, 2026

    @jthlim
    Author

    Example console messages in Chrome:

    Uncaught RuntimeError: null function
        at skwasm.wasm:0xbad0
        at skwasm.wasm:0x1565c6
        at skwasm.wasm:0xbee62
        at skwasm.wasm:0x28d7bd
        at skwasm.wasm:0x208fc1
        at skwasm.js:33:522
        at skwasm.js:32:165
    
    skwasm.wasm:0xb474 Uncaught RuntimeError: memory access out of bounds
        at skwasm.wasm:0xb474
        at skwasm.wasm:0x13a91
        at skwasm.wasm:0x26b482
        at M (main.dart.wasm:0xc471e)
        at M (main.dart.wasm:0xc45d7)
        at M (main.dart.wasm:0xa3114)
        at M (main.dart.wasm:0xbb10c)
        at M (main.dart.wasm:0xbb0d3)
        at main.dart.mjs:370:72
    $emscripten_builtin_free	@	skwasm.wasm:0xb474
    $func388	@	skwasm.wasm:0x13a91
    $path_dispose	@	skwasm.wasm:0x26b482
    $func1999	@	main.dart.wasm:0xc471e
    $func1993	@	main.dart.wasm:0xc45d7
    $func801	@	main.dart.wasm:0xa3114
    $func1624	@	main.dart.wasm:0xbb10c
    $func1623	@	main.dart.wasm:0xbb0d3
    (anonymous)	@	main.dart.mjs:370
    
  3. jthlim commented on Aug 28, 2026

    @jthlim
    Author

    Confirmed issue still exists in 3.47.2:

    Flutter (Channel stable, 3.47.2, on macOS 27.0 26A5421a darwin-arm64, locale en-US)
    
  4. added
    c: crashStack traces logged to the console
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-webOwned by Web platform team
    on Aug 29, 2026
  5. mbcorona commented on Aug 29, 2026

    @mbcorona
    Member

    Hi @jthlim, thanks for the minimal repro and the crash logs. Routing to the web team.

  6. added theissue type on Aug 30, 2026
  7. added
    P1High-priority issues at the top of the work list
    on Sep 2, 2026
  8. added a commit that references this issue on Sep 24, 2026
    7ce9047
  9. github-actions commented on Oct 8, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolec: tfw4Issues filed during the 'Try Flutter Web with WebAssembly' (TFW^4) campaigne: wasmIssues related to the wasm build of Flutter Web.found in release: 3.47Found to occur in 3.47has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform team

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions