Skip to content

Playground Transform: Fix assertion failure in generic code [3.1] #6719

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

slavapestov
Copy link
Contributor

  • Description: Assertion failure (or undefined behavior w/ asserts off) when using PlaygroundTransform with generic code. This is a regression from Swift 3.
  • Scope of the issue: Affects anyone using playgrounds
  • Risk: Very low
  • Tested: New test added, existing tests passed
  • Reviewed by: @DougGregor
  • Radar: rdar://problem/29935266

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

This regression was introduced in the following commit:
<swiftlang@6cbb494>

Fixes <rdar://problem/29935266>.
@slavapestov slavapestov force-pushed the fix-playground-transform-generics-3.1 branch from eaa631f to 9bdc802 Compare January 11, 2017 00:22
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - eaa631ff5f3871fa441b482c045bc97361a2d4b6
Test requested by - @slavapestov

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - eaa631ff5f3871fa441b482c045bc97361a2d4b6
Test requested by - @slavapestov

@shahmishal
Copy link
Member

FYI - CI is currently down for planned maintenance.

@tkremenek tkremenek merged commit ff85245 into swiftlang:swift-3.1-branch Jan 11, 2017
@shahmishal
Copy link
Member

This PR might be causing PlaygroundLogger test failure:

--- Running PlaygroundLogger Tests ---
[ RUN      ] PlaygroundLogger test suite.VersionDecoding
stdout>>> --- Running PlaygroundLogger Tests ---
[       OK ] PlaygroundLogger test suite.VersionDecoding
[ RUN      ] PlaygroundLogger test suite.SourceRanges
[       OK ] PlaygroundLogger test suite.SourceRanges
[ RUN      ] PlaygroundLogger test suite.TIDSent
[       OK ] PlaygroundLogger test suite.TIDSent
[ RUN      ] PlaygroundLogger test suite.NameDecoding
[       OK ] PlaygroundLogger test suite.NameDecoding
[ RUN      ] PlaygroundLogger test suite.BaseTypesDecoding
[       OK ] PlaygroundLogger test suite.BaseTypesDecoding
[ RUN      ] PlaygroundLogger test suite.StructuredTypesDecoding
[       OK ] PlaygroundLogger test suite.StructuredTypesDecoding
[ RUN      ] PlaygroundLogger test suite.NSNumberDecoding
[       OK ] PlaygroundLogger test suite.NSNumberDecoding
[ RUN      ] PlaygroundLogger test suite.One+OneDecoding
[       OK ] PlaygroundLogger test suite.One+OneDecoding
[ RUN      ] PlaygroundLogger test suite.MetatypeLogging
[       OK ] PlaygroundLogger test suite.MetatypeLogging
[ RUN      ] PlaygroundLogger test suite.ExceptionSafety
[       OK ] PlaygroundLogger test suite.ExceptionSafety
[ RUN      ] PlaygroundLogger test suite.NSViewLogging
stderr>>> _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
[       OK ] PlaygroundLogger test suite.NSViewLogging
[ RUN      ] PlaygroundLogger test suite.NSImageLogging
stdout>>> check failed at /Users/buildnode/jenkins/workspace/oss-swift-3.1-incremental-RA-osx/swift-xcode-playground-support/PlaygroundLogger/PlaygroundLogger/TestInfrastructure.swift, line 181
stdout>>> expected optional to be non-nil
stderr>>> fatal error: unexpectedly found nil while unwrapping an Optional value: file /Users/buildnode/jenkins/workspace/oss-swift-3.1-incremental-RA-osx/swift-xcode-playground-support/PlaygroundLogger/PlaygroundLogger/TestInfrastructure.swift, line 182
stderr>>> Current stack trace:
stderr>>> 0    libswiftCore.dylib                 0x00000001092b2f50 swift_reportError + 125
stderr>>> 1    libswiftCore.dylib                 0x00000001092d3b00 _swift_stdlib_reportFatalErrorInFile + 100
stderr>>> 2    libswiftCore.dylib                 0x000000010909da90 (_assertionFailure(StaticString, String, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1).(closure #1) + 143
stderr>>> 3    libswiftCore.dylib                 0x0000000109277970 partial apply for (_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1).(closure #1) + 112
stderr>>> 4    libswiftCore.dylib                 0x000000010909cf50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 5    libswiftCore.dylib                 0x00000001092778b0 partial apply for (_assertionFailure(StaticString, String, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1) + 144
stderr>>> 6    libswiftCore.dylib                 0x000000010909cf50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 7    libswiftCore.dylib                 0x0000000109216730 partial apply for (_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1) + 154
stderr>>> 8    libswiftCore.dylib                 0x000000010909cf50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 9    libswiftCore.dylib                 0x000000010909ce50 _fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never + 126
stderr>>> 10   PlaygroundLogger                   0x0000000108fb1860 static TestHelpers.unwrapOrFail<A> (A?) -> A + 759
stderr>>> 11   PlaygroundLogger                   0x0000000108f87950 NSImageLoggingTestCase.doTest() -> () + 369
stderr>>> 12   PlaygroundLogger                   0x0000000108f88290 protocol witness for TestCase.doTest() -> () in conformance NSImageLoggingTestCase + 47
stderr>>> 13   PlaygroundLogger                   0x0000000108fb1800 (playground_logger_test() -> ()).(closure #1) + 70
stderr>>> 14   libswiftStdlibUnittest.dylib       0x0000000109d53c60 specialized TestSuite._runTest(name : String, parameter : Int?) -> () + 521
stderr>>> 15   libswiftStdlibUnittest.dylib       0x0000000109cf24d0 _childProcess() -> () + 2141
stderr>>> 16   libswiftStdlibUnittest.dylib       0x0000000109cf8400 runAllTests() -> () + 717
stderr>>> 17   PlaygroundLogger                   0x0000000108faf380 playground_logger_test() -> () + 7981
stderr>>> 18   PlaygroundLogger_TestDriver        0x0000000108f67efb <unavailable> + 3835
stderr>>> 19   libdyld.dylib                      0x00007fff8fc755ac start + 1
stderr>>> CRASHED: SIGILL
the test crashed unexpectedly
[     FAIL ] PlaygroundLogger test suite.NSImageLogging
[ RUN      ] PlaygroundLogger test suite.SpriteKitLogging
stdout>>> --- Running PlaygroundLogger Tests ---
stdout>>> check failed at /Users/buildnode/jenkins/workspace/oss-swift-3.1-incremental-RA-osx/swift-xcode-playground-support/PlaygroundLogger/PlaygroundLogger/TestInfrastructure.swift, line 181
stdout>>> expected optional to be non-nil
stderr>>> fatal error: unexpectedly found nil while unwrapping an Optional value: file /Users/buildnode/jenkins/workspace/oss-swift-3.1-incremental-RA-osx/swift-xcode-playground-support/PlaygroundLogger/PlaygroundLogger/TestInfrastructure.swift, line 182
stderr>>> Current stack trace:
stderr>>> 0    libswiftCore.dylib                 0x0000000100b2ef50 swift_reportError + 125
stderr>>> 1    libswiftCore.dylib                 0x0000000100b4fb00 _swift_stdlib_reportFatalErrorInFile + 100
stderr>>> 2    libswiftCore.dylib                 0x0000000100919a90 (_assertionFailure(StaticString, String, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1).(closure #1) + 143
stderr>>> 3    libswiftCore.dylib                 0x0000000100af3970 partial apply for (_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1).(closure #1) + 112
stderr>>> 4    libswiftCore.dylib                 0x0000000100918f50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 5    libswiftCore.dylib                 0x0000000100af38b0 partial apply for (_assertionFailure(StaticString, String, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1).(closure #1) + 144
stderr>>> 6    libswiftCore.dylib                 0x0000000100918f50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 7    libswiftCore.dylib                 0x0000000100a92730 partial apply for (_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never).(closure #1) + 154
stderr>>> 8    libswiftCore.dylib                 0x0000000100918f50 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 342
stderr>>> 9    libswiftCore.dylib                 0x0000000100918e50 _fatalErrorMessage(StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -> Never + 126
stderr>>> 10   PlaygroundLogger                   0x000000010082e860 static TestHelpers.unwrapOrFail<A> (A?) -> A + 759
stderr>>> 11   PlaygroundLogger                   0x0000000100805520 SpriteKitLoggingTestCase.doTest() -> () + 1165
stderr>>> 12   PlaygroundLogger                   0x0000000100806610 protocol witness for TestCase.doTest() -> () in conformance SpriteKitLoggingTestCase + 47
stderr>>> 13   PlaygroundLogger                   0x000000010082e800 (playground_logger_test() -> ()).(closure #1) + 70
stderr>>> 14   libswiftStdlibUnittest.dylib       0x000000010159bc60 specialized TestSuite._runTest(name : String, parameter : Int?) -> () + 521
stderr>>> 15   libswiftStdlibUnittest.dylib       0x000000010153a4d0 _childProcess() -> () + 2141
stderr>>> 16   libswiftStdlibUnittest.dylib       0x0000000101540400 runAllTests() -> () + 717
stderr>>> 17   PlaygroundLogger                   0x000000010082c380 playground_logger_test() -> () + 7981
stderr>>> 18   PlaygroundLogger_TestDriver        0x00000001007e6efb <unavailable> + 3835
stderr>>> 19   libdyld.dylib                      0x00007fff8fc755ac start + 1
stderr>>> CRASHED: SIGILL
the test crashed unexpectedly
[     FAIL ] PlaygroundLogger test suite.SpriteKitLogging
[ RUN      ] PlaygroundLogger test suite.OptionalGetsStripped
stdout>>> --- Running PlaygroundLogger Tests ---
[       OK ] PlaygroundLogger test suite.OptionalGetsStripped
[ RUN      ] PlaygroundLogger test suite.StackWorks
[       OK ] PlaygroundLogger test suite.StackWorks
[ RUN      ] PlaygroundLogger test suite.NeverLoggingPolicy
[       OK ] PlaygroundLogger test suite.NeverLoggingPolicy
[ RUN      ] PlaygroundLogger test suite.AdaptiveLoggingPolicy
[       OK ] PlaygroundLogger test suite.AdaptiveLoggingPolicy
[ RUN      ] PlaygroundLogger test suite.SetIsMembershipContainer
[       OK ] PlaygroundLogger test suite.SetIsMembershipContainer
[ RUN      ] PlaygroundLogger test suite.TypenameManagement
[       OK ] PlaygroundLogger test suite.TypenameManagement
[ RUN      ] PlaygroundLogger test suite.FloatDoubleDecoding
[       OK ] PlaygroundLogger test suite.FloatDoubleDecoding
[ SKIP     ] PlaygroundLogger test suite.SKShapeNode (skip: [Custom(reason: )])
[ RUN      ] PlaygroundLogger test suite.BaseClassLogging
[       OK ] PlaygroundLogger test suite.BaseClassLogging
[ RUN      ] PlaygroundLogger test suite.EnumSummary_Generic
[       OK ] PlaygroundLogger test suite.EnumSummary_Generic
[ RUN      ] PlaygroundLogger test suite.EnumSummary_NotGeneric
[       OK ] PlaygroundLogger test suite.EnumSummary_NotGeneric
[ RUN      ] PlaygroundLogger test suite.PrintHook
[       OK ] PlaygroundLogger test suite.PrintHook
[ RUN      ] PlaygroundLogger test suite.PlaygroundQuickLookCalledOnce
[       OK ] PlaygroundLogger test suite.PlaygroundQuickLookCalledOnce
[ RUN      ] PlaygroundLogger test suite.UInt64EightBytesEncoding
[       OK ] PlaygroundLogger test suite.UInt64EightBytesEncoding
[ RUN      ] PlaygroundLogger test suite.ColorLoggingTestCase
[       OK ] PlaygroundLogger test suite.ColorLoggingTestCase
[ RUN      ] PlaygroundLogger test suite.StructLoggingTestCase
[       OK ] PlaygroundLogger test suite.StructLoggingTestCase
PlaygroundLogger test suite: Some tests failed, aborting
UXPASS: []
FAIL: ["NSImageLogging", "SpriteKitLogging"]
SKIP: ["SKShapeNode"]

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.

5 participants