Skip to content

Instantly share code, notes, and snippets.

@hpux735
Last active February 24, 2016 23:52
Show Gist options
  • Save hpux735/7384f55e0c1b1a32a679 to your computer and use it in GitHub Desktop.
Save hpux735/7384f55e0c1b1a32a679 to your computer and use it in GitHub Desktop.
I suspect it's related to linking…
So, a while back Orlando had fixed some things in Foundation (which still haven't been merged yet).
The symptom is that you'll get an error from unwrapping a nil.
When I test OSULogger (b, in the example above) without the patched Foundation I get the error.
Once I patched it, the tests pass. Then, with the same libraries and everything,
if I pull in OSUOpenCL (a) which depends on OSULogger, the tests in logger fail in the
same way as the unpatched Foundation
wdillon@beast:~/OSULogger$ swift test
Compiling Swift Module 'OSULoggertest' (2 sources)
Linking test-Package.xctest
Test Case 'OSULogger_TestComplete.testSeverityComparable' started.
Test Case 'OSULogger_TestComplete.testSeverityComparable' passed (0.0 seconds).
Test Case 'OSULogger_TestComplete.testLoggerEquivalence' started.
Test Case 'OSULogger_TestComplete.testLoggerEquivalence' passed (0.0 seconds).
Test Case 'OSULogger_TestComplete.testSharedLogger' started.
Test Case 'OSULogger_TestComplete.testSharedLogger' passed (0.0 seconds).
Test Case 'OSULogger_TestComplete.testPerformanceXMLLoad' started.
Test Case 'OSULogger_TestComplete.testPerformanceXMLLoad' passed (0.005 seconds).
Test Case 'OSULogger_TestComplete.testPerformanceJSONLoad' started.
Test Case 'OSULogger_TestComplete.testPerformanceJSONLoad' passed (0.004 seconds).
Test Case 'OSULogger_TestComplete.testPerformanceXMLWrite' started.
Test Case 'OSULogger_TestComplete.testPerformanceXMLWrite' passed (0.003 seconds).
Test Case 'OSULogger_TestComplete.testPerformanceJSONWrite' started.
Test Case 'OSULogger_TestComplete.testPerformanceJSONWrite' passed (0.001 seconds).
Test Case 'OSULogger_TestComplete.testStringFromXML' started.
Test Case 'OSULogger_TestComplete.testStringFromXML' passed (0.001 seconds).
Test Case 'OSULogger_TestComplete.testXMLReadAndWrite' started.
Test Case 'OSULogger_TestComplete.testXMLReadAndWrite' passed (0.008 seconds).
Executed 9 tests, with 0 failures (0 unexpected) in 0.021 (0.149) seconds
Test Case 'OSULogger_TestSimple.testSimple' started.
Test Case 'OSULogger_TestSimple.testSimple' passed (0.0 seconds).
Executed 1 test, with 0 failures (0 unexpected) in 0.0 (0.0) seconds
Total executed 10 tests, with 0 failures (0 unexpected) in 0.021 (0.149) seconds
wdillon@beast:~/OSUOpenCL$ swift test
Linking test-Package.xctest
Test Case 'OSULogger_TestComplete.testSeverityComparable' started.
fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
/usr/lib/swift/linux/libswiftCore.so(swift_reportError+0x8b) [0x7f03e4e877eb]
/usr/lib/swift/linux/libswiftCore.so(_swift_stdlib_reportFatalError+0x3d) [0x7f03e4e9856d]
/usr/lib/swift/linux/libswiftCore.so(+0x23b5df) [0x7f03e4de05df]
/usr/lib/swift/linux/libswiftCore.so(function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt, flags : Swift.UInt32) -> ()+0x34) [0x7f03e4de06e4]
/home/wdillon/OSUOpenCL/.build/debug/test-Package() [0x40d8da]
/home/wdillon/OSUOpenCL/.build/debug/test-Package() [0x40d125]
/home/wdillon/OSUOpenCL/.build/debug/test-Package() [0x413a32]
/usr/lib/swift/linux/libXCTest.so(+0x151e8) [0x7f03e413e1e8]
/usr/lib/swift/linux/libXCTest.so(+0x15bdf) [0x7f03e413ebdf]
/usr/lib/swift/linux/libXCTest.so(+0x14b9a) [0x7f03e413db9a]
/usr/lib/swift/linux/libXCTest.so((extension in XCTest):XCTest.XCTestCase.invokeTest () -> ()+0x176) [0x7f03e413d666]
/usr/lib/swift/linux/libXCTest.so(+0x17ab0) [0x7f03e4140ab0]
/usr/lib/swift/linux/libXCTest.so(+0x14b9a) [0x7f03e413db9a]
/usr/lib/swift/linux/libXCTest.so(XCTest.XCTMain (Swift.Array<XCTest.XCTestCase>) -> ()+0x5a) [0x7f03e41402aa]
/home/wdillon/OSUOpenCL/.build/debug/test-Package() [0x40a542]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f03e2f40ec5]
/home/wdillon/OSUOpenCL/.build/debug/test-Package() [0x40a3b9]
@hpux735
Copy link
Author

hpux735 commented Feb 24, 2016

It's failing to find the exemplar files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment