Skip to content

[FrontEnd] Pretty stack trace indicating running user code #28284

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 3 commits into from
Nov 19, 2019

Conversation

tapthaker
Copy link
Contributor

Wrap RunInmediately() in a pretty stack trace indicating we are running user code

Resolves SR-11765

@tapthaker
Copy link
Contributor Author

cc @brentdax Since you are the reporter of this Task

@owenv owenv requested a review from beccadax November 15, 2019 21:24
@beccadax
Copy link
Contributor

@swift-ci please smoke test

Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful, thank you!

@tapthaker tapthaker changed the title [FrondEnd] Pretty stack trace indicating running user code [FrontEnd] Pretty stack trace indicating running user code Nov 18, 2019
@tapthaker
Copy link
Contributor Author

🤔I wonder what's wrong here. Error on the CI:

/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Frontend/crash-in-user-code.swift:12:16: error: CHECK-NEXT: expected string not found in input
13:28:46 // CHECK-NEXT: While running user code "SOURCE_DIR/test/FrontEnd/crash-in-user-code.swift"
13:28:46                ^
13:28:46 <stdin>:26:1: note: scanning from here
13:28:46 3. While running user code "SOURCE_DIR/test/Frontend/crash-in-user-code.swift"
13:28:46 ^
13:28:46 <stdin>:26:4: note: possible intended match here
13:28:46 3. While running user code "SOURCE_DIR/test/Frontend/crash-in-user-code.swift"
13:28:46    ^
13:28:46 
13:28:46 --
13:28:46 

The test works fine on my local box. Here is an example stacktrace I am getting locally:

  24   │ 1.  Swift version 5.1.1-dev (Swift f2f521f8bf)
  25   │ 2.  Contents of /Users/tapanth/swift-source/build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/FrontEnd/Output/crash-in-user-code.swift.tmp.filelist.txt:
  26   │ ---
  27   │ /Users/tapanth/swift-source/swift/test/FrontEnd/crash-in-user-code.swift
  28   │ ---
  29   │ 3.  While running user code "/Users/tapanth/swift-source/swift/test/FrontEnd/crash-in-user-code.swift"

@harlanhaskins
Copy link
Contributor

Looks like the test is trying to match FrontEnd, while the file path is Frontend, which passes on macOS because APFS is by default case-insensitive. Change the test to Frontend and it should pass.

@tapthaker
Copy link
Contributor Author

Thanks @harlanhaskins for pointing this out. Could you please trigger the smoke tests for me. I see that the following tests fail for the exact opposite reason in macOS boxes. I'll put up a PR to fix them as well:

crash.swift
parse-sil-inputs.swift#L6

@harlanhaskins
Copy link
Contributor

@swift-ci please smoke test

@harlanhaskins harlanhaskins merged commit dca3056 into swiftlang:master Nov 19, 2019
@harlanhaskins
Copy link
Contributor

Thanks, @tapthaker!

@shahmishal
Copy link
Member

@tapthaker @harlanhaskins Can you run full test before re-committing this change? Thanks!

@harlanhaskins
Copy link
Contributor

Will do, thanks @shahmishal!

@beccadax
Copy link
Contributor

beccadax commented Nov 19, 2019

@tapthaker It looks like this feature didn't work in the iOS Simulator, so we had to revert it—I'm sorry that we didn't think to run full tests!

To run tests with the iOS simulator, you'll need to run build-script with the --ios flag (along with -t). Depending on the iOS simulators you have installed, you may need to add --skip-test-ios-32bit-simulator to avoid trying to test configurations you don't have the simulators for. If you can't get the simulator tests to run with that flag, you may be stuck on the old configuration; adding --reconfigure once should fix that.

You may find that crashes on the simulator are so different that it doesn't make sense to test this feature on them; if so, you'll probably want to add // UNSUPPORTED: lines covering iOS, tvOS, and watchOS. On the other hand, you might find that the output is just a little bit different and you can tweak the test to match it.

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.

4 participants