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

[SR-4429] Linux: segfault when storing @convention(block) functions #47006

Open
swift-ci opened this issue Mar 30, 2017 · 5 comments
Open

[SR-4429] Linux: segfault when storing @convention(block) functions #47006

swift-ci opened this issue Mar 30, 2017 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software Linux Platform: Linux run-time crash Bug → crash: Swift code crashed during execution runtime The Swift Runtime

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-4429
Radar None
Original Reporter jberkel (JIRA User)
Type Bug
Environment

Ubuntu 16.04, Swift 3.1

$ swiftc -version
Swift version 3.1 (swift-3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
$ uname -a
Linux tbuntu 4.4.0-59-generic #​80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Linux, RunTimeCrash, Runtime
Assignee None
Priority Medium

md5: 3f0022818fa972b721701158b4dc15f0

Issue Description:

test.swift:

let f: @convention(block) () -> () = {}
let functions = [ f ]

compile & run:

$ swiftc test.swift -ldispatch && lldb test -o run
(lldb) target create "test"
Current executable set to 'test' (x86_64).
(lldb) run
Process 3024 stopped
* thread #​1, name = 'test', stop reason = signal SIGSEGV: invalid address (fault address: 0x18b598b)
    frame #&#8203;0: 0x00007ffff7af9012 libswiftCore.so`Swift._allocateUninitializedArray <A> (Builtin.Word) -> (Swift.Array<A>, Builtin.RawPointer) + 50
libswiftCore.so`Swift._allocateUninitializedArray <A> (Builtin.Word) -> (Swift.Array<A>, Builtin.RawPointer):
->  0x7ffff7af9012 <+50>: movq   0x90(%rcx), %rdx
    0x7ffff7af9019 <+57>: movzwl %dx, %esi
    0x7ffff7af901c <+60>: addq   $0x20, %rsi
    0x7ffff7af9020 <+64>: orq    $-0x10000, %rdx
$
@belkadan
Copy link
Contributor

@jckarter, are there known issues around this?

@jckarter
Copy link
Member

Does this only affect Linux?

@jckarter
Copy link
Member

…do we even really support blocks on Linux? Works for me on Darwin, so may be a bug in the ported blocks runtime. I don't know what's being used there.

@belkadan
Copy link
Contributor

IIRC we do support blocks on Linux. SourceKit is using them.

@swift-ci
Copy link
Collaborator Author

Comment by Jan Berkel (JIRA)

This is still an issue on Swift 5.4.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software Linux Platform: Linux run-time crash Bug → crash: Swift code crashed during execution runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

4 participants