dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.19k stars 1.57k forks source link

Failures on Add a pass for suggesting elements that are not yet imported...Update clang to 0f61051f541a5b8cfce25c84262dfdbadb9ca688. #55537

Closed alexmarkov closed 5 months ago

alexmarkov commented 5 months ago

There are new test failures on Add a pass for suggesting elements that are not yet imported...Update clang to 0f61051f541a5b8cfce25c84262dfdbadb9ca688..

The tests

vm/dart/gen_snapshot_include_resolved_urls_test RuntimeError (expected Pass)

are failing on configurations

vm-aot-asan-linux-release-x64

From the log:

Running pkg/vm/tool/gen_kernel --aot --packages=./.packages --platform=out/ReleaseASANX64/vm_platform_strong.dill -o /b/s/w/itcijv4yn6/aot-script-urls-testLIQXKN/test.dill ./runtime/tests/vm/dart/gen_snapshot_include_resolved_urls_script.dart

stdout:

Error: Error when reading '.packages': No such file or directory
Error: Couldn't resolve the package 'vm_service' in 'package:vm_service/vm_service_io.dart'.
runtime/tests/vm/dart/gen_snapshot_include_resolved_urls_script.dart:8:8: Error: Not found: 'package:vm_service/vm_service_io.dart'
import 'package:vm_service/vm_service_io.dart';
       ^
runtime/tests/vm/dart/gen_snapshot_include_resolved_urls_script.dart:29:25: Error: Method not found: 'vmServiceConnectUri'.
  final service = await vmServiceConnectUri(uri.toString());
                        ^^^^^^^^^^^^^^^^^^^

Command failed with non-zero exit code (was 254)

Running out/ReleaseASANX64/gen_snapshot --snapshot-kind=app-aot-elf --elf=/b/s/w/itcijv4yn6/aot-script-urls-testLIQXKN/aot.snapshot /b/s/w/itcijv4yn6/aot-script-urls-testLIQXKN/test.dill

Running out/ReleaseASANX64/dart_precompiled_runtime --enable-vm-service=0 --profiler /b/s/w/itcijv4yn6/aot-script-urls-testLIQXKN/aot.snapshot

stdout:

The Dart VM service is listening on http://127.0.0.1:44729/XCX5X6xKSeg=/

stderr:

AddressSanitizer: CHECK failed: asan_mapping.h:372 "((AddrIsInMem(p))) != (0)" (0x0, 0x0) (tid=210710)
    #0 0x55a7089d5f31 in __asan::CheckUnwind() ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:69:3
    #1 0x55a7089e9d82 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../../../llvm-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:86:5
    #2 0x55a7089cd99d in MemToShadow ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/asan_mapping.h:372:3
    #3 0x55a7089cd99d in __asan::ShadowSegmentEndpoint::ShadowSegmentEndpoint(unsigned long) ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/asan_poisoning.cpp:61:18
    #4 0x55a7089cda0e in __asan_unpoison_memory_region ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/asan_poisoning.cpp:149:25
    #5 0x55a708eaf7b3 in dart::ProfilerDartStackWalker::CallerPC() const out/ReleaseASANX64/../../runtime/vm/profiler.cc:1099:5
    #6 0x55a708eaf7b3 in dart::ProfilerDartStackWalker::walk() out/ReleaseASANX64/../../runtime/vm/profiler.cc:1088:13
    #7 0x55a708eb03c1 in dart::CollectSample(dart::Isolate*, bool, bool, dart::Sample*, dart::ProfilerNativeStackWalker*, dart::ProfilerDartStackWalker*, unsigned long, unsigned long, unsigned long, dart::ProfilerCounters*) out/ReleaseASANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/__atomic/cxx_atomic_impl.h
    #8 0x55a708eb03c1 in dart::Profiler::SampleThread(dart::Thread*, dart::InterruptedThreadState const&) out/ReleaseASANX64/../../runtime/vm/profiler.cc:1453:3
    #9 0x55a708fbfa19 in dart::ThreadInterrupterLinux::ThreadInterruptSignalHandler(int, siginfo_t*, void*) out/ReleaseASANX64/../../runtime/vm/thread_interrupter_linux.cc:44:5
    #10 0x7f0570b6b41f  (/lib/x86_64-linux-gnu/libpthread.so.0+0x1441f) (BuildId: c6d0d79d906d62bb768421fc6dada0d5e729f177)
    #11 0x55a7089e13ef in __sanitizer::mem_is_zero(char const*, unsigned long) ../../../../../../llvm-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp:308:3
    #12 0x55a7089cdf69 in __asan_region_is_poisoned ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/asan_poisoning.cpp:191:8
    #13 0x55a7089ca282 in memmove ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:98:3

Command failed with non-zero exit code (was -6)

01:25 +0 -1: Include resolved urls [E]

  Expected: <true>
    Actual: <false>

  package:matcher/src/expect/expect.dart 149                             fail
  package:matcher/src/expect/expect.dart 144                             _expect
  package:matcher/src/expect/expect.dart 56                              expect
  runtime/tests/vm/dart/gen_snapshot_include_resolved_urls_test.dart 76  main.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 215                         Declarer.test.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 213                         Declarer.test.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/invoker.dart 258                          Invoker._waitForOutstandingCallbacks.<fn>

01:25 +0 -1: (tearDownAll)

01:25 +0 -1: Some tests failed.

Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
For example, 'dart test --chain-stack-traces'.

stderr:
Unhandled exception:
Dummy exception to set exit code.

--- Re-run this test:
python3 tools/test.py -n vm-aot-asan-linux-release-x64 vm/dart/gen_snapshot_include_resolved_urls_test

https://dart-ci.appspot.com/log/vm-aot-asan-linux-release-x64/vm-aot-asan-linux-release-x64/402/vm/dart/gen_snapshot_include_resolved_urls_test

There are multiple failures:

alexmarkov commented 5 months ago

Attempt to fix the test: https://dart-review.googlesource.com/c/sdk/+/363940.

alexmarkov commented 5 months ago

Compile-time error is fixed, but the test is still failing due to ASAN error.

rmacnak-google commented 5 months ago

ASAN looks upset that the profile is about to dereference 0. Seems like https://github.com/dart-lang/sdk/issues/52814, but for CallRuntimeEntry(kMemoryMoveRuntimeEntry). This seems to use CCallInstr instead of LeafRuntimeScope::Call, and skips things like updating Thread::vmtag to inform the profile we're not running Dart anymore.

rmacnak-google commented 5 months ago

https://dart-review.googlesource.com/c/sdk/+/363962