devtools icon indicating copy to clipboard operation
devtools copied to clipboard

When running a Flutter iOS app in debug mode the app crashes with error

Open ivictoruan opened this issue 4 months ago • 2 comments

It seems to happen when closing a RawSecureSocket.

Steps to Reproduce

  1. Run a Flutter app on iOS (debug build) and open network in Flutter DevTools.
  2. Perform network requests (HTTPS).
  3. After some socket closures, the app throws the above exception.

Expected behavior

Sockets should close normally without any errors being printed in the debug console or terminal.

Actual behavior

When closing sockets, the app prints the _idToSocketStatistic assertion error in the terminal/debug console and may crash in debug mode.

Additional context

  • Happens only in debug mode (profiling enabled).
  • Likely related to socket profiling cleanup logic in dart:io/network_profiling.dart.

Environment

  • DevTools version: 2.48.0
  • IDE: VSCode
  • Connected Device: iOS (arm64, 64-bit)
  • Connected app type: Flutter native (debug build)
  • Dart version: 3.9.0
  • Flutter version: 3.35.1 (stable)
  • Framework / Engine: 20f8274939 / 1e9a811bf8

ivictoruan avatar Aug 29 '25 20:08 ivictoruan

FYI @brianquinlan @srawlins it sounds like this is a dart:io issue and not a DevTools Network Panel issue, should I file an issue in the SDK?

elliette avatar Oct 07 '25 23:10 elliette

When I (thought I) fixed this last time, it was a problem in dart:io that was only triggered by DevTools. (Also it was my code that was triggering the exception.) So I think we could track this here.

srawlins avatar Oct 29 '25 23:10 srawlins