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-54] Unable to launch REPL in restricted Docker container #4656

Closed
swift-ci opened this issue Dec 4, 2015 · 9 comments
Closed

[SR-54] Unable to launch REPL in restricted Docker container #4656

swift-ci opened this issue Dec 4, 2015 · 9 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

swift-ci commented Dec 4, 2015

Previous ID SR-54
Radar None
Original Reporter kito (JIRA User)
Type Bug
Status Closed
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 40ab4aabb1b1c041cbf75cd9eb3744a5

is blocked by:

  • SR-1203 Swift interactive shell fail to load in Bash on Ubuntu on Windows

Issue Description:

On Ubuntu 15.10 when attempting to launch the REPL I get:

  1. swift
    error: failed to launch REPL process: process launch failed: 'A' packet returned an error: 8
  1. uname -a
    Linux 8389598ee941 4.2.0-16-generic [lldb] Adjust for the new class_rw_t layout. #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  1. swift -v
    Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f829)
    Target: x86_64-unknown-linux-gnu
    /opt/swift/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/lldb "--repl=-target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics"
    error: failed to launch REPL process: process launch failed: 'A' packet returned an error: 8
@swift-ci
Copy link
Author

swift-ci commented Dec 5, 2015

Comment by Stan Chang Khin Boon (JIRA)

I do have similar issue on ubuntu 14.04. This is intermittent. Some user reported having it working and some don't.

I had experience both working (on my MBP) and non working case (on digital ocean).

The following repository is the Dockerfile that can hopefully recreate the environment.

https://github.com/lxcid/docker-swift

Please use 2.2 as master is attempting to try to build from source.

@swift-ci
Copy link
Author

swift-ci commented Dec 5, 2015

Comment by Stan Chang Khin Boon (JIRA)

If you are using Docker, run your container with --privileged=true will fix the issue. Not ideal but at least we know that its related to permissions.

@swift-ci
Copy link
Author

swift-ci commented Dec 5, 2015

Comment by Stan Chang Khin Boon (JIRA)

The solution is discovered here: apple/swift-docker#9 (comment)

From docker's documentation at https://docs.docker.com/engine/reference/commandline/run/#full-container-capabilities-privileged

… by default, most potentially dangerous kernel capabilities are dropped; … However, the --privileged flag will allow it to run

It seems that the REPL requires some kernel level capabilities. Is this something we can avoid?

@swift-ci
Copy link
Author

swift-ci commented Dec 5, 2015

Comment by Kito (JIRA)

Thanks Stan. Confirmed that running privileged works around the issue.

I'm going to continue debugging to see if there is a more permanent solution.

@swift-ci
Copy link
Author

Comment by Kate Stone (JIRA)

The REPL is actually a special case of the Swift debugger for reasons elaborated on here, so kernel privileges associated with debugging processes are definitely required.

@swift-ci
Copy link
Author

Comment by Kate Stone (JIRA)

Works as expected. Debugging privileges are required for the REPL.

@swift-ci
Copy link
Author

Comment by Kate Stone (JIRA)

I've edited the title to better reflect the presumed nature of the issue and have resolved it per my comment above. Go ahead and re-open if this turns out not to be an accurate assessment.

@drewcrawford
Copy link

Could we get a better diagnostic here? The current error is

error: failed to launch REPL process: process launch failed: 'A' packet returned an error: 8

Maybe something about lacking privileges? The issue here is not clear at all from the error message.

@swift-ci
Copy link
Author

Comment by Timothy S Hawkins (JIRA)

This is the same issue you get when trying to run Swift on the "Ubuntu on windows" subsystem on windows 10. However there is no opportunity to change the kernel permissions on this version.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

2 participants