Skip to content

Sil verify all verify functions when added to worklist #5221

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

Conversation

gottesmm
Copy link
Contributor

When SILVerifyAll is enabled, individual functions are verified after
function passes are run upon them. This means that any functions created
by a function pass will not be verified after the pass runs. Thus
specialization errors that cause the verifier to trip will be
misattributed to the first pass that makes a change to the specialized
function. This is very misleading and increases triage time.

As a result, when SILVerifyAll is enabled, we always verify newly
specialized functions as they are added to the worklist.

An int is already constant and in general in LLVM style we do not create such
const ints. On the other hand, a constexpr I think expresses the intent slightly
better and gives the compiler more freedom anyways.
@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test

@gottesmm
Copy link
Contributor Author

Oops... pushed an older version. 1 sec

…ions after adding them to the worklist.

When SILVerifyAll is enabled, individual functions are verified after
function passes are run upon them. This means that any functions created
by a function pass will not be verified after the pass runs. Thus
specialization errors that cause the verifier to trip will be
misattributed to the first pass that makes a change to the specialized
function. This is very misleading and increases triage time.

This change eliminates that problem by ensuring that when SILVerifyAll is
enabled, we always verify newly specialized functions as they are added to the
worklist.

rdar://28706158
@gottesmm gottesmm force-pushed the sil_verify_all_verify_functions_when_added_to_worklist branch from 284555f to 1ba8182 Compare October 11, 2016 02:14
@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test linux platform

@gottesmm
Copy link
Contributor Author

Now that I think about it, given that this can potentially cause the verifier to trigger many more times, I really need to do a full test to be careful.

@gottesmm
Copy link
Contributor Author

(specifically since I could expose bad code patterns to the verifier that previously were DCEed or the like).

@gottesmm
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 284555ff35559d28345c09ecc423fbf1962adf51
Test requested by - @gottesmm

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 284555ff35559d28345c09ecc423fbf1962adf51
Test requested by - @gottesmm

@gottesmm
Copy link
Contributor Author

These are from the earlier "oops" version.

Not sure why it took so long for this post to land though.

@shahmishal Might be a sign of a bigger problem.

On Oct 10, 2016, at 7:50 PM, swift-ci [email protected] wrote:

Build failed
Jenkins build - Swift Test OS X Platform https://ci.swift.org/job/swift-PR-osx/4003/
Git Commit - 284555f 284555f
Test requested by - @gottesmm https://github.com/gottesmm

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #5221 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAee3xOYv0gCL4crVhHTUFeMLwtS4Uddks5qyvl6gaJpZM4KTKsJ.

@gottesmm
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 1ba8182
Test requested by - @gottesmm

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 1ba8182
Test requested by - @gottesmm

@gottesmm
Copy link
Contributor Author

@shahmishal My tests failed I think b/c of infrastructure issues. Can you take a look?

@gottesmm
Copy link
Contributor Author

@swift-ci Please test

@shahmishal
Copy link
Member

Linux smoke test failed due to

Test Case 'ShellTests.testPopen' started at 08:39:56.560
fatal error: 'try!' expression unexpectedly raised an error: POSIX.ShellError.popen(arguments: ["echo", "foo"], close error: Unknown error -1 (-1)): file /home/buildnode/disk2/workspace/swift-PR-Linux-smoke-test/branch-master/swift/stdlib/public/core/ErrorType.swift, line 182
Current stack trace:
0    libswiftCore.so                    0x00007fdbd7b84d00 swift_reportError + 117
1    libswiftCore.so                    0x00007fdbd7b93fd0 _swift_stdlib_reportFatalErrorInFile + 99
2    libswiftCore.so                    0x00007fdbd79954ec <unavailable> + 1172716
3    libswiftCore.so                    0x00007fdbd7b366bd <unavailable> + 2881213
4    libswiftCore.so                    0x00007fdbd7994d86 <unavailable> + 1170822
5    libswiftCore.so                    0x00007fdbd7b3c210 <unavailable> + 2904592
6    libswiftCore.so                    0x00007fdbd79951bc <unavailable> + 1171900
7    libswiftCore.so                    0x00007fdbd7afabf9 <unavailable> + 2636793
8    libswiftCore.so                    0x00007fdbd7994d86 <unavailable> + 1170822
9    libswiftCore.so                    0x00007fdbd7ab9b60 specialized _assertionFailed(StaticString, String, StaticString, UInt, flags : UInt32) -> Never + 144
10   libswiftCore.so                    0x00007fdbd79bf3b5 <unavailable> + 1344437
11   SwiftPMPackageTests.xctest         0x0000000000757b5e <unavailable> + 3504990
12   SwiftPMPackageTests.xctest         0x000000000041d1f7 <unavailable> + 119287
13   SwiftPMPackageTests.xctest         0x0000000000757ce1 <unavailable> + 3505377
14   libXCTest.so                       0x00007fdbd7dbec51 <unavailable> + 93265
15   libXCTest.so                       0x00007fdbd7dbf1eb <unavailable> + 94699
16   libXCTest.so                       0x00007fdbd7dbeb70 XCTAssertEqual<A where ...> (@autoclosure () throws -> A, @autoclosure () throws -> A, @autoclosure () -> String, file : StaticString, line : UInt) -> () + 89
17   SwiftPMPackageTests.xctest         0x0000000000757a4d <unavailable> + 3504717
18   SwiftPMPackageTests.xctest         0x000000000075942a <unavailable> + 3511338
19   SwiftPMPackageTests.xctest         0x0000000000420411 <unavailable> + 132113
20   SwiftPMPackageTests.xctest         0x00000000007593c1 <unavailable> + 3511233
21   libXCTest.so                       0x00007fdbd7def4db <unavailable> + 292059
22   libXCTest.so                       0x00007fdbd7dbda92 <unavailable> + 88722
23   libXCTest.so                       0x00007fdbd7def490 <unavailable> + 291984
24   libXCTest.so                       0x00007fdbd7def240 <unavailable> + 291392
25   libXCTest.so                       0x00007fdbd7dbcae0 XCTestCase.invokeTest() -> () + 112
26   libXCTest.so                       0x00007fdbd7dd9b00 specialized XCTestCase.perform(XCTestRun) -> () + 313
27   libXCTest.so                       0x00007fdbd7dbca10 XCTestCase.perform(XCTestRun) -> () + 14
28   libXCTest.so                       0x00007fdbd7dbc560 XCTest.run() -> () + 629
29   libXCTest.so                       0x00007fdbd7ddba20 specialized XCTestSuite.perform(XCTestRun) -> () + 789
30   libXCTest.so                       0x00007fdbd7ddba20 specialized XCTestSuite.perform(XCTestRun) -> () + 2019
31   libXCTest.so                       0x00007fdbd7ddba20 specialized XCTestSuite.perform(XCTestRun) -> () + 2019
32   libXCTest.so                       0x00007fdbd7dc9aa0 XCTMain([(testCaseClass : XCTestCase.Type, allTests : [(String, (XCTestCase) throws -> ())])]) -> Never + 4283
33   SwiftPMPackageTests.xctest         0x000000000041b062 <unavailable> + 110690
34   libc.so.6                          0x00007fdbd5bc4dd0 __libc_start_main + 245
35   SwiftPMPackageTests.xctest         0x000000000041ac89 <unavailable> + 109705
--- bootstrap: error: tests failed with exit status 1

@shahmishal
Copy link
Member

20:21:59 PASS: Swift(iphonesimulator-x86_64) :: Python/swift_build_support.swift (8749 of 8754)
00:53:49 
Build timed out (after 300 minutes). Marking the build as failed.

Time out was due to no output to console for 300mins. Test getting stuck?

@shahmishal
Copy link
Member

Other Linux failure is due to

20:17:12 /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swiftpm/Sources/PackageLoading/Module+PkgConfig.swift:11:8: error: module file was created by an older version of the compiler; rebuild 'PackageModel' and try again: /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageModel.swiftmodule
20:17:12 import PackageModel
20:17:12        ^
20:17:12 0  swift           0x00000000034be548 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
20:17:12 1  swift           0x00000000034bf126
20:17:12 2  libpthread.so.0 0x00007fc234b06330
20:17:12 3  swift           0x000000000083829f
20:17:12 4  libc.so.6       0x00007fc2332c9295
20:17:12 5  libc.so.6       0x00007fc2332c9172
20:17:12 6  libc.so.6       0x00007fc2332c9172
20:17:12 7  libc.so.6       0x00007fc2332c9188
20:17:12 8  libc.so.6       0x00007fc2332c9172
20:17:12 9  libc.so.6       0x00007fc2332c9172
20:17:12 10 libc.so.6       0x00007fc2332c9172
20:17:12 11 libc.so.6       0x00007fc2332c9172
20:17:12 12 libc.so.6       0x00007fc2332c96cc qsort_r + 652
20:17:12 13 swift           0x00000000008349f1
20:17:12 14 swift           0x0000000000830fe7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2551
20:17:12 15 swift           0x00000000007f8408 main + 3016
20:17:12 16 libc.so.6       0x00007fc2332aff45 __libc_start_main + 245
20:17:12 17 swift           0x00000000007f5ad6
20:17:12 Stack dump:
20:17:12 0. Program arguments: /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swift-linux-x86_64/bin/swift -frontend -c /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swiftpm/Sources/PackageLoading/Module+PkgConfig.swift /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swiftpm/Sources/PackageLoading/ManifestLoader.swift -primary-file /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swiftpm/Sources/PackageLoading/PackageBuilder.swift /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swiftpm/Sources/PackageLoading/ModuleMapGenerator.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation/usr/lib/swift -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/xctest-linux-x86_64 -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/libdispatch-linux-x86_64/src -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/libdispatch-linux-x86_64/src/swift -I /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/swift-corelibs-libdispatch -enable-testing -g -module-cache-path /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/ModuleCache -D SWIFT_PACKAGE -Xcc -fblocks -emit-module-doc-path /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageLoading.build/PackageBuilder~partial.swiftdoc -Onone -parse-as-library -module-name PackageLoading -emit-module-path /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageLoading.build/PackageBuilder~partial.swiftmodule -emit-dependencies-path /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageLoading.build/PackageBuilder.d -emit-reference-dependencies-path /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageLoading.build/PackageBuilder.swiftdeps -num-threads 8 -o /home/buildnode/disk2/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/swiftpm-linux-x86_64/debug/PackageLoading.build/PackageBuilder.swift.o 
20:17:12 <unknown>:0: error: unable to execute command: Segmentation fault

@gottesmm gottesmm merged commit 7c82bd5 into swiftlang:master Oct 11, 2016
@gottesmm gottesmm deleted the sil_verify_all_verify_functions_when_added_to_worklist branch October 11, 2016 22: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