I have installed swift3 on my ubuntu machine and when i try to execute any swift code it is giving an error Segmentation fault (core dumped), can anyone tell me what this issue is and how to fix.
Thanks. Prabu Dass R.
I have installed swift3 on my ubuntu machine and when i try to execute any swift code it is giving an error Segmentation fault (core dumped), can anyone tell me what this issue is and how to fix.
Thanks. Prabu Dass R.
I got the same issue "Segmentation fault (core dumped)" when I'm calling API built by "perfect web framework" using Swift 3 on Ubuntu 16.04 with Postgres Database.
And I've also tried to use "Swift 3.0", "Swift 3.0.1" to build the swift files for test. But none of them work until I tried "Swift 3.0.2 Preview 1" - "https://swift.org/builds/swift-3.0.2-preview-1/ubuntu1604/swift-3.0.2-PREVIEW-1/swift-3.0.2-PREVIEW-1-ubuntu16.04.tar.gz", then it worked! Share with you.
Also list the version I got for swift --version
:
Swift version 3.0.2 (swift-3.0.2-PREVIEW-1)
Target: x86_64-unknown-linux-gnu
See that you have +r for all the swift files.
For example in my case [1], I just extracted the files [2] under / and when I tried to execute the 1 + 2 example [3] inside the swift shell, there was a segmentation fault.
This fix was to add read rights for all users with:
cd /usr/lib/swift && sudo chmod -R +r *
[1] Ubuntu 16.04.1, amd64
[2] https://swift.org/download/#previews
[3] https://swift.org/getting-started/#using-the-repl