Dart Analysis Server server crashed

I’m working on a wide project that structure around a core class:

sealed class Operation<T, C, R>

Everything is working well but I’ve found a solution to simplify to <T, R>

The moment I start the refactor I get this log and the whole source is no more traversable.
Restarting the server crash it after 5 tentatives.

[19:45:28] [Analyzer] [Error] [Bad state: Empty path: []
#0      InterfaceLeastUpperBoundHelper._computeTypeAtMaxUniqueDepth (package:analyzer/src/dart/element/least_upper_bound.dart:314:5)
#1      InterfaceLeastUpperBoundHelper._computeLeastUpperBound (package:analyzer/src/dart/element/least_upper_bound.dart:176:12)
#2      InterfaceLeastUpperBoundHelper.compute (package:analyzer/src/dart/element/least_upper_bound.dart:103:18)
#3      LeastUpperBoundHelper.getLeastUpperBound (package:analyzer/src/dart/element/least_upper_bo…

I’ve tried to start with leaf classes or top, both put the analyzer in an way
it can reconciliate the classes structure thus voiding the refactor (way too large sources).

Any advice on a methodology to debug what’s is crashing the server?

2 Likes

I don’t know if this is helpful, but I saw folks on the Dart team discuss this issue yesterday: Analyzer crash · Issue #57045 · dart-lang/sdk · GitHub

1 Like

Thanks Eric,

I went to the correction using grep and many retries to complete the process.
Glad that the team was aware of this very special case.

Does telemetry help the flutter team to discover such cases?

Note that the issue linked by @ericwindmill is a completely different exception. I doubt it is related.

I suggest filing a bug @BlueAquilae - a person familiar with the code might be able to figure out what the problem is just from the exception, but if not - there might be a way to debug this (e.g. you can start language server with vm-service enabled and attach debugger to it to catch the exception and inspect that state around it).

2 Likes