Open sidlatau opened 13 hours ago
Summary: The Dart Debug Adapter (DAP) fails to pause threads when starting a Flutter app in the new 3.24 version. The DAP sometimes stops at random locations in the framework code or shows an error indicating that Thread 1 is not paused.
//cc @DanTup
With new 3.24 flutter version DAP shows error when starting an app. No breakpoints are set manually, but it tries to stop. Sometimes it stops at some random spot in framework code, sometimes it shows error "Thread 1 is not paused".
There is related issue registered in https://github.com/nvim-flutter/flutter-tools.nvim/issues/402 which may provide additional details.
Client: neovim
Code to reproduce: for me the problem occurs in every repository, I tested with this one: https://github.com/sidlatau/flutter_email_sender/tree/master/example
Flutter doctor output
``` [✓] Flutter (Channel stable, 3.24.4, on macOS 14.6.1 23G93 darwin-arm64, locale en-LT) • Flutter version 3.24.4 on channel stable at /Users/ts/fvm/versions/3.24.4 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 603104015d (7 days ago), 2024-10-24 08:01:25 -0700 • Engine revision db49896cf2 • Dart version 3.5.4 • DevTools version 2.37.3 [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/ts/Library/Android/sdk • Platform android-34, build-tools 32.1.0-rc1 • 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.6b829.9-10027231) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.16.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.3) • 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.6b829.9-10027231) [✓] IntelliJ IDEA Community Edition (version 2022.2.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • 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 [✓] VS Code (version 1.80.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.68.0 [✓] Connected device (4 available) • iPhone 14 (mobile) • B6F362F3-5630-4010-B0B7-F57858E33F9B • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator) • 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 130.0.6723.70 [✓] Network resources • All expected network resources are available. • No issues found! ```DAP log
``` [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1434 ] "Spawning debug adapter" { args = { "debug-adapter" }, command = "/Users/ts/fvm/versions/3.24.4/bin/flutter", type = "executable" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { arguments = { adapterID = "nvim-dap", clientID = "neovim", clientName = "neovim", columnsStartAt1 = true, linesStartAt1 = true, locale = "en_US.UTF-8", pathFormat = "path", supportsProgressReporting = true, supportsRunInTerminalRequest = true, supportsStartDebuggingRequest = true, supportsVariableType = true }, command = "initialize", seq = 1, type = "request" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { exceptionBreakpointFilters = { { default = false, filter = "All", label = "All Exceptions" }, { default = true, filter = "Unhandled", label = "Uncaught Exceptions" } }, supportsClipboardContext = true, supportsConditionalBreakpoints = true, supportsConfigurationDoneRequest = true, supportsDelayedStackTraceLoading = true, supportsEvaluateForHovers = true, supportsLogPoints = true, supportsRestartFrame = true, supportsRestartRequest = false, supportsTerminateRequest = true, supportsValueFormattingOptions = true }, command = "initialize", request_seq = 1, seq = 1, success = true, type = "response" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { arguments = { args = {}, cwd = "/Users/ts/Documents/github/personal/flutter_email_sender/example", dartSdkPath = "/Users/ts/fvm/versions/3.24.4/bin/cache/dart-sdk", evaluateToStringInDebugViews = true, flutterSdkPath = "/Users/ts/fvm/versions/3.24.4", name = "Launch flutter", program = "lib/main.dart", request = "launch", type = "dart" }, command = "launch", seq = 2, type = "request" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = vim.empty_dict(), event = "initialized", seq = 2, type = "event" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { arguments = { filters = {} }, command = "setExceptionBreakpoints", seq = 3, type = "request" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = vim.empty_dict(), command = "setExceptionBreakpoints", request_seq = 3, seq = 3, success = true, type = "response" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { command = "configurationDone", seq = 4, type = "request" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { command = "configurationDone", request_seq = 4, seq = 4, success = true, type = "response" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { message = "Launching…", progressId = "launch_1", title = "Flutter" }, event = "progressStart", seq = 5, type = "event" } [ DEBUG ] 2024-10-31T21:59:08Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { command = "launch", request_seq = 2, seq = 6, success = true, type = "response" } [ DEBUG ] 2024-10-31T21:59:17Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { capabilities = { supportsRestartRequest = true } }, event = "capabilities", seq = 7, type = "event" } [ DEBUG ] 2024-10-31T21:59:17Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { appId = "d72c7bdc-d85e-4585-b637-f66bc4251455", deviceId = "B6F362F3-5630-4010-B0B7-F57858E33F9B", directory = "/Users/ts/Documents/github/personal/flutter_email_sender/example", launchMode = "run", mode = "debug", supportsRestart = true }, event = "flutter.appStart", seq = 8, type = "event" } [ WARN ] 2024-10-31T21:59:17Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { appId = "d72c7bdc-d85e-4585-b637-f66bc4251455", deviceId = "B6F362F3-5630-4010-B0B7-F57858E33F9B", directory = "/Users/ts/Documents/github/personal/flutter_email_sender/example", launchMode = "run", mode = "debug", supportsRestart = true }, event = "flutter.appStart", seq = 8, type = "event" } [ DEBUG ] 2024-10-31T21:59:17Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { category = "console", output = "Launching lib/main.dart on iPhone 14 in debug mode...\n" }, event = "output", seq = 9, type = "event" } [ DEBUG ] 2024-10-31T21:59:33Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { message = "Running Xcode build...", progressId = "launch_1" }, event = "progressUpdate", seq = 10, type = "event" } [ DEBUG ] 2024-10-31T21:59:40Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { category = "console", output = "Xcode build done. 6.6s\n" }, event = "output", seq = 11, type = "event" } [ DEBUG ] 2024-10-31T21:59:45Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { message = "Syncing files to device iPhone 14...", progressId = "launch_1" }, event = "progressUpdate", seq = 12, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { progressId = "launch_1" }, event = "progressEnd", seq = 13, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { output = "Connecting to VM Service at ws://127.0.0.1:60535/MUnQ00TZ0Fw=/ws\n" }, event = "output", seq = 14, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { output = "Connected to the VM Service.\n" }, event = "output", seq = 15, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { vmServiceUri = "ws://127.0.0.1:60535/MUnQ00TZ0Fw=/ws" }, event = "dart.debuggerUris", seq = 16, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { reason = "started", threadId = 1 }, event = "thread", seq = 17, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { reason = "entry", threadId = 1 }, event = "stopped", seq = 18, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { command = "threads", seq = 5, type = "request" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = vim.empty_dict(), event = "flutter.appStarted", seq = 19, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = vim.empty_dict(), event = "flutter.appStarted", seq = 19, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.reloadSources", service = "reloadSources" }, event = "dart.serviceRegistered", seq = 20, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.reloadSources", service = "reloadSources" }, event = "dart.serviceRegistered", seq = 20, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.hotRestart", service = "hotRestart" }, event = "dart.serviceRegistered", seq = 21, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.flutterVersion", service = "flutterVersion" }, event = "dart.serviceRegistered", seq = 22, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.hotRestart", service = "hotRestart" }, event = "dart.serviceRegistered", seq = 21, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.compileExpression", service = "compileExpression" }, event = "dart.serviceRegistered", seq = 23, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.flutterMemoryInfo", service = "flutterMemoryInfo" }, event = "dart.serviceRegistered", seq = 24, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.flutterVersion", service = "flutterVersion" }, event = "dart.serviceRegistered", seq = 22, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { method = "s0.flutterGetSkSL", service = "flutterGetSkSL" }, event = "dart.serviceRegistered", seq = 25, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { threadId = 1 }, event = "continued", seq = 26, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.compileExpression", service = "compileExpression" }, event = "dart.serviceRegistered", seq = 23, type = "event" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.flutterMemoryInfo", service = "flutterMemoryInfo" }, event = "dart.serviceRegistered", seq = 24, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { threads = { { id = 1, name = "main" } } }, command = "threads", request_seq = 5, seq = 27, success = true, type = "response" } [ WARN ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1063 ] "No event handler for " { body = { method = "s0.flutterGetSkSL", service = "flutterGetSkSL" }, event = "dart.serviceRegistered", seq = 25, type = "event" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1746 ] "request" { arguments = { startFrame = 0, threadId = 1 }, command = "stackTrace", seq = 6, type = "request" } [ DEBUG ] 2024-10-31T21:59:46Z+0100 ] ...s/ts/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1013 ] 1 { body = { error = { format = "{message}", id = 1, showUser = true, variables = { message = "Thread 1 is not paused", stack = "#0 DartDebugAdapter.stackTraceRequest (package:dds/src/dap/adapters/dart.dart:1847:7)\n#1 BaseDebugAdapter.handle (package:dds/src/dap/base_debug_adapter.dart:141:20)\n#2 BaseDebugAdapter.handleIncomingRequest (package:dds/src/dap/base_debug_adapter.dart:440:7)\n#3 BaseDebugAdapter._handleIncomingMessage (package:dds/src/dap/base_debug_adapter.dart:309:7)\n#4 ByteStreamServerChannel._readMessage (package:dds/src/dap/protocol_stream.dart:82:18)\n#5 ByteStreamServerChannel.listen.