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

Crash when accidentally removed closing `}` #35900

Open
scheglov opened this Issue Feb 10, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@scheglov
Copy link
Contributor

scheglov commented Feb 10, 2019

@danrubel

Analyzer Feedback from IntelliJ

Version information

  • IDEA 191.SNAPSHOT
  • 2.2.0-edge.ac95355fdb6075125b0a1536edf8a7efe7fddeef
  • IC-191.SNAPSHOT, JRE 1.8.0_112-b16x64 Oracle Corporation, OS Mac OS X(x86_64) v10.14.3, screens 1680x1050 Retina

Exception

Dart analysis server, SDK version 2.2.0-edge.ac95355fdb6075125b0a1536edf8a7efe7fddeef, server version 1.23.0, error: Captured exception
RangeError: Value not in range: -1
#0      _StringBase.substring (dart:core/runtime/libstring_patch.dart:387:7)
#1      unescapeLastStringPart (package:front_end/src/fasta/quote.dart:132:24)
#2      AstBuilder.endLiteralString (package:analyzer/src/fasta/ast_builder.dart:257:17)
#3      Parser.parseSingleLiteralString (package:front_end/src/fasta/parser/parser.dart:4797:14)
#4      Parser.parseLiteralString (package:front_end/src/fasta/parser/parser.dart:4722:13)
#5      Parser.parsePrimary (package:front_end/src/fasta/parser/parser.dart:3997:14)
#6      Parser.parseUnaryExpression (package:front_end/src/fasta/parser/parser.dart:3930:12)
#7      Parser.parsePrecedenceExpression (package:front_end/src/fasta/parser/parser.dart:3742:13)
#8      Parser.parseExpression (package:front_end/src/fasta/parser/parser.dart:3714:13)
#9      Parser.parseArgumentsRest (package:front_end/src/fasta/parser/parser.dart:4912:15)
#10     Parser.parseArguments (package:front_end/src/fasta/parser/parser.dart:4884:12)
#11     Parser.parseArgumentsOpt (package:front_end/src/fasta/parser/parser.dart:4865:14)
#12     Parser.parseSend (package:front_end/src/fasta/parser/parser.dart:4844:13)
#13     Parser.parseSendOrFunctionLiteral (package:front_end/src/fasta/parser/parser.dart:4580:12)
#14     Parser.parsePrimary (package:front_end/src/fasta/parser/parser.dart:3991:14)
#15     Parser.parseUnaryExpression (package:front_end/src/fasta/parser/parser.dart:3930:12)
#16     Parser.parsePrecedenceExpression (package:front_end/src/fasta/parser/parser.dart:3742:13)
#17     Parser.parseExpression (package:front_end/src/fasta/parser/parser.dart:3714:13)
#18     Parser.parseExpressionStatement (package:front_end/src/fasta/parser/parser.dart:3679:13)
#19     Parser.parseExpressionStatementOrDeclarationAfterModifiers (package:front_end/src/fasta/parser/parser.dart:5191:16)
#20     Parser.parseStatementX (package:front_end/src/fasta/parser/parser.dart:3513:14)
#21     Parser.parseStatement (package:front_end/src/fasta/parser/parser.dart:3503:20)
#22     Parser.parseBlock (package:front_end/src/fasta/parser/parser.dart:5579:15)
#23     Parser.parseStatementX (package:front_end/src/fasta/parser/parser.dart:3517:14)
#24     Parser.parseStatement (package:front_end/src/fasta/parser/parser.dart:3503:20)
#25     Parser.parseIfStatement (package:front_end/src/fasta/parser/parser.dart:5287:15)
#26     Parser.parseStatementX (package:front_end/src/fasta/parser/parser.dart:3529:14)
#27     Parser.parseStatement (package:front_end/src/fasta/parser/parser.dart:3503:20)
#28     Parser.parseFunctionBody (package:front_end/src/fasta/parser/parser.dart:3408:15)
#29     Parser.parseMethod (package:front_end/src/fasta/parser/parser.dart:3062:15)
#30     Parser.parseClassOrMixinMemberImpl (package:front_end/src/fasta/parser/parser.dart:2932:15)
#31     Parser.parseClassOrMixinBody (package:front_end/src/fasta/parser/parser.dart:2737:15)
#32     Parser.parseClass (package:front_end/src/fasta/parser/parser.dart:1761:13)
#33     Parser.parseClassOrNamedMixinApplication (package:front_end/src/fasta/parser/parser.dart:1721:14)
#34     Parser.parseTopLevelKeywordDeclaration (package:front_end/src/fasta/parser/parser.dart:573:14)
#35     Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:465:14)
#36     Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:348:15)
#37     ParserAdapter.parseCompilationUnit2 (file:///Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer/lib/src/generated/parser_fasta.dart:189:32)
#38     ParserAdapter.parseCompilationUnit (file:///Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer/lib/src/generated/parser_fasta.dart:184:12)
#39     _File._parse (package:analyzer/src/services/available_declarations.dart:1339:23)
#40     _File.refresh (package:analyzer/src/services/available_declarations.dart:966:30)
#41     DeclarationsTracker._performChangeFile (package:analyzer/src/services/available_declarations.dart:600:12)
#42     DeclarationsTracker.doWork (package:analyzer/src/services/available_declarations.dart:466:7)
#43     CompletionLibrariesWorker.performWork (package:analysis_server/src/domains/completion/available_suggestions.dart:163:13)
<asynchronous suspension>
#44     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2125:35)
<asynchronous suspension>
#45     AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2075:5)
#46     new AnalysisServer (package:analysis_server/src/analysis_server.dart:213:29)
#47     SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:86:26)
#48     StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#49     Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:526:21)
#50     _rootRun (dart:async/zone.dart:1124:13)
#51     _CustomZone.run (dart:async/zone.dart:1021:19)
#52     _runZoned (dart:async/zone.dart:1516:10)
#53     runZoned (dart:async/zone.dart:1463:12)
#54     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:605:12)
#55     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:524:7)
#56     Driver.start (package:analysis_server/src/server/driver.dart:427:7)
#57     main (file:///Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analysis_server/bin/server.dart:12:11)
#58     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#59     main (file:///Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analysis_server/bin/server.dart:10:10)
#60     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:298:32)
#61     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
1549835241671 => {"id":"24371","method":"edit.getAssists","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","offs
1549835241672 <= {"id":"24370","result":{}}
1549835241672 <= +++ Analyzing.
1549835241673 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1549835241673 <= 	+++ Verify API signature of /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart.
1549835241677 <= 		+++ Create unlinked for /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart.
1549835241677 <= 		--- Create unlinked for /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart in 0 ms.
1549835241677 <= 		API signatures mismatch found for /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart
1549835241677 <= 	--- Verify API signature of /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart in 3 ms.
1549835241677 <= 	+++ Compute analysis result for /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart.
1549835241677 <= 		+++ Append library files.
1549835241677 <= 		--- Append library files in 0 ms.
1549835241677 <= 		+++ Load linked bundles.
1549835241677 <= 			Loaded 7 linked bundles.
1549835241677 <= 		--- Load linked bundles in 0 ms.
1549835241677 <= 		+++ Link libraries.
1549835241677 <= 			Linked 1 libraries.
1549835241677 <= 		--- Link libraries in 0 ms.
1549835241680 <= 		Computed new analysis result.
1549835241680 <= 	--- Compute analysis result for /Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart in 3 ms.
1549835241680 <= {"event":"analysis.errors","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","errors":[{"severit
1549835241680 <= {"id":"24371","result":{"assists":[]}}
1549835241680 <= {"event":"analysis.highlights","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","regions":[]}}
1549835241680 <= {"event":"analysis.navigation","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","regions":[],"t
1549835241680 <= {"event":"analysis.outline","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","kind":"LIBRARY","
1549835241680 <= {"event":"analysis.overrides","params":{"file":"/Users/scheglov/Source/Dart/sdk.git/sdk/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart","overrides":[]}}
1549835241691 <= {"event":"server.error","params":{"isFatal":false,"message":"Captured exception","stackTrace":"RangeError: Value not in range: -1\n#0      _StringBase.substring (dart:core/runtime/lib
1549835241692 <= {"event":"server.error","params":{"isFatal":false,"message":"Captured exception","stackTrace":"RangeError: Value not in range: -1\n#0      _StringBase.substring (dart:core/runtime/lib
1549835241692 <= {"event":"server.error","params":{"isFatal":false,"message":"Captured exception","stackTrace":"RangeError: Value not in range: -1\n#0      Driver._captureExceptions.errorFunction (pac
1549835241692 <= {"event":"server.error","params":{"isFatal":false,"message":"Captured exception","stackTrace":"RangeError: Value not in range: -1\n#0      Driver._captureExceptions.errorFunction (pac
@bwilkerson

This comment has been minimized.

Copy link
Member

bwilkerson commented Feb 10, 2019

Do you have a test case to reproduce the behavior? Was the curly brace part of a string interpolation, map literal or block?

@scheglov

This comment has been minimized.

Copy link
Contributor Author

scheglov commented Feb 10, 2019

It was in a string interpolation in print, something like this.
print('${actualParameter.name}: ${actualParameter.type}');

I cannot reproduce it reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment