-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
front-end-kernellegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Description
Given helloworld.dart:
main() {
print("Hello, World!");
}running with
out/ReleaseX64/dart --no-prune-dead-locals --no-background-compilation --optimization-counter-threshold=10 --dfe=out/ReleaseX64/gen/kernel-service.dart.snapshot --packages=.packages helloworld.dart
gives me
Dumping native stack trace for thread 579b
[0x000000000074b3a0] dart::CompileType::Union(dart::CompileType*)
[0x000000000074b3a0] dart::CompileType::Union(dart::CompileType*)
[0x000000000074c062] dart::PhiInstr::RecomputeType()
[0x00000000007491f1] dart::FlowGraphTypePropagator::Propagate()
[0x0000000000748f66] dart::FlowGraphTypePropagator::Propagate(dart::FlowGraph*)
[0x00000000006b4a74] dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
[0x00000000006b5de2] Unknown symbol
[0x00000000006b6c56] dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
[0x00000000009af909] dart::DRT_OptimizeInvokedFunction(dart::NativeArguments)
[0x00007fbfc24b261b] Unknown symbol
[0x00007fbfc24b2911] Unknown symbol
[0x00007fbfb7a444de] Unknown symbol
[0x00007fbfc24b29d9] Unknown symbol
-- End of DumpStackTrace
Aborted (core dumped)
and running with
out/DebugX64/dart --no-prune-dead-locals --no-background-compilation --optimization-counter-threshold=10 --dfe=out/DebugX64/gen/kernel-service.dart.snapshot --packages=.packages helloworld.dart
gives me
../../runtime/vm/flow_graph.cc: 345: error: expected: (defn->input_use_list() == NULL) || defn->HasSSATemp()
Dumping native stack trace for thread 5897
[0x00000000009b6e03] dart::Profiler::DumpStackTrace()
[0x00000000009b6e03] dart::Profiler::DumpStackTrace()
[0x0000000000692ba1] dart::DynamicAssertionHelper::Fail(char const*, ...)
[0x000000000073d7b7] Unknown symbol
[0x000000000073d308] dart::FlowGraph::VerifyUseLists()
[0x00000000006f9c75] dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
[0x00000000006fbf63] Unknown symbol
[0x00000000006fcde9] dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
[0x00000000006ee5a9] dart::DRT_OptimizeInvokedFunction(dart::NativeArguments)
[0x00007ff4a6b01630] Unknown symbol
[0x00007ff4a6b01971] Unknown symbol
[0x00007ff49bec0bd7] Unknown symbol
[0x00007ff4a6b01a4e] Unknown symbol
-- End of DumpStackTrace
Aborted (core dumped)
Metadata
Metadata
Assignees
Labels
front-end-kernellegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-][Kernel] Crash with [/-][+][Kernel] Crash with 'correct' arguments[/+]jensjoha commentedon Mar 24, 2017
I've tried to look into this, and so far this is what I've found:
In core/uri.dart function "static Uri parse(String uri, [int start = 0, int end])"
indices ..[0] = 0 ..[_schemeEndIndex] = start - 1 ..[_hostStartIndex] = start - 1 ..[_notSimpleIndex] = start - 1 ..[_portStartIndex] = start ..[_pathStartIndex] = start ..[_queryStartIndex] = end ..[_fragmentStartIndex] = end;in ssa becomes
which then after
in CompileParsedFunctionHelper::Compile in file runtime/vm/compiler.cc becomes
where for instance
is replaced by
--- the problem being that v25 is used later where e.g.
becomes
which doesn't seem right... (in total it seems to be used 7 times)
I can't really seem to figure out what's causing it though.
jensjoha commentedon Mar 24, 2017
Giving up...
/cc @mraleph @mkustermann
mraleph commentedon Mar 24, 2017
I will take a look. From the symptoms it seems that environment position on one path is empty and on a different path it is occupied - which should not really ever happen. Prune dead locals probably hide the issue because this position is not alive. Probably graph misconstruction.
mraleph commentedon Mar 24, 2017
Results of calls like
[]=should never be used because these calls don't return anything meaningful. Instead rhs value should be stored in a temporary and returned after the call.mraleph commentedon Mar 24, 2017
Currently Fasta translates cascade of indexed assignments into a cascade of
let-statements.
For example code like
indices ..[0] = 0 ..[_schemeEndIndex] = start - 1 ..[_hostStartIndex] = start - 1 ..[_notSimpleIndex] = start - 1 ..[_portStartIndex] = start ..[_pathStartIndex] = start ..[_queryStartIndex] = end ..[_fragmentStartIndex] = end;gets translated to
This later becomes in IL (on the example of
#t826.[]=(0, 0)):After SSA construction if locals liveness analysis is disabled (
--no-prune-dead-locals) we get essentially redundant phis constructed for temporary let-variables which actually use result of the instance call:These phis are redundant because their values can never be observed by the program because they correspond to dead stores. In fact these phis only have environment uses.
However subsequent optimization passes assume that result of a
v.[]=(...)invocation can never be used and replacev.[]=(...)with IL sequences that don't actually produce any value - leading to malformed graphs where phis refer to instructions outside of the graph.To workaround the issue we explicitly drop the actual result of
v.[]=(...)and push a null-value to be used instead.