Skip to content

Ios App Crash - Flutter skia::textlayout::TextLine::measureTextInsideOneRun #125380

@wtj900

Description

@wtj900

Is there an existing issue for this?

Steps to reproduce

I could not reproduce the crash.

Expected results

won't crash

Actual results

0 Flutter skia::textlayout::TextLine::measureTextInsideOneRun(skia::textlayout::SkRange<unsigned long>, skia::textlayout::Run const*, float, float, bool, bool) const (ParagraphImpl.h:164)
1 Flutter skia::textlayout::TextLine::iterateThroughSingleRunByStyles(skia::textlayout::Run const*, float, skia::textlayout::SkRange<unsigned long>, skia::textlayout::StyleType, std::_LIBCPP_ABI_NAMESPACE::function<void (skia::textlayout::SkRange<unsigned long>, skia::textlayout::TextStyle const&, skia::textlayout::TextLine::ClipContext const&)> const&) const (TextLine.cpp:0)
2 Flutter skia::textlayout::TextLine::iterateThroughSingleRunByStyles(skia::textlayout::Run const*, float, skia::textlayout::SkRange<unsigned long>, skia::textlayout::StyleType, std::_LIBCPP_ABI_NAMESPACE::function<void (skia::textlayout::SkRange<unsigned long>, skia::textlayout::TextStyle const&, skia::textlayout::TextLine::ClipContext const&)> const&) const (TextLine.cpp:0)
3 Flutter _ZNSt21_LIBCPP_ABI_NAMESPACE10__function6__funcIZN4skia10textlayout8TextLine28ensureTextBlobCachePopulatedEvE3$_3NS_9allocatorIS5_EEFbPKNS3_3RunEfNS3_7SkRangeImEEPfEEclEOSA_OfOSC_OSD_ (TextLine.cpp:273)
4 Flutter std::_LIBCPP_ABI_NAMESPACE::function<bool (skia::textlayout::Run const*, float, skia::textlayout::SkRange<unsigned long>, float*)>::operator()(skia::textlayout::Run const*, float, skia::textlayout::SkRange<unsigned long>, float*) const (function.h:1187)
5 Flutter skia::textlayout::TextLine::iterateThroughVisualRuns(bool, std::_LIBCPP_ABI_NAMESPACE::function<bool (skia::textlayout::Run const*, float, skia::textlayout::SkRange<unsigned long>, float*)> const&) const (TextLine.cpp:0)
6 Flutter skia::textlayout::TextLine::ensureTextBlobCachePopulated() (function.h:470)
7 Flutter skia::textlayout::TextLine::paint(skia::textlayout::ParagraphPainter*, float, float) (vector:1372)
8 Flutter skia::textlayout::ParagraphImpl::paint(skia::textlayout::ParagraphPainter*, float, float) (ParagraphImpl.cpp:225)
9 Flutter txt::ParagraphSkia::Paint(flutter::DisplayListBuilder*, double, double) (paragraph_skia.cc:234)
10 Flutter tonic::FfiDispatcher<flutter::Paragraph, void (flutter::Paragraph::*)(flutter::Canvas*, double, double), &(flutter::Paragraph::paint(flutter::Canvas*, double, double))>::Call(flutter::Paragraph*, flutter::Canvas*, double, double) (paragraph.cc:68)
11 App stub CallNativeThroughSafepoint + 88
12 App FfiTrampoline___paint$Method$FfiNative$Ptr (dart:ffi:1)
13 App Paragraph._paint (text.dart:2889)
14 App Canvas.drawParagraph (painting.dart:5275)
15 App TextPainter.paint (text_painter.dart:840)
16 App RenderParagraph.paint (paragraph.dart:919 [Inline: ContainerRenderObjectMixin.firstChild])
17 App RenderObject._paintWithContext (object.dart:2857)
18 App PaintingContext.paintChild (object.dart:237)
19 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
20 App RenderObject._paintWithContext (object.dart:2857)
21 App PaintingContext.paintChild (object.dart:237)
22 App RenderBoxContainerDefaultsMixin.defaultPaint (box.dart:2920)
23 App RenderFlex.paint (flex.dart:1094)
24 App RenderObject._paintWithContext (object.dart:2857)
25 App PaintingContext.paintChild (object.dart:237)
26 App RenderShiftedBox.paint (shifted_box.dart:69)
27 App RenderObject._paintWithContext (object.dart:2857)
28 App PaintingContext.paintChild (object.dart:237)
29 App RenderBoxContainerDefaultsMixin.defaultPaint (box.dart:2920)
30 App RenderFlex.paint (flex.dart:1094)
31 App RenderObject._paintWithContext (object.dart:2857)
32 App PaintingContext.paintChild (object.dart:237)
33 App RenderBoxContainerDefaultsMixin.defaultPaint (box.dart:2920)
34 App RenderFlex.paint (flex.dart:1094)
35 App RenderObject._paintWithContext (object.dart:2857)
36 App PaintingContext.paintChild (object.dart:237)
37 App RenderShiftedBox.paint (shifted_box.dart:69)
38 App RenderObject._paintWithContext (object.dart:2857)
39 App PaintingContext.paintChild (object.dart:237)
40 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
41 App RenderObject._paintWithContext (object.dart:2857)
42 App PaintingContext.paintChild (object.dart:237)
43 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
44 App RenderObject._paintWithContext (object.dart:2857)
45 App PaintingContext.paintChild (object.dart:237)
46 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
47 App RenderObject._paintWithContext (object.dart:2857)
48 App PaintingContext.paintChild (object.dart:237)
49 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
50 App RenderObject._paintWithContext (object.dart:2857)
51 App PaintingContext.paintChild (object.dart:237)
52 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
53 App RenderObject._paintWithContext (object.dart:2857)
54 App PaintingContext._repaintCompositedChild (object.dart:174)
55 App PaintingContext._compositeChild (object.dart:267)
56 App PaintingContext.paintChild (object.dart:250)
57 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
58 App RenderObject._paintWithContext (object.dart:2857)
59 App PaintingContext.paintChild (object.dart:237)
60 App RenderSliverMultiBoxAdaptor.paint (sliver_multi_box_adaptor.dart:663 [Inline: ContainerRenderObjectMixin.childAfter])
61 App RenderObject._paintWithContext (object.dart:2857)
62 App PaintingContext.paintChild (object.dart:237)
63 App RenderSliverEdgeInsetsPadding.paint (sliver_padding.dart:282)
64 App RenderObject._paintWithContext (object.dart:2857)
65 App PaintingContext.paintChild (object.dart:237)
66 App RenderViewportBase._paintContents (viewport.dart:709 [Inline: ListIterator.moveNext])
67 App RenderViewportBase._paintContents (viewport.dart:708)
68 App PaintingContext.pushLayer (object.dart:475)
69 App PaintingContext.pushClipRect (object.dart:0)
70 App RenderViewportBase.paint (viewport.dart:686)
71 App RenderObject._paintWithContext (object.dart:2857)
72 App PaintingContext._repaintCompositedChild (object.dart:174)
73 App PaintingContext._compositeChild (object.dart:267)
74 App PaintingContext.paintChild (object.dart:250)
75 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
76 App RenderObject._paintWithContext (object.dart:2857)
77 App PaintingContext.paintChild (object.dart:237)
78 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
79 App RenderObject._paintWithContext (object.dart:2857)
80 App PaintingContext.paintChild (object.dart:237)
81 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
82 App RenderObject._paintWithContext (object.dart:2857)
83 App PaintingContext.paintChild (object.dart:237)
84 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
85 App RenderObject._paintWithContext (object.dart:2857)
86 App PaintingContext.paintChild (object.dart:237)
87 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
88 App RenderObject._paintWithContext (object.dart:2857)
89 App PaintingContext.paintChild (object.dart:237)
90 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
91 App RenderObject._paintWithContext (object.dart:2857)
92 App PaintingContext.paintChild (object.dart:237)
93 App _RenderLayoutBuilder.paint (layout_builder.dart:335)
94 App RenderObject._paintWithContext (object.dart:2857)
95 App PaintingContext._repaintCompositedChild (object.dart:174)
96 App PipelineOwner.flushPaint (object.dart:1131 [Inline: ListIterator.moveNext])
97 App RendererBinding.drawFrame (binding.dart:520)
98 App WidgetsBinding.drawFrame (binding.dart:866)
99 App RendererBinding._handlePersistentFrameCallback (binding.dart:382)
100 App RendererBinding._handlePersistentFrameCallback (binding.dart:380)
101 App SchedulerBinding._invokeFrameCallback (binding.dart:1295)
102 App SchedulerBinding.handleDrawFrame (binding.dart:1217 [Inline: ListIterator.moveNext])
103 App SchedulerBinding._handleDrawFrame (binding.dart:1058)
104 App SchedulerBinding._handleDrawFrame (binding.dart:1058)
105 App _rootRun (zone.dart:1393)
106 App _rootRun + 124
107 App _CustomZone.run (zone.dart:1296)
108 App _CustomZone.runGuarded (zone.dart:1210)
109 App _invoke (hooks.dart:137)
110 App PlatformDispatcher._drawFrame (platform_dispatcher.dart:337)
111 App _drawFrame (hooks.dart:110)
112 App _drawFrame (hooks.dart:110)
113 App stub InvokeDartCode + 220
114 Flutter dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long) (dart_entry.cc:0)
115 Flutter Dart_InvokeClosure (dart_api_impl.cc:4778)
116 Flutter flutter::Shell::OnAnimatorBeginFrame(fml::TimePoint, unsigned long long) (dart_invoke.cc:30)
117 Flutter _ZNSt21_LIBCPP_ABI_NAMESPACE10__function6__funcIZN7flutter8Animator10AwaitVSyncEvE3$_3NS_9allocatorIS4_EEFvNS_10unique_ptrINS2_20FrameTimingsRecorderENS_14default_deleteIS8_EEEEEEclEOSB_ (animator.cc:106)
118 Flutter _ZNSt21_LIBCPP_ABI_NAMESPACE10__function6__funcIZN7flutter11VsyncWaiter12FireCallbackEN3fml9TimePointES5_bE3$_0NS_9allocatorIS6_EEFvvEEclEv (unique_ptr.h:302)
119 Flutter fml::MessageLoopImpl::FlushTasks(fml::FlushType) (message_loop_impl.cc:128)
120 Flutter fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) (message_loop_darwin.mm:86)
121 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
125 CoreFoundation _CFRunLoopRunSpecific + 572
126 Flutter fml::MessageLoopDarwin::Run() (message_loop_darwin.mm:52)
127 Flutter __thread_proxy<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, (lambda at ../../flutter/fml/thread.cc:79:7)> > (message_loop_impl.cc:0)
128 libsystem_pthread.dylib
__pthread_start + 116

Code sample

import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

[!] Flutter (Channel stable, 3.7.11, on macOS 13.1 22C65 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.7.11 on channel stable at /Users/wangshichao/fvm/versions/3.7.11
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/wangshichao/fvm/versions/3.7.11. Consider adding /Users/wangshichao/fvm/versions/3.7.11/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f72efea43c (11 days ago), 2023-04-11 11:57:21 -0700
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn
    • 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 33.0.2)
    • Android SDK at /Users/wangshichao/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.2

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

[✓] Android Studio (version 2022.1)
    • 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 11.0.15+0-b2043.56-8887301)

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

[✓] Connected device (4 available)
    • iPhone8P测试机 (mobile)   • 6b3a843b023dd9b98a603d0d9bafb8b64bed2760 • ios            • iOS 15.3.1 19D52
    • iPhone 14 Pro (mobile) • CFC8E488-A530-4171-8071-26444994AC81     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)        • macos                                    • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)           • chrome                                   • web-javascript • Google Chrome 112.0.5615.137

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions