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

Leak tracker crashes app #84

Closed
domesticmouse opened this issue Jun 12, 2023 · 4 comments
Closed

Leak tracker crashes app #84

domesticmouse opened this issue Jun 12, 2023 · 4 comments
Labels
subtask The issue is subtask of another bigger issue.

Comments

@domesticmouse
Copy link
Member

Adding leak_tracker to https://github.com/flutter/samples/tree/main/next_gen_ui_demo crashes the app on macOS after a couple of page transitions. See flutter/samples#1890 for the corresponding code for this issue.

flutter run -d macos        
Launching lib/main.dart on macOS in debug mode...
2023-06-12 13:40:05.119 xcodebuild[65354:5074280] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-001250C00C38801E }
{ platform:macOS, arch:x86_64, id:00006000-001250C00C38801E }
Building macOS application...                                           
Syncing files to device macOS...                                    45ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on macOS is available at: http://127.0.0.1:59934/J8LWgSdSUS4=/
The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:59934/J8LWgSdSUS4=/
flutter: leak_tracker: 0 memory leak(s): not disposed: 0, not GCed: 0, GCed late: 0
flutter: Step 2 of 15
flutter: leak_tracker: 17 memory leak(s): not disposed: 0, not GCed: 17, GCed late: 0
flutter: Step 3 of 15
flutter: Step 4 of 15
flutter: Step 5 of 15
flutter: Step 6 of 15
flutter: Step 7 of 15
flutter: leak_tracker: 20 memory leak(s): not disposed: 3, not GCed: 17, GCed late: 0
flutter: Step 8 of 15
flutter: leak_tracker: 24 memory leak(s): not disposed: 7, not GCed: 17, GCed late: 0
flutter: Step 9 of 15
flutter: leak_tracker: 28 memory leak(s): not disposed: 11, not GCed: 17, GCed late: 0
flutter: Step 10 of 15
../../third_party/dart/runtime/vm/object_service.cc: 2087: error: unreachable code
version=3.0.3 (stable) (Wed May 31 15:35:05 2023 +0000) on "macos_arm64"
pid=65543, thread=33539, isolate_group=main(0x12c829c00), isolate=main(0x12c838800)
os=macos, arch=arm64, comp=no, sim=no
isolate_instructions=105b9ec60, vm_instructions=105b9ec60
fp=16db02d20, sp=16db02ce0, pc=105d09cc4
  pc 0x0000000105d09cc4 fp 0x000000016db02d20 dart::Profiler::DumpStackTrace(void*)+0x90
  pc 0x0000000105b9eebc fp 0x000000016db02d40 dart::Assert::Fail(char const*, ...) const+0x38
  pc 0x0000000105d020b8 fp 0x000000016db02d70 dart::FinalizerEntry::PrintImplementationFieldsImpl(dart::JSONArray const&) const+0x0
  pc 0x0000000105c00de0 fp 0x000000016db02e10 dart::ActivationFrame::PrintToJSONObjectRegular(dart::JSONObject*)+0x2c0
  pc 0x0000000105d6f6b8 fp 0x000000016db02e60 dart::ServiceEvent::PrintJSON(dart::JSONStream*) const+0x3a4
  pc 0x0000000105c226e8 fp 0x000000016db02fe0 dart::Isolate::PrintJSON(dart::JSONStream*, bool)+0x56c
  pc 0x0000000105d5a778 fp 0x000000016db03600 dart::Service::InvokeMethod(dart::Isolate*, dart::Array const&, bool)+0x2c4
  pc 0x0000000105d5ad14 fp 0x000000016db03630 dart::Service::HandleIsolateMessage(dart::Isolate*, dart::Array const&)+0x2c
  pc 0x0000000105c1dfdc fp 0x000000016db03be0 dart::IsolateMessageHandler::HandleMessage(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::Message, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::Message>>)+0x1dc
  pc 0x0000000105c482a8 fp 0x000000016db03c70 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x148
  pc 0x0000000105c486b0 fp 0x000000016db03cb0 dart::MessageHandler::HandleOOBMessages()+0x60
  pc 0x0000000105d832ac fp 0x000000016db03d00 dart::Thread::HandleInterrupts()+0x134
  pc 0x0000000105d5158c fp 0x000000016db04380 dart::DRT_InterruptOrStackOverflow(dart::NativeArguments)+0x60c
  pc 0x0000000119b82f2c fp 0x000000016db043c8 Unknown symbol
  pc 0x00000001696bbc98 fp 0x000000016db043f0 Unknown symbol
  pc 0x00000001703c21cc fp 0x000000016db04450 Unknown symbol
  pc 0x0000000170489c9c fp 0x000000016db044a0 Unknown symbol
  pc 0x0000000147182a24 fp 0x000000016db044d0 Unknown symbol
  pc 0x0000000119b834b8 fp 0x000000016db045a0 Unknown symbol
  pc 0x0000000105bf9200 fp 0x000000016db04650 dart::DartEntry::InvokeCode(dart::Code const&, unsigned long, dart::Array const&, dart::Array const&, dart::Thread*)+0x144
  pc 0x0000000105bf904c fp 0x000000016db046c0 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)+0x108
  pc 0x0000000105bfb558 fp 0x000000016db04710 dart::DartLibraryCalls::HandleFinalizerMessage(dart::FinalizerBase const&)+0x13c
  pc 0x0000000105c1dff4 fp 0x000000016db04cc0 dart::IsolateMessageHandler::HandleMessage(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::Message, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::Message>>)+0x1f4
  pc 0x0000000105c482a8 fp 0x000000016db04d50 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x148
  pc 0x0000000105c4842c fp 0x000000016db04d90 dart::MessageHandler::HandleNextMessage()+0x58
  pc 0x0000000106000878 fp 0x000000016db04e30 Dart_HandleMessage+0xf8
  pc 0x0000000105907280 fp 0x000000016db04e80 tonic::DartMessageHandler::OnHandleMessage(tonic::DartState*)+0xbc
  pc 0x00000001059077d4 fp 0x000000016db04eb0 std::_LIBCPP_ABI_NAMESPACE::__function::__func<tonic::DartMessageHandler::OnMessage(tonic::DartState*)::$_0, std::_LIBCPP_ABI_NAMESPACE::allocator<tonic::DartMessageHandler::OnMessage(tonic::DartState*)::$_0>, void ()>::operator()()+0x48
  pc 0x0000000105b6596c fp 0x000000016db04ee0 std::_LIBCPP_ABI_NAMESPACE::__function::__func<flutter::DartIsolate::SetMessageHandlingTaskRunner(fml::RefPtr<fml::TaskRunner> const&)::$_0::operator()(std::_LIBCPP_ABI_NAMESPACE::function<void ()>) const::'lambda'(), std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::DartIsolate::SetMessageHandlingTaskRunner(fml::RefPtr<fml::TaskRunner> const&)::$_0::operator()(std::_LIBCPP_ABI_NAMESPACE::function<void ()>) const::'lambda'()>, void ()>::operator()()+0x4c
  pc 0x0000000105351694 fp 0x000000016db04f80 fml::MessageLoopImpl::FlushTasks(fml::FlushType)+0xfc
  pc 0x000000010535a220 fp 0x000000016db04fb0 fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*)+0x34
  pc 0x00000001a1e083c8 fp 0x000000016db04fc0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__+0x20
  pc 0x24390001a1e08070 fp 0x000000016db06090 __CFRunLoopDoTimer+0x24390000000003ac
  pc 0x262e0001a1e07bc8 fp 0x000000016db060f0 __CFRunLoopDoTimers+0x262e000000000164
  pc 0x976d0001a1ded348 fp 0x000000016db06e50 __CFRunLoopRun+0x976d00000000073c
  pc 0x41670001a1dec4b8 fp 0x000000016db06f00 CFRunLoopRunSpecific+0x4167000000000264
  pc 0x250300010535a4b8 fp 0x000000016db06f50 fml::MessageLoopDarwin::Run()+0x25030000000000b8
  pc 0x000000010535148c fp 0x000000016db06f80 fml::MessageLoopImpl::DoRun()+0x3c
  pc 0x0000000105358580 fp 0x000000016db06fc0 void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<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>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*)+0xe4
  pc 0x00000001a1d0ffa8 fp 0x000000016db06fe0 _pthread_start+0x94
-- End of DumpStackTrace
  pc 0x0000000000000000 fp 0x000000016db043c8 sp 0x0000000000000000 [Stub] CallToRuntime
  pc 0x00000001696bbc98 fp 0x000000016db043f0 sp 0x000000016db043d8 [Optimized] Object.get:hashCode
  pc 0x00000001703c21cc fp 0x000000016db04450 sp 0x000000016db04400 [Optimized] __Set&_HashVMBase&SetMixin&_HashBase&_OperatorEqualsAndHashCode&[email protected]
  pc 0x0000000170489c9c fp 0x000000016db044a0 sp 0x000000016db04460 [Optimized] _FinalizerImpl@0150898._runFinalizers@0150898
  pc 0x0000000147182a24 fp 0x000000016db044d0 sp 0x000000016db044b0 [Unoptimized] _FinalizerImpl@0150898._handleFinalizerMessage@0150898
  pc 0x0000000119b834b8 fp 0x000000016db045a0 sp 0x000000016db044e0 [Stub] InvokeDartCode
Lost connection to device.

Obligatory flutter doctor output:

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.10.4, on macOS 13.4 22F66 darwin-arm64, locale en)
    • Flutter version 3.10.4 on channel stable at /Users/brettmorgan/flutter
    • Upstream repository https://github.com/flutter/flutter
    • Framework revision 682aa387cf (6 days ago), 2023-06-05 18:04:56 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/brettmorgan/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.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 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2022.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 70.0.5
    • Dart plugin version 222.4167.21

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.106

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

• No issues found!
@domesticmouse
Copy link
Member Author

Hey @polina-c and @devoncarew,

Is there anyone in particular I should bug about this issue?

brett

@polina-c
Copy link
Contributor

Yes, I am right person. Sorry for delay and thank you for reporting!
leak_tracker is work in progress. Right now we focus on usage of leak_tracker in regression testing.

You can track progress in the tracking issue: flutter/devtools#3951
I added this issue to the list of subtasks to make sure to address it.

@polina-c
Copy link
Contributor

Subtask of flutter/devtools#3951

@polina-c polina-c added the subtask The issue is subtask of another bigger issue. label Aug 14, 2023
@polina-c
Copy link
Contributor

polina-c commented Nov 2, 2023

Closing as duplicate of #172

@polina-c polina-c closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtask The issue is subtask of another bigger issue.
Projects
None yet
Development

No branches or pull requests

2 participants