Closed a-siva closed 6 years ago
/cc @nex3 @vsmenon @leafpetersen
The following changes in the strack trace package works around the issue
sivalinuxmach[sdk]>git diff lib/src/chain.dart
diff --git a/lib/src/chain.dart b/lib/src/chain.dart
index 8685a9e..334ec00 100644
--- a/lib/src/chain.dart
+++ b/lib/src/chain.dart
@@ -246,8 +246,8 @@ class Chain implements StackTrace {
var longest = traces.map((trace) {
return trace.frames
.map((frame) => frame.location.length)
- .fold(0, math.max);
- }).fold(0, math.max);
+ .fold(0, (x, y) => math.max<int>(x, y));
+ }).fold(0, (x, y) => math.max<int>(x, y));
// Don't call out to [Trace.toString] here because that doesn't ensure that
// padding is consistent across all traces.
sivalinuxmach[sdk]>git stash
sivalinuxmach[sdk]>git branch -vv
* (HEAD detached at 1.9.1) e24e50c Avoid overwriting chain for trace if one exists (#37)
master d18fff5 [origin/master: behind 62] Merge branch 'empty-stack-trace'
sivalinuxmach[sdk]>git diff lib/src/trace.dart
diff --git a/lib/src/trace.dart b/lib/src/trace.dart
index 972c33e..cbeb254 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -320,7 +320,8 @@ class Trace implements StackTrace {
String toString() {
// Figure out the longest path so we know how much to pad.
var longest =
- frames.map((frame) => frame.location.length).fold(0, math.max);
+ frames.map((frame) =>
+ frame.location.length).fold(0, (x, y) => math.max<int>(x, y));
// Print out the stack trace nicely formatted.
return frames.map((frame) {
Some information from the internal thread for context:
math.max
should be assignable here.I've published the front end fix to cause generic tearoffs to be implicitly instantiated: https://dart-review.googlesource.com/c/sdk/+/29744. Unfortunately, no back ends support the new kernel expression type yet (Instantiation), so someone will have to do some back end work before it's useful.
I'll add @a-siva's workaround to stack_trace
for now, but I think this bug should probably target the CFE work to fix the underlying issue.
How can I reproduce this? All the stack_trace
tests seem to be passing with 2.0.0-dev.15.0. Do I have to build bleeding edge?
If you run the VM isolate tests in strong mode you should see a reproduction, here is a reproduction line for one isolate test
pkg/vm/tool/dart2 --no-background-compilation --ignore-unrecognized-flags --packages=/usr/local/google/home/asiva/workspace/dart-ws2/sdk/.packages /usr/local/google/home/asiva/workspace/dart-ws2/sdk/tests/isolate/timer_isolate_test.dart
How do I build pkg/vm/tool/dart2
?
It is a shell script available at sdk/pkg/vm/tool/dart2 in the dart repo.
But it must still rely on something being built... I'm getting this error when trying to run it:
kernel-service: Isolate creation error: Wrong full snapshot version, expected '41bd5eab5c21a0d6a57f3
da2d31d9545' found '531e2c5f5ffcd47fd1ba6fcf7fba109d'
Error while initializing Kernel isolate
Aah yes, you would have to do a VM build in the sdk directory
tools/build.py runtime_kernel
I can't seem to reproduce the error... I'm running on 747772b02d3fbcc82a5eb91b334c6f23073f4682.
$ ./pkg/vm/tool/dart2 --no-background-compilation --packages=.packages tests/isolate/timer_isolate_test.dart
unittest-suite-wait-for-done
PASS: timer in isolate
All 1 tests passed.
unittest-suite-success
I believe this issue was fixed by ae9b0c42d7098c81befe8d353f5eafa9a7ba1790 (a while ago). I was able to bisect it using Fasta itself like:
$ pkg/front_end/tool/fasta compile --target=none --strong third_party/pkg/stack_trace/lib/src/chain.dart
closing as fixed.
We get the following errors from pkg:stacktrace when running in strong mode
This is blocking us from running all the VM tests in strong mode.