Skip to content

[SILVerifier] Add a flag to not abort upon verification failure. #12519

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
Oct 24, 2017

Conversation

dcci
Copy link
Member

@dcci dcci commented Oct 20, 2017

Exit somewhat carefully instead. This matches what LLVM does,
and makes testing/fuzzing easier. It's also slightly more friendly
in case the user violates an assumption.

I'd prefer to have the compiler never aborting on user input (in particular, something text based), but this seems an OK middle-ground. I'll be happy to change the default altogether if people like it.

@dcci dcci self-assigned this Oct 20, 2017
@dcci dcci requested review from gottesmm and eeckstein October 20, 2017 00:29
@@ -139,7 +142,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
F.print(llvm::dbgs());
}

abort();
if (AbortOnFailure)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just change this to use exit(1).

Copy link
Member Author

Choose a reason for hiding this comment

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

Terrific, I'll do it early tomorrow and update the pull request.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you happen to know why the behaviour was to abort (probably historical reasons)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I looked before I wrote that ; ). It is really really old (from revision < 10k IIRC). I think it was just someone working quickly.

@dcci
Copy link
Member Author

dcci commented Oct 20, 2017

@swift-ci please test

@gottesmm
Copy link
Contributor

@dcci I was talking with some other people and they pointed out that abort is important for crashing in the debugger. So can you add the option back (sorry!)

@dcci
Copy link
Member Author

dcci commented Oct 20, 2017

Oh, sure, no worries. Mind if I add a comment to explain the behaviour?

@dcci
Copy link
Member Author

dcci commented Oct 20, 2017

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3129b6aaeda238ed23cb2721cd7063968e49308e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3129b6aaeda238ed23cb2721cd7063968e49308e

This matches what LLVM does, and makes testing/fuzzing easier.
It's also slightly more friendly in case the user violates an
assumption. It can't be turned on by default (yet) because it's
important to crash on verification failures, when running swiftc
in a debugger.
@dcci
Copy link
Member Author

dcci commented Oct 22, 2017

The build was failing yesterday for unrelated reasons, rebased.

@dcci
Copy link
Member Author

dcci commented Oct 22, 2017

@swift-ci please smoke test

@dcci
Copy link
Member Author

dcci commented Oct 23, 2017

@eeckstein what do you think about this one? I can put on hold and have this patch locally for now if you want to discuss further the whole abort VS exit in the verifier.

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

LGTM

@dcci dcci merged commit 1ebaee1 into swiftlang:master Oct 24, 2017
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