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-5962] Segmentation fault when running binary executable compiled from LLVM bitcode on Linux #48521

Open
swift-ci opened this issue Sep 22, 2017 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5962
Radar None
Original Reporter W (JIRA User)
Type Bug

Attachment: Download

Environment

Ubuntu 14.04.3 (kernel 4.8.0)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 783dc2796b1d42c76a6f12d9cd47fc15

Issue Description:

I downloaded the prebuilt swift 4.0 and got a seg fault when running the binary executable compiled from bitcode as shown below:

$ cat hello.swift

print("Hello World")

$ swiftc hello.swift -emit-bc -o hello.bc

$ clang++ hello.bc -c -o hello.o

$ swiftc hello.o -o hello

$ ./hello

Segmentation fault (core dumped)
(The stack trace is attached)

It works fine if no bitcode file is involved here.

$ swiftc hello.swift -c -o hello.o

$ swiftc hello.o -o hello

$ ./hello

Hello World

I also encountered the same seg fault if I use the prebuilt swift 3.1.1

@swift-ci
Copy link
Collaborator Author

Comment by John Lin (JIRA)

Confirmed to be reproducible on ubuntu 16.04 and

swift-4.0-RELEASE

using swiftdocker image

https://hub.docker.com/r/swiftdocker/swift/

Can not reproduce on macos 10.12.6

xcode 9 and Apple Swift version 4.0 (swiftlang-900.0.65 clang-900.0.37)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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
Projects
None yet
Development

No branches or pull requests

1 participant