Skip to content

[presets] Introduce slimmer preset for lldb sanitizer testing #34504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

vedantk
Copy link
Contributor

@vedantk vedantk commented Oct 30, 2020

Add a new "buildbot_incremental,lldb_asan_ubsan" preset.

This differs from the existing "buildbot_incremental_asan_ubsan,tools=RDA,stdlib=RDA"
preset in the following ways:

  • It builds the swift benchmarks, with an unoptimized benchmark driver.
    This is to enable stepper testing on CI. For more context, see:
    [test/Shell] Add stepper test for Benchmark_Onone llvm-project#2059.

  • It does not build a sanitized clang or swift. This can save a lot of
    time, and make reports from oss-lldb-asan bots more actionable.
    It also cuts down on redundant work, since clang & swift already have
    sanitizer bots. This does trade away some sanitized test coverage.

rdar://69589638

Add a new "buildbot_incremental,lldb_asan_ubsan" preset.

This differs from the existing preset used to do sanitized lldb testing
on ci.swift.org, "buildbot_incremental_asan_ubsan,tools=RDA,stdlib=RDA",
in the following ways:

- It builds the swift benchmarks, with an unoptimized benchmark driver.
  This is to enable stepper testing on CI. For more context, see:
  swiftlang/llvm-project#2059.

- It does not build a sanitized clang or swift. This can save a large
  amount of time, and make reports from oss-lldb-asan bots more useful.

This is still WIP pending more testing.

Note:

A dry run for the existing buildbot_incremental_asan_ubsan preset does
not apply '--skip-build-benchmarks':

```
./swift/utils/build-script -n --preset "buildbot_incremental_asan_ubsan,tools=RDA,stdlib=RDA"
```

So I'm not yet sure where that comes from. Perhaps the oss-lldb-asan-osx
bot is using a different preset?

rdar://69589638
@vedantk
Copy link
Contributor Author

vedantk commented Oct 30, 2020

I just realized: if the oss-lldb-asan-osx bot is indeed using the "buildbot_incremental_asan_ubsan,tools=RDA,stdlib=RDA" preset, it might be simpler to just edit that preset instead of introducing a new preset and changing the bot config.

@vedantk
Copy link
Contributor Author

vedantk commented Oct 30, 2020

I'm still not 100% sure, but it's starting to look like the oss-lldb-asan-osx job doesn't use a preset from build-presets.ini. E.g., I don't see it passing a '--preset' option, and I do see it passing '--lldb-build-with-cmake' which no preset does anymore (afaik).

I'll follow up with @shahmishal to figure out whether we want to check in a new preset or simply tweak the bot config.

@shahmishal
Copy link
Member

@vedantk It's not using preset, if you have a preset I can update the job.

"${WORKSPACE}/swift/utils/build-script"  --release --enable-ubsan --enable-asan --lldb --test -- --skip-test-cmark --skip-build-benchmarks --skip-test-swift --lldb-use-system-debugserver --build-ninja --lldb-test-swift-compatibility=`xcrun -find swiftc` --lldb-build-with-cmake --cmake-c-launcher `which sccache` --cmake-cxx-launcher `which sccache`

@vedantk vedantk changed the title WIP: [presets] Introduce slimmer preset for lldb sanitizer testing [presets] Introduce slimmer preset for lldb sanitizer testing Oct 30, 2020
@vedantk
Copy link
Contributor Author

vedantk commented Oct 30, 2020

Thanks @shahmishal! Can we change the oss-lldb-*asan-osx configs to:

"${WORKSPACE}/swift/utils/build-script" --release --assertions --lldb --debug-swift-stdlib --test --skip-ios --skip-tvos --skip-watchos -- --skip-test-cmark --skip-test-swift --lldb-use-system-debugserver --build-ninja --extra-cmake-options='-DSWIFT_BENCHMARK_UNOPTIMIZED_DRIVER:BOOL=1' --lldb-extra-cmake-args="-DLLVM_USE_SANITIZER=Address;Undefined" --lldb-test-swift-compatibility=`xcrun -find swiftc` --cmake-c-launcher `which sccache` --cmake-cxx-launcher `which sccache`

@vedantk
Copy link
Contributor Author

vedantk commented Nov 2, 2020

@shahmishal would it be more maintainable/sustainable to check in the preset, and to then change the oss-lldb-asan-osx bots to do:

build-script --preset buildbot_incremental,lldb_asan_ubsan --cmake-c-launcher `which sccache` --cmake-cxx-launcher `which sccache`

That way, we can modify the preset when the testing needs change without bugging you, and we retain the sccache integration on the bot.

@shahmishal
Copy link
Member

Sounds good, let's get this PR merged and I will update the bot.

@shahmishal
Copy link
Member

preset=buildbot_incremental,lldb_asan_ubsan
@swift-ci Please test with preset macOS

@vedantk
Copy link
Contributor Author

vedantk commented Nov 2, 2020

Looks like java.io.EOFException, doesn't look like any of the compiler invocations failed. swift is (correctly) not being built with sanitization enabled.

@vedantk
Copy link
Contributor Author

vedantk commented Nov 2, 2020

preset=buildbot_incremental,lldb_asan_ubsan
@swift-ci Please test with preset macOS

@vedantk
Copy link
Contributor Author

vedantk commented Nov 2, 2020

Progress! This time we time out after hitting some container-overflow FPs in the unit tests. That will be addressed by swiftlang/llvm-project#2087.

@vedantk
Copy link
Contributor Author

vedantk commented Nov 3, 2020

preset=buildbot_incremental,lldb_asan_ubsan
@swift-ci Please test with preset macOS

@vedantk
Copy link
Contributor Author

vedantk commented Nov 3, 2020

@shahmishal it looks like the preset is behaving exactly as expected/desired (https://ci.swift.org/job/swift-PR-osx-preset/130/consoleText); however, the test job fails because the bot is not configured to allow debugging ("(this is a non-interactive debug session, cannot get permission to debug processes.)").

Can we merge this and switch the oss-lldb-*-asan-osx bots over?

@shahmishal
Copy link
Member

Sounds good, let's merge it.

@vedantk
Copy link
Contributor Author

vedantk commented Nov 4, 2020

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit fb9eb94 into swiftlang:main Nov 4, 2020
@vedantk vedantk deleted the stepper-ci branch November 5, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants