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

Debug mode errors in Firefox in G3. #132439

Closed
polina-c opened this issue Aug 12, 2023 · 10 comments
Closed

Debug mode errors in Firefox in G3. #132439

polina-c opened this issue Aug 12, 2023 · 10 comments
Labels
a: debugging Debugging, breakpoints, expression evaluation a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker browser: firefox only manifests in Firefox c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 3.10 Found to occur in 3.10 found in release: 3.14 Found to occur in 3.14 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-web Web applications specifically team-web Owned by Web platform team

Comments

@polina-c
Copy link
Contributor

polina-c commented Aug 12, 2023

Steps:

  1. Create counter application
  2. Run it in debug mode: flutter run -d chrome
  3. Open the url in Firefox
  4. See error in console

In general counter is working in Firefox in all modes. There is no errors in release mode.

Questions:

  1. Do we have commitment to have errorless debug mode for Firefox?
  2. If yes, we need presubmit testing on bots for this, with multiple supported versions of Firefox, including latest
  3. If no, we should stop testing in debug mode on presubmit in G3, for some selected versions of Firefox

Right now testing in G3 in debug mode fails for some versions of Firefox, and is blocking usage of WeakReference in Flutter Framework: #130842


flutter --version
Flutter 3.14.0-3.0.pre.29 • channel master • [email protected]:flutter/flutter.git
Framework • revision 67ded4b080 (2 days ago) • 2023-08-10 18:51:23 -0400
Engine • revision b019ac62f2
Tools • Dart 3.2.0 (build 3.2.0-58.0.dev) • DevTools 2.26.1

Screenshot 2023-08-12 at 5 49 10 AM
@polina-c
Copy link
Contributor Author

polina-c commented Aug 12, 2023

error details
Installing/Activating first service worker. [flutter.js:171:17](http://localhost:57864/flutter.js)
Activated new service worker. [flutter.js:204:21](http://localhost:57864/flutter.js)
Injecting <script> tag. Using callback. [flutter.js:297:19](http://localhost:57864/flutter.js)
Flutter Web Bootstrap: Programmatic. [dom.dart:184:29](http://localhost:57864/lib/_engine/engine/dom.dart)
Error from backend:

Error: Bad state: Not connected to an application.

Stack Trace:
#0      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:273:13)
#1      _rootRunUnary (dart:async/zone.dart:1407:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#6      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#7      _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
#8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#9      _rootRunUnary (dart:async/zone.dart:1415:13)
#10     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#11     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#13     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#14     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#15     _StreamController._add (dart:async/stream_controller.dart:658:7)
#16     _StreamController.add (dart:async/stream_controller.dart:606:5)
#17     new WebSocketImpl.fromSocket.<anonymous closure> (package:web_socket_channel/src/copy/web_socket_impl.dart:730:21)
#18     _rootRunUnary (dart:async/zone.dart:1407:47)
#19     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#20     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#21     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#22     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#23     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#24     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#25     _WebSocketProtocolTransformer._messageFrameEnd (package:web_socket_channel/src/copy/web_socket_impl.dart:319:23)
#26     _WebSocketProtocolTransformer.add (package:web_socket_channel/src/copy/web_socket_impl.dart:218:46)
#27     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#28     _rootRunUnary (dart:async/zone.dart:1407:47)
#29     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#30     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#31     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#32     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#33     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#34     _StreamController._add (dart:async/stream_controller.dart:658:7)
#35     _StreamController.add (dart:async/stream_controller.dart:606:5)
#36     _Socket._onData (dart:io-patch/socket_patch.dart:2445:41)
#37     _rootRunUnary (dart:async/zone.dart:1415:13)
#38     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#39     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#40     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#41     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#42     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#43     _StreamController._add (dart:async/stream_controller.dart:658:7)
#44     _StreamController.add (dart:async/stream_controller.dart:606:5)
#45     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1934:33)
#46     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1377:14)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#49     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#50     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
10 [client.js:24977:34](http://localhost:57864/dwds/src/injected/client.js)
WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. [canvaskit.js:14:383](http://localhost:57864/canvaskit/canvaskit.js)
Error from backend:

Error: Bad state: Not connected to an application.

Stack Trace:
#0      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:273:13)
#1      _rootRunUnary (dart:async/zone.dart:1407:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#6      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#7      _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
#8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#9      _rootRunUnary (dart:async/zone.dart:1415:13)
#10     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#11     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#13     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#14     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#15     _StreamController._add (dart:async/stream_controller.dart:658:7)
#16     _StreamController.add (dart:async/stream_controller.dart:606:5)
#17     new WebSocketImpl.fromSocket.<anonymous closure> (package:web_socket_channel/src/copy/web_socket_impl.dart:730:21)
#18     _rootRunUnary (dart:async/zone.dart:1407:47)
#19     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#20     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#21     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#22     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#23     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#24     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#25     _WebSocketProtocolTransformer._messageFrameEnd (package:web_socket_channel/src/copy/web_socket_impl.dart:319:23)
#26     _WebSocketProtocolTransformer.add (package:web_socket_channel/src/copy/web_socket_impl.dart:218:46)
#27     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#28     _rootRunUnary (dart:async/zone.dart:1407:47)
#29     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#30     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#31     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#32     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#33     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#34     _StreamController._add (dart:async/stream_controller.dart:658:7)
#35     _StreamController.add (dart:async/stream_controller.dart:606:5)
#36     _Socket._onData (dart:io-patch/socket_patch.dart:2445:41)
#37     _rootRunUnary (dart:async/zone.dart:1415:13)
#38     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#39     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#40     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#41     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#42     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#43     _StreamController._add (dart:async/stream_controller.dart:658:7)
#44     _StreamController.add (dart:async/stream_controller.dart:606:5)
#45     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1934:33)
#46     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1377:14)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#49     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#50     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
51 [client.js:24977:34](http://localhost:57864/dwds/src/injected/client.js)

​```

</details>

@polina-c
Copy link
Contributor Author

polina-c commented Aug 12, 2023

@huycozy
Copy link
Member

huycozy commented Aug 14, 2023

Reproduced this issue on stable channel 3.10.6 as well. My Firefox version is the same.

The issue also occurs with below minimal sample code:

Sample code
import 'package:flutter/material.dart';
void main() {
  runApp(
    const MaterialApp(
      home: Text('hello'),
    ),
  );
}
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 darwin-x64, locale en-VN)
    • Flutter version 3.10.6 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (3 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/huynq/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.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Build 15A5195m
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2022.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.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.5 22G74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 115.0.5790.114

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

• No issues found!
[!] Flutter (Channel master, 3.14.0-3.0.pre.59, on macOS 13.5 22G74 darwin-x64, locale en-VN)
    • Flutter version 3.14.0-3.0.pre.59 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d4c5e90e26 (54 minutes ago), 2023-08-13 23:33:11 -0400
    • Engine revision 7915c049a1
    • Dart version 3.2.0 (build 3.2.0-65.0.dev)
    • DevTools version 2.26.1
    • 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 32.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/huynq/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.6b802.4-9586694)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.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.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 13.5 22G74 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 115.0.5790.170

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

! Doctor found issues in 1 category.

@huycozy huycozy added has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.10 Found to occur in 3.10 found in release: 3.14 Found to occur in 3.14 c: crash Stack traces logged to the console dependency: dart Dart team may need to help us a: debugging Debugging, breakpoints, expression evaluation platform-web Web applications specifically browser: firefox only manifests in Firefox team-web Owned by Web platform team and removed in triage Presently being triaged by the triage team labels Aug 14, 2023
@yjbanov
Copy link
Contributor

yjbanov commented Aug 15, 2023

What does Run it in debug mode mean?

@polina-c
Copy link
Contributor Author

What does Run it in debug mode mean?

It means normal run. Debug mode is default. Or you can pass --debug.

flutter run -d chrome --debug

@yjbanov
Copy link
Contributor

yjbanov commented Aug 15, 2023

Gotcha, thanks for confirming. -d chrome only supports Chrome/Chromium. Firefox is not supported. It should be possible to flutter build web --debug and then use a file server (e.g. python3 -m http.server 8888) to serve the app to any browser. Alternatively, you can use -d web-server.

@polina-c
Copy link
Contributor Author

Yes, flutter run -d web-server --debug did not give me error.

There are still some issues in G3 testing for Firefox. See comments on cl/551925539.

@polina-c
Copy link
Contributor Author

polina-c commented Aug 15, 2023

I am not sure what should happen now with this issue.
Should it be some follow up for cl/551925539?

@yjbanov

@polina-c polina-c changed the title Flutter counter in debug mode errors in Firefox on mac. Debug mode errors in Firefox in G3. Aug 15, 2023
@polina-c
Copy link
Contributor Author

Closed after discussion with team.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2023
@polina-c polina-c added the a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker label Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: debugging Debugging, breakpoints, expression evaluation a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker browser: firefox only manifests in Firefox c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 3.10 Found to occur in 3.10 found in release: 3.14 Found to occur in 3.14 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-web Web applications specifically team-web Owned by Web platform team
Projects
None yet
Development

No branches or pull requests

3 participants