Repository navigation
Closed as not planned
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsdependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
While working on exporting public API types from services/*.dart library I faced a crash with segmentation fault related to mixed export. I managed to reduce the diff fo the PR to have a simpler reproduction I pasted below (I failed to reduce it only with dart).
Steps to Reproduce
- Checkout flutter main branch (on d4929bc for me)
- Apply the following diff
diff --git a/packages/flutter/lib/src/services/autofill.dart b/packages/flutter/lib/src/services/autofill.dart
index 22cde8eb0b..e1791c0a3c 100644
--- a/packages/flutter/lib/src/services/autofill.dart
+++ b/packages/flutter/lib/src/services/autofill.dart
@@ -5,6 +5,8 @@
import 'package:flutter/foundation.dart';
import 'text_input.dart';
+export 'text_input.dart' show TextEditingValue;
+
/// A collection of commonly used autofill hint strings on different platforms.
///
/// Each hint is pre-defined on at least one supported platform. See their
diff --git a/packages/flutter/lib/src/services/text_editing_delta.dart b/packages/flutter/lib/src/services/text_editing_delta.dart
index 07e57e93c6..80079b3677 100644
--- a/packages/flutter/lib/src/services/text_editing_delta.dart
+++ b/packages/flutter/lib/src/services/text_editing_delta.dart
@@ -7,6 +7,8 @@ import 'package:flutter/foundation.dart';
import 'text_editing.dart';
import 'text_input.dart' show TextEditingValue;
+export 'text_input.dart' show TextEditingValue;
+
TextAffinity? _toTextAffinity(String? affinity) {
switch (affinity) {
case 'TextAffinity.downstream':
diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart
index 85a3244107..7f98db51db 100644
--- a/packages/flutter/lib/src/services/text_input.dart
+++ b/packages/flutter/lib/src/services/text_input.dart
@@ -25,6 +25,9 @@ import 'text_editing_delta.dart';
export 'dart:ui' show TextAffinity;
+export 'autofill.dart' show AutofillConfiguration;
+export 'text_editing_delta.dart' show TextEditingDelta;
+
/// Indicates how to handle the intelligent replacement of dashes in text input.
///
/// See also:- Create a new flutter project with
flutter create my_test - Run tests via
flutter test
Expected results: no errors
Actual results:
Logs
~/tmp/my_test$ flutter test
00:02 +0: Counter increments smoke test
unhandled error during finalization of test:
/home/xxx/tmp/my_test/test/widget_test.dart
TestDeviceException(Shell subprocess crashed with segmentation fault.)
#0 FlutterTesterTestDevice.finished
(package:flutter_tools/src/test/flutter_tester_device.dart:241:5)
<asynchronous suspension>
#1 FlutterTesterTestDevice.kill
(package:flutter_tools/src/test/flutter_tester_device.dart:223:5)
<asynchronous suspension>
#2 FlutterPlatform._startTest.<anonymous closure>
(package:flutter_tools/src/test/flutter_platform.dart:485:9)
<asynchronous suspension>
#3 FlutterPlatform._startTest
(package:flutter_tools/src/test/flutter_platform.dart:538:11)
<asynchronous suspension>
00:02 +0: Counter increments smoke test - did not complete [E]
00:02 +0: Some tests failed.
No tests were found.
~/tmp/my_test$ flutter analyze
Analyzing my_test...
No issues found! (ran in 2.7s)
~/tmp/my_test$ flutter doctor -v
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1317, on Ubuntu 20.04.4 LTS
5.4.0-120-generic, locale fr_FR.UTF-8)
• Flutter version 3.1.0-0.0.pre.1317 on channel master at
/home/xxx/PERSONNEL/dev/dart/flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d4929bc828 (il y a 9 heures), 2022-06-20 20:09:05 -0400
• Engine revision ceac23d7a9
• Dart version 2.18.0 (build 2.18.0-190.0.dev)
• DevTools version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/xxx/softwares/android-sdk-linux/
• Platform android-31, build-tools 30.0.3
• ANDROID_HOME = /home/xxx/softwares/android-sdk-linux/
• Java binary at: /home/xxx/softwares/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2020.3)
• Android Studio at /home/xxx/softwares/android-studio
• Flutter plugin version 61.0.2
• Dart plugin version 203.8430
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] IntelliJ IDEA Community Edition (version 2020.3)
• IntelliJ at /home/xxx/softwares/jetbrains/idea-IC-203.7148.57
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin version 203.6912
[✓] VS Code (version 1.68.1)
• VS Code at /usr/share/code
• Flutter extension version 3.42.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.4 LTS
5.4.0-120-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsdependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Activity
maheshj01 commentedon Jun 22, 2022
Hi @a14n, Unfortunately, I can't reproduce it on my side, neither on a mac or Linux host. let me know if I am missing anything.
Linux (logs)
mac (logs)
a14n commentedon Jun 22, 2022
@maheshmnj Did you apply the diff I mentioned at step 2 of the Steps to Reproduce section?
maheshj01 commentedon Jun 22, 2022
@a14n Looks like I missed that part initially, and now when I try to apply the patch I get an error (Perhaps I am doing something wrong) Heres is what I did
~Documents/flutter_devwhich has been checked out to above comment usinggit checkout d4929bc828ff32e23fa7230a91117acbe8fd2801(logs in above comment)git apply patch.difflogs
a14n commentedon Jun 22, 2022
I don't face any issue applying the patch with
git apply patch.diff.txtlocally with patch.diff.txt.Alternatively you can simply make those changes manually.
jason-simmons commentedon Jun 22, 2022
Reproduced this and captured a stack trace. It looks like an infinite recursion:
@a-siva
rishuriya commentedon May 13, 2025
hii @maheshj01 this is the problem of recording coverage, some test record and map all file in the project while some test missed it, and next if that missing file test run it cause the problem
a-siva commentedon May 13, 2025
//cc @alexmarkov looks like an issue in the flow graph builder.
alexmarkov commentedon May 13, 2025
Flow graph builder and kernel loader no longer use
Library::LookupReExportandNamespace::Lookup(probably since dart-lang/sdk@8a85dac).Cannot reproduce this issue on the current Flutter.
github-actions commentedon May 27, 2025
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 -vand a minimal reproduction of the issue.