Skip to content
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

Linux WIP #594

Closed
wants to merge 1 commit into from
Closed

Linux WIP #594

wants to merge 1 commit into from

Conversation

jberkel
Copy link
Collaborator

@jberkel jberkel commented Jan 17, 2017

No description provided.

@jberkel
Copy link
Collaborator Author

jberkel commented Jan 19, 2017

Most tests pass on Linux now except code calling Connection.createFunction(), which crashes in

if functions[function] == nil { self.functions[function] = [:] }
* thread #1: tid = 7842, 0x00007ffff7d0e3ee libswiftCore.so, name = 'SQLitePackageTe', stop reason = signal SIGTRAP
  * frame #0: 0x00007ffff7d0e3ee libswiftCore.so
    frame #1: 0x00007ffff7b817be libswiftCore.so`Swift._NativeDictionaryStorage.init (capacity : Swift.Int) -> Swift._NativeDictionaryStorage<A, B> + 62
    frame #2: 0x00007ffff7b756fa libswiftCore.so`Swift.Dictionary.init () -> Swift.Dictionary<A, B> + 122
    frame #3: 0x00000000005d2743 SQLitePackageTests.xctest`Connection.createFunction(function="hello", argumentCount=nil, deterministic=false, block=0x000000000049faa0 SQLitePackageTests.xctest`SQLiteTests.ConnectionTests.(test_createFunction_withArrayArguments () -> ()).(closure #1) at ConnectionTests.swift:305, self=0x00000000006ee9f0) -> Binding?) -> () + 1571 at Connection.swift:597
    frame #4: 0x000000000049f89a SQLitePackageTests.xctest`ConnectionTests.test_createFunction_withArrayArguments(self=0x00000000006ee820) -> () + 170 at ConnectionTests.swift:305
lldb) d
->  0x7ffff7d0e3ee:      nop
libswiftCore.so`swift_slowDealloc:
    0x7ffff7d0e3f0 <+0>: jmp    0x7ffff7b085b0            ; symbol stub for: free
    0x7ffff7d0e3f5:      nopl   (%rax)
    0x7ffff7d0e3f8:      nopl   (%rax,%rax)
libswiftCore.so`swift_allocObject:
    0x7ffff7d0e400 <+0>: movq   0xb17c1(%rip), %rax       ; _swift_allocObject
    0x7ffff7d0e407 <+7>: jmpq   *%rax

@jberkel
Copy link
Collaborator Author

jberkel commented Jan 20, 2017

Looks like an incompatibility with the blocks runtime, the following snippet crashes on Linux but not on OSX:

typealias Function = @convention(block) (OpaquePointer) -> Void
var functions = [Int: Function]()
functions[0] = { _ in }
$ swiftc test.swift -lBlocksRuntime && ./test
Segmentation fault (core dumped)

@zmeyc any ideas?

@jberkel
Copy link
Collaborator Author

jberkel commented Mar 30, 2017

Newer version of Swift now embeds blocks runtime, but still fails:

typealias Function = @convention(block) (OpaquePointer) -> Void
var functions = [Int: Function]()
functions[0] = { _ in }
$ swiftc --version
Swift version 3.1 (swift-3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
$ swiftc test.swift -ldispatch && ./test
Segmentation fault (core dumped)

SR-4429

@jberkel
Copy link
Collaborator Author

jberkel commented Sep 27, 2017

bc00519

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.

1 participant