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

syscall: linux/arm64 has Lchown but kernel doesn't implement it #11918

Closed
jefby opened this issue Jul 29, 2015 · 18 comments
Closed

syscall: linux/arm64 has Lchown but kernel doesn't implement it #11918

jefby opened this issue Jul 29, 2015 · 18 comments
Milestone

Comments

@jefby
Copy link

jefby commented Jul 29, 2015

Hello, i port the docker 1.7.1-rc3 to arm64,and it runs the command like docker pull fedora it will failed,because arm64 kernel not provides the syscall lchown, so how to insist this to run docker correctly??

ded7cd95e059: Error pulling image (latest) from fedora, ApplyLayer exit status 1 stdout:  stderr: lchown /bin: function not implemented
48ecf305d2cf: Download complete
Error pulling image (latest) from fedora, ApplyLayer exit status 1 stdout:  stderr: lchown /bin: function not implemented

in go/src/syscall directory, run like this , it will print the kernel provides the syscall:
./mksysnum_linux.pl /usr/include/asm-generic/unistd.h, there are no lchown;
and when in x86_64,it provides the lchown syscall ,and my question is how to correct it in arm64 ?

@bradfitz
Copy link
Contributor

This seems like a question for a Docker mailing list. If the kernel doesn't provide the system call and Docker is using syscall.Lchown directly, there's nothing Go can do. Perhaps we shouldn't even have that function in the syscall package for linux/arm64.

Docker should use syscall.Fchownat + AT_SYMLINK_NOFOLLOW instead I guess?

/cc @ianlancetaylor @davecheney

@bradfitz bradfitz changed the title arm64 no lchown syscall syscall: linux/arm64 has Lchown but kernel doesn't implement it Jul 29, 2015
@davecheney
Copy link
Contributor

On Wed, 29 Jul 2015 17:43 Brad Fitzpatrick notifications@github.com wrote:

This seems like a question for a Docker mailing list. If the kernel
doesn't provide the system call and Docker is using syscall.Lchown
directly, there's nothing Go can do. Perhaps we shouldn't even have that
function in the syscall package for linux/arm64.

Docker should use syscall.Fchownat + AT_SYMLINK_NOFOLLOW instead I guess?

When @aramh and I did the port to arm64 we discovered that syscalls like
lchown(2) and friends had been deprecated for close to a decade, but
because arm64 was the first architecture that did not enable the legacy
syscall flag (even ppc64 punted on this one).

I think the best solution is for docker to adopt the *at style of syscalls.
Have a look at the syscall package for Go 1.5 and you'll see most of the
legacy syscalls are implemented in terms of their newer counterparts
anyway, so there is no real loss in terms of efficiency or expressiveness.

/cc @ianlancetaylor https://github.com/ianlancetaylor @davecheney
https://github.com/davecheney


Reply to this email directly or view it on GitHub
#11918 (comment).

@bradfitz
Copy link
Contributor

@davecheney, is it your preference to move func Lchown from auto-generated in zsyscall_linux_arm64.go to a wrapper in syscall_linux_arm64.go then?

@davecheney
Copy link
Contributor

@bradfitz yes. This is probably one Aram and I missed (possibly there is no test for it in the os package). I think this can wait til 1.6, I don't want to fight Rob and Russ for it at this late stage.

@davecheney davecheney self-assigned this Jul 29, 2015
@davecheney davecheney added this to the Go1.6 milestone Jul 29, 2015
@davecheney
Copy link
Contributor

@bradfitz @jefby it's not a large change to do, but you'll have to help me convince r and rsc that it needs to land for 1.5, otherwise I'll fix it in 1.6.

@bradfitz
Copy link
Contributor

I'd support it. arm64 is experimental anyway (so low risk of breaking anything... and not like it works anyway), and Docker wants to use this. I'd just send a CL. People can R=go1.6 it if they disagree.

@jefby
Copy link
Author

jefby commented Jul 29, 2015

@davecheney Yes,i'd support it. my pleasure. I have the arm64 hardware and will quickly test it in arm64.

@davecheney
Copy link
Contributor

https://go-review.googlesource.com/12833

I'll test this tomorrow if it is not already shot down by that time. If committed I'll take care of porting this to x/syscall.

@gopherbot
Copy link

CL https://golang.org/cl/12833 mentions this issue.

@davecheney
Copy link
Contributor

@jefby could you please apply https://go-review.googlesource.com/#/c/12834/ and confirm that it does not pass on arm64.

@jefby
Copy link
Author

jefby commented Jul 29, 2015

@davecheney ok,i will try now.

@gopherbot
Copy link

CL https://golang.org/cl/12834 mentions this issue.

@jefby
Copy link
Author

jefby commented Jul 29, 2015

@davecheney great job!

Command "docker pull fedora" in arm64 runs ok, don't print the lchown error, but start docker it prints a function not implement ,i don't know whether is or not the golang syscall difference between arm64 and x86_64.

docker server infomation 👍

INFO[4737] POST /v1.19/containers/3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d/start
ERRO[4737] leaving endpoint failed: a container has already joined the endpoint
ERRO[4737] Handler for POST /containers/{name:.*}/start returned error: Cannot start container 3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d: function not implemented
ERRO[4737] HTTP Error                                    err=Cannot start container 3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d: function not implemented statusCode=500

docker client

root@huawei2p docker-work]# docker run ericvh/arm64-ubuntu
Error response from daemon: Cannot start container 128c8821ce611b1bb8c21da9fe9fade66a1506f9088e4dfb55432062f3d6543d: function not implemented

@davecheney
Copy link
Contributor

Can you run the program under strace -f and paste the relevant part?

On Wed, Jul 29, 2015 at 10:03 PM, jefby notifications@github.com wrote:

@davecheney https://github.com/davecheney great job!

Command "docker pull fedora" in arm64 runs ok, don't print the lchown
error, but start docker it prints a function not implement ,i don't know
whether is or not the golang syscall difference between arm64 and x86_64.

docker server infomation [image: 👍]

INFO[4737] POST /v1.19/containers/3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d/start
ERRO[4737] leaving endpoint failed: a container has already joined the endpoint
ERRO[4737] Handler for POST /containers/{name:.*}/start returned error: Cannot start container 3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d: function not implemented
ERRO[4737] HTTP Error err=Cannot start container 3c632d3820cdc34ef57aa9d973661fda2a9d5794def37e24774154da4eaef55d: function not implemented statusCode=500

docker client

root@huawei2p docker-work]# docker run ericvh/arm64-ubuntu
Error response from daemon: Cannot start container 128c8821ce611b1bb8c21da9fe9fade66a1506f9088e4dfb55432062f3d6543d: function not implemented


Reply to this email directly or view it on GitHub
#11918 (comment).

@bradfitz
Copy link
Contributor

Let's keep these bugs focused. Maybe move Docker porting discussions elsewhere, or file new bugs for other system calls that don't work.

I deleted the really long strace results because they made this page basically unusable and I also saw nothing useful in them either (mostly futex spam). Feel free to re-post it as a link to a gist or something hosted elsewhere if you'd like.

@jefby
Copy link
Author

jefby commented Jul 29, 2015

@bradfitz @davecheney ,docker start container-id error ,the main information is like below ,maybe the ptrace(SYSCALL) is not implement in arm64???

pid  1857] pselect6(0, NULL, NULL, NULL, {0, 20000}, 0 <unfinished ...>
[pid  1859] write(2, "Error response from daemon: Cann"..., 90Error response from daemon: Cannot start container 1c0e8a595795: function not implemented
 <unfinished ...>
[pid  1862] <... pselect6 resumed> )    = 0 (Timeout)
[pid  1859] <... write resumed> )       = 90
[pid  1862] futex(0x4820053308, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid  1857] <... pselect6 resumed> )    = 0 (Timeout)
[pid  1859] write(2, "Error: failed to start container"..., 50Error: failed to start containers: [1c0e8a595795]
 <unfinished ...>
[pid  1857] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  1859] <... write resumed> )       = 50
[pid  1857] <... clock_gettime resumed> {88750, 656200340}) = 0
[pid  1859] exit_group(1)               = ?
[pid  1857] gettimeofday( <ptrace(SYSCALL):No such process>
[pid  1859] +++ exited with 1 +++

@davecheney
Copy link
Contributor

@jefby that looks like some code tried to ptrace this child process after
it had exited. This might be an artifact of running under strace.

On Wed, 29 Jul 2015 23:50 jefby notifications@github.com wrote:

@bradfitz https://github.com/bradfitz @davecheney
https://github.com/davecheney ,docker start container-id error ,the
main information is like below ,maybe the ptrace(SYSCALL) is not implement
in arm64???

pid 1857] pselect6(0, NULL, NULL, NULL, {0, 20000}, 0 <unfinished ...>
[pid 1859] write(2, "Error response from daemon: Cann"..., 90Error response from daemon: Cannot start container 1c0e8a595795: function not implemented
<unfinished ...>
[pid 1862] <... pselect6 resumed> ) = 0 (Timeout)
[pid 1859] <... write resumed> ) = 90
[pid 1862] futex(0x4820053308, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 1857] <... pselect6 resumed> ) = 0 (Timeout)
[pid 1859] write(2, "Error: failed to start container"..., 50Error: failed to start containers: [1c0e8a595795]
<unfinished ...>
[pid 1857] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 1859] <... write resumed> ) = 50
[pid 1857] <... clock_gettime resumed> {88750, 656200340}) = 0
[pid 1859] exit_group(1) = ?
[pid 1857] gettimeofday( <ptrace(SYSCALL):No such process>
[pid 1859] +++ exited with 1 +++


Reply to this email directly or view it on GitHub
#11918 (comment).

@jefby
Copy link
Author

jefby commented Jul 30, 2015

@davecheney Thanks very much.Maybe it's the bug docker 1.7.1-rc3 ,when i upgrade it to version1.8-dev it can work now.

@jefby jefby closed this as completed Jul 30, 2015
@davecheney davecheney reopened this Jul 30, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.6 Jul 31, 2015
davecheney added a commit that referenced this issue Jul 31, 2015
Fixes #11919

Issue #11918 suggested that os.File.Chown and os.Lchown were under tested.

Change-Id: Ib41f7cb2d2fe0066d2ccb4d1bdabe1795efe80fc
Reviewed-on: https://go-review.googlesource.com/12834
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants