Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bb104f0

Browse files
emmanuel-pCommit Bot
authored andcommitted
Revert "Reland "[vm] Remove warnings about non-standard stack traces.""
This reverts commit 6651c29. Reason for revert: breaks google3 (b/236928633) Original change's description: > Reland "[vm] Remove warnings about non-standard stack traces." > > This is a reland of commit cc9d14d > > TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy_non_symbolic_test > > Original change's description: > > [vm] Remove warnings about non-standard stack traces. > > > > The language team has clarified in > > dart-lang/language#1212 that the content of > > stack traces is not specified in a way that is violated by either > > obfuscation or non-symbolic stack traces. Thus, we remove the warnings > > about supposedly standard-violating stack traces. > > > > TEST=No change in actual functionality, so tested manually. > > > > Bug: dart-lang/sdk#43388 > > Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185 > > Commit-Queue: Tess Strickland <sstrickl@google.com> > > Reviewed-by: Daco Harkes <dacoharkes@google.com> > > Reviewed-by: Martin Kustermann <kustermann@google.com> > > Bug: dart-lang/sdk#43388 > Change-Id: Ifa7915b4ba21cca592ed5645cd9ad6cda1575f12 > Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249192 > Commit-Queue: Tess Strickland <sstrickl@google.com> > Reviewed-by: Martin Kustermann <kustermann@google.com> > Reviewed-by: Daco Harkes <dacoharkes@google.com> TBR=kustermann@google.com,dacoharkes@google.com,sstrickl@google.com Change-Id: I65f3d84caee3ec9ac30f0ce058104bb24ef6ea11 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: dart-lang/sdk#43388 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249580 Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
1 parent 4d750a8 commit bb104f0

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

runtime/tests/vm/dart/causal_stacks/utils.dart

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,26 +205,21 @@ Future<void> assertStack(List<String> expects, StackTrace stackTrace,
205205

206206
// Use the DWARF stack decoder if we're running in --dwarf-stack-traces mode
207207
// and in precompiled mode (otherwise --dwarf-stack-traces has no effect).
208-
bool usingDwarf = false;
209-
if (debugInfoFilename != null) {
210-
try {
211-
final dwarf = Dwarf.fromFile(debugInfoFilename)!;
212-
usingDwarf = true;
213-
frames = await Stream.fromIterable(original)
214-
.transform(DwarfStackTraceDecoder(dwarf))
215-
.where(_lineRE.hasMatch)
216-
.toList();
217-
} on FileSystemException {
218-
// We're not running in precompiled mode, so the file doesn't exist and
219-
// we can continue normally.
220-
}
208+
final decodeTrace = frames.first.startsWith('Warning:');
209+
if (decodeTrace) {
210+
Expect.isNotNull(debugInfoFilename);
211+
final dwarf = Dwarf.fromFile(debugInfoFilename!)!;
212+
frames = await Stream.fromIterable(original)
213+
.transform(DwarfStackTraceDecoder(dwarf))
214+
.where(_lineRE.hasMatch)
215+
.toList();
221216
}
222217

223218
void printFrameInformation() {
224219
print('RegExps for expected stack:');
225220
expects.forEach((s) => print('"${s}"'));
226221
print('');
227-
if (usingDwarf) {
222+
if (decodeTrace) {
228223
print('Non-symbolic actual stack:');
229224
original.forEach(print);
230225
print('');

runtime/tests/vm/dart_2/causal_stacks/utils.dart

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,26 +207,21 @@ Future<void> assertStack(List<String> expects, StackTrace stackTrace,
207207

208208
// Use the DWARF stack decoder if we're running in --dwarf-stack-traces mode
209209
// and in precompiled mode (otherwise --dwarf-stack-traces has no effect).
210-
bool usingDwarf = false;
211-
if (debugInfoFilename != null) {
212-
try {
213-
final dwarf = Dwarf.fromFile(debugInfoFilename);
214-
usingDwarf = true;
215-
frames = await Stream.fromIterable(original)
216-
.transform(DwarfStackTraceDecoder(dwarf))
217-
.where(_lineRE.hasMatch)
218-
.toList();
219-
} on FileSystemException {
220-
// We're not running in precompiled mode, so the file doesn't exist and
221-
// we can continue normally.
222-
}
210+
final decodeTrace = frames.first.startsWith('Warning:');
211+
if (decodeTrace) {
212+
Expect.isNotNull(debugInfoFilename);
213+
final dwarf = Dwarf.fromFile(debugInfoFilename);
214+
frames = await Stream.fromIterable(original)
215+
.transform(DwarfStackTraceDecoder(dwarf))
216+
.where(_lineRE.hasMatch)
217+
.toList();
223218
}
224219

225220
void printFrameInformation() {
226221
print('RegExps for expected stack:');
227222
expects.forEach((s) => print('"${s}"'));
228223
print('');
229-
if (usingDwarf) {
224+
if (decodeTrace) {
230225
print('Non-symbolic actual stack:');
231226
original.forEach(print);
232227
print('');

runtime/vm/isolate.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,13 @@ Isolate::Isolate(IsolateGroup* isolate_group,
17391739
// how the vm_tag (kEmbedderTagId) can be set, these tags need to
17401740
// move to the OSThread structure.
17411741
set_user_tag(UserTags::kDefaultUserTag);
1742+
1743+
if (group()->obfuscate()) {
1744+
OS::PrintErr(
1745+
"Warning: This VM has been configured to obfuscate symbol information "
1746+
"which violates the Dart standard.\n"
1747+
" See dartbug.com/30524 for more information.\n");
1748+
}
17421749
}
17431750

17441751
#undef REUSABLE_HANDLE_SCOPE_INIT

runtime/vm/object.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25878,6 +25878,12 @@ const char* StackTrace::ToCString() const {
2587825878
isolate_instructions_image.instructions_relocated_address();
2587925879
auto const vm_relocated_address =
2588025880
vm_instructions_image.instructions_relocated_address();
25881+
// The Dart standard requires the output of StackTrace.toString to include
25882+
// all pending activations with precise source locations (i.e., to expand
25883+
// inlined frames and provide line and column numbers).
25884+
buffer.Printf(
25885+
"Warning: This VM has been configured to produce stack traces "
25886+
"that violate the Dart standard.\n");
2588125887
// This prologue imitates Android's debuggerd to make it possible to paste
2588225888
// the stack trace into ndk-stack.
2588325889
buffer.Printf(

0 commit comments

Comments
 (0)