Issue 23573 in dart: Crash in indexer when adding "this." to a constructor parameter and the corresponding field does not exist.

1 view
Skip to first unread message

da...@googlecode.com

unread,
Jun 2, 2015, 9:56:16 AM6/2/15
to bu...@dartlang.org
Status: Triaged
Owner: sche...@google.com
Labels: Type-Defect Priority-High Area-Analyzer

New issue 23573 by paul...@google.com: Crash in indexer when
adding "this." to a constructor parameter and the corresponding field does
not exist.
https://code.google.com/p/dart/issues/detail?id=23573

Just got this analysis server crash. I was running an instrumented build
and I have the log file available if needed (it's 1.8GB). However, after
digging through the log file and the stack trace, I was able to reconstruct
a short repro.

Create a file with the following contents:

class C {
C(foo);
}

Wait for analysis to finish. Then place the cursor just before the
identifier "foo" and paste in the text "this."

In addition to fixing indexer so that it doesn't throw an exception, we
should also consider adding some high-level exception handling so that
exceptions that occur during indexing are not fatal.

Stack trace:

!ENTRY com.google.dart.tools.core 4 0 2015-06-02 06:32:52.045
!MESSAGE ServerError: Fatal=true
The null object does not have a getter 'displayName'.

NoSuchMethodError: method not found: 'displayName'
Receiver: null
Arguments: []
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 IndexableElement.name
(package:analysis_server/src/services/index/indexable_element.dart:38)
#3 ElementCodec.encodeHash
(package:analysis_server/src/services/index/store/codec.dart:136)
#4 SplitIndexStore._recordNodeNameForElement
(package:analysis_server/src/services/index/store/split_store.dart:946)
#5 SplitIndexStore.recordRelationship
(package:analysis_server/src/services/index/store/split_store.dart:830)
#6 _IndexContributor.visitSimpleIdentifier
(package:analysis_server/src/services/index/index_contributor.dart:484)
#7 SimpleIdentifier.accept
(package:analyzer/src/generated/ast.dart:16210)
#8 AstNode._safelyVisitChild
(package:analyzer/src/generated/ast.dart:2939)
#9 FieldFormalParameter.visitChildren
(package:analyzer/src/generated/ast.dart:7289)
#10 GeneralizingAstVisitor.visitNode
(package:analyzer/src/generated/ast.dart:8719)
#11 GeneralizingAstVisitor.visitFormalParameter
(package:analyzer/src/generated/ast.dart:8605)
#12 _IndexContributor.visitFormalParameter
(package:analysis_server/src/services/index/index_contributor.dart:322)
#13 GeneralizingAstVisitor.visitNormalFormalParameter
(package:analyzer/src/generated/ast.dart:8724)
#14 GeneralizingAstVisitor.visitFieldFormalParameter
(package:analyzer/src/generated/ast.dart:8600)
#15 FieldFormalParameter.accept
(package:analyzer/src/generated/ast.dart:7283)
#16 NodeList.accept (package:analyzer/src/generated/ast.dart:12232)
#17 FormalParameterList.visitChildren
(package:analyzer/src/generated/ast.dart:7644)
#18 GeneralizingAstVisitor.visitNode
(package:analyzer/src/generated/ast.dart:8719)
#19 GeneralizingAstVisitor.visitFormalParameterList
(package:analyzer/src/generated/ast.dart:8608)
#20 FormalParameterList.accept
(package:analyzer/src/generated/ast.dart:7640)
#21 AstNode._safelyVisitChild
(package:analyzer/src/generated/ast.dart:2939)
#22 ConstructorDeclaration.visitChildren
(package:analyzer/src/generated/ast.dart:5512)
#23 GeneralizingAstVisitor.visitNode
(package:analyzer/src/generated/ast.dart:8719)
#24 GeneralizingAstVisitor.visitAnnotatedNode
(package:analyzer/src/generated/ast.dart:8464)
#25 GeneralizingAstVisitor.visitDeclaration
(package:analyzer/src/generated/ast.dart:8549)
#26 GeneralizingAstVisitor.visitClassMember
(package:analyzer/src/generated/ast.dart:8510)
#27 GeneralizingAstVisitor.visitConstructorDeclaration
(package:analyzer/src/generated/ast.dart:8535)
#28 _IndexContributor.visitConstructorDeclaration
(package:analysis_server/src/services/index/index_contributor.dart:238)
#29 ConstructorDeclaration.accept
(package:analyzer/src/generated/ast.dart:5505)
#30 NodeList.accept (package:analyzer/src/generated/ast.dart:12232)
#31 ClassDeclaration.visitChildren
(package:analyzer/src/generated/ast.dart:4250)
#32 GeneralizingAstVisitor.visitNode
(package:analyzer/src/generated/ast.dart:8719)
#33 GeneralizingAstVisitor.visitAnnotatedNode
(package:analyzer/src/generated/ast.dart:8464)
#34 GeneralizingAstVisitor.visitDeclaration
(package:analyzer/src/generated/ast.dart:8549)
#35 GeneralizingAstVisitor.visitCompilationUnitMember
(package:analyzer/src/generated/ast.dart:8527)
#36 GeneralizingAstVisitor.visitNamedCompilationUnitMember
(package:analyzer/src/generated/ast.dart:8704)
#37 GeneralizingAstVisitor.visitClassDeclaration
(package:analyzer/src/generated/ast.dart:8508)
#38 _IndexContributor.visitClassDeclaration
(package:analysis_server/src/services/index/index_contributor.dart:181)
#39 ClassDeclaration.accept
(package:analyzer/src/generated/ast.dart:4180)
#40 NodeList.accept (package:analyzer/src/generated/ast.dart:12232)
#41 CompilationUnit.visitChildren
(package:analyzer/src/generated/ast.dart:4798)
#42 GeneralizingAstVisitor.visitNode
(package:analyzer/src/generated/ast.dart:8719)
#43 GeneralizingAstVisitor.visitCompilationUnit
(package:analyzer/src/generated/ast.dart:8524)
#44 _IndexContributor.visitCompilationUnit
(package:analysis_server/src/services/index/index_contributor.dart:228)
#45 CompilationUnit.accept
(package:analyzer/src/generated/ast.dart:4791)
#46 indexDartUnit
(package:analysis_server/src/services/index/index_contributor.dart:43)
#47 LocalIndex.indexUnit
(package:analysis_server/src/services/index/local_index.dart:77)
#48 _DartIndexOperation.perform.<anonymous closure>
(package:analysis_server/src/operation/operation_analysis.dart:330)
#49 _PerformanceTagImpl.makeCurrentWhile
(package:analyzer/src/generated/utilities_general.dart:152)
#50 _DartIndexOperation.perform
(package:analysis_server/src/operation/operation_analysis.dart:328)
#51 AnalysisServer.performOperation
(package:analysis_server/src/analysis_server.dart:727)
#52 Future.Future.<anonymous closure> (dart:async/future.dart:118)
#53 _rootRun (dart:async/zone.dart:900)
#54 _CustomZone.run (dart:async/zone.dart:803)
#55 _CustomZone.runGuarded (dart:async/zone.dart:709)
#56 _CustomZone.bindCallback.<anonymous closure>
(dart:async/zone.dart:734)
#57 _rootRun (dart:async/zone.dart:904)
#58 _CustomZone.run (dart:async/zone.dart:803)
#59 _CustomZone.runGuarded (dart:async/zone.dart:709)
#60 _CustomZone.bindCallback.<anonymous closure>
(dart:async/zone.dart:734)
#61 Timer._createTimer.<anonymous closure>
(dart:async-patch/timer_patch.dart:16)
#62 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:385)
#63 _RawReceivePortImpl._handleMessage
(dart:isolate-patch/isolate_patch.dart:148)




--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Jun 2, 2015, 11:01:11 AM6/2/15
to bu...@dartlang.org
Updates:
Status: Started

Comment #1 on issue 23573 by sche...@google.com: Crash in indexer when
adding "this." to a constructor parameter and the corresponding field does
not exist.
https://code.google.com/p/dart/issues/detail?id=23573

Mostly duplicate.
https://code.google.com/p/dart/issues/detail?id=23568

Catching exceptions:
https://codereview.chromium.org/1168473003

da...@googlecode.com

unread,
Jun 2, 2015, 3:44:30 PM6/2/15
to bu...@dartlang.org
Updates:
Status: Fixed

Comment #2 on issue 23573 by sche...@google.com: Crash in indexer when
adding "this." to a constructor parameter and the corresponding field does
not exist.
https://code.google.com/p/dart/issues/detail?id=23573

https://github.com/dart-lang/sdk/commit/8e439849b3d6f348eda7bf98b65303a5c41bb061
Reply all
Reply to author
Forward
0 new messages