dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.29k stars 1.59k forks source link

Running analyzer benchmark always crashes with a SocketException #56258

Open srawlins opened 4 months ago

srawlins commented 4 months ago

I'm sure I'm holding it wrong, but if I run:

$ xcodebuild/ReleaseX64/dart-sdk/bin/dart \
    pkg/analysis_server/benchmark/benchmarks.dart \
    run lsp-flutter \
    --flutter-repository $HOME/code/flutter

(I've run flutter upgrade-packages in the flutter repo)

then I always get results, then a crash:

Running lsp-flutter 1 times...
  {lsp-flutter-start: {micros: 466510}, lsp-flutter-completion-1: {micros: 122728}, lsp-flutter-completion-2: {micros: 300725}, lsp-flutter-completion-3: {micros: 1144170}, lsp-flutter-completion-4: {micros: 242766}, lsp-flutter-completion-5: {micros: 650328}}
Finished in 41 seconds.

{"benchmark":"lsp-flutter","result":{"lsp-flutter-start":{"micros":466510},"lsp-flutter-completion-1":{"micros":122728},"lsp-flutter-completion-2":{"micros":300725},"lsp-flutter-completion-3":{"micros":1144170},"lsp-flutter-completion-4":{"micros":242766},"lsp-flutter-completion-5":{"micros":650328}}}
Unhandled exception:
SocketException: Write failed (OS Error: Broken pipe, errno = 32), port = 0
#0      _NativeSocket.write (dart:io-patch/socket_patch.dart:1252:34)
#1      _RawSocket.write (dart:io-patch/socket_patch.dart:2010:15)
#2      _Socket._write (dart:io-patch/socket_patch.dart:2487:18)
#3      _SocketStreamConsumer.write (dart:io-patch/socket_patch.dart:2222:28)
#4      _Socket._onData (dart:io-patch/socket_patch.dart:2458:19)
#5      _rootRunUnary (dart:async/zone.dart:1415:13)
#6      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:365:11)
#9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:297:7)
#10     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#11     _StreamController._add (dart:async/stream_controller.dart:658:7)
#12     _StreamController.add (dart:async/stream_controller.dart:606:5)
#13     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1947:23)
#14     _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1411:14)
#15     _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1418:7)
#16     _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1461:13)
#17     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Not sure what to do with that stack trace...

srawlins commented 4 months ago

Ah, it seems to not crash if I run das-flutter instead of lsp-flutter.