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: Test failed in wsl1 #63329

Open
qiulaidongfeng opened this issue Oct 2, 2023 · 2 comments
Open

syscall: Test failed in wsl1 #63329

qiulaidongfeng opened this issue Oct 2, 2023 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@qiulaidongfeng
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
tip

Does this issue reproduce with the latest release?

yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

In wsl1 Ubuntu 22.04.3 LTS

go test syscall

What did you expect to see?

Test passed.

What did you see instead?

--- FAIL: TestSCMCredentials (0.00s)
    creds_test.go:110: ReadMsgUnix flags = 0x0, want 0x40000000 (MSG_CMSG_CLOEXEC)
--- FAIL: TestPidFD (0.00s)
    exec_linux_test.go:576: can't start a process: fork/exec /tmp/go-build2291011540/b001/syscall.test: invalid argument
--- FAIL: TestSetuidEtc (0.01s)
    syscall_linux_test.go:583: [6] "Setgroups([]int{0,1,2,3})" comparison: "/proc/24624/status" got:"Groups:" want:"Groups:\t0 1 2 3" (bad) [pid=24624 file:'Name:  syscall.test
        State:  S (sleeping)
        Tgid:   24624
        Pid:    24624
        PPid:   24541
        TracerPid:      0
        Uid:    0       0       0       0
        Gid:    0       0       0       0
        FDSize: 18
        Groups:
        VmPeak: 0 kB
        VmSize: 1838804 kB
        VmLck:  0 kB
        VmHWM:  0 kB
        VmRSS:  5432 kB
        VmData: 0 kB
        VmStk:  0 kB
        VmExe:  1292 kB
        VmLib:  0 kB
        VmPTE:  0 kB
        Threads:        9
        SigQ:   0/0
        SigPnd: 0000000000000000
        ShdPnd: 0000000000000000
        SigBlk: 0000000000000000
        SigIgn: 0000000000000000
        SigCgt: 0000000000000000
        CapInh: 0000000000000000
        CapPrm: 0000001fffffffff
        CapEff: 0000001fffffffff
        CapBnd: 0000001fffffffff
        Cpus_allowed:   f
        Cpus_allowed_list:      0-3
        Mems_allowed:   1
        Mems_allowed_list:      0
        voluntary_ctxt_switches:        150
        nonvoluntary_ctxt_switches:     545
        ' Pid:  24624]
    syscall_linux_test.go:583: [8] "Setgroups([]int{0})" comparison: "/proc/24624/status" got:"Groups:" want:"Groups:\t0" (bad) [pid=24624 file:'Name:      syscall.test
        State:  S (sleeping)
        Tgid:   24624
        Pid:    24624
        PPid:   24541
        TracerPid:      0
        Uid:    0       0       0       0
        Gid:    0       0       0       0
        FDSize: 18
        Groups:
        VmPeak: 0 kB
        VmSize: 1838804 kB
        VmLck:  0 kB
        VmHWM:  0 kB
        VmRSS:  5528 kB
        VmData: 0 kB
        VmStk:  0 kB
        VmExe:  1292 kB
        VmLib:  0 kB
        VmPTE:  0 kB
        Threads:        9
        SigQ:   0/0
        SigPnd: 0000000000000000
        ShdPnd: 0000000000000000
        SigBlk: 0000000000000000
        SigIgn: 0000000000000000
        SigCgt: 0000000000000000
        CapInh: 0000000000000000
        CapPrm: 0000001fffffffff
        CapEff: 0000001fffffffff
        CapBnd: 0000001fffffffff
        Cpus_allowed:   f
        Cpus_allowed_list:      0-3
        Mems_allowed:   1
        Mems_allowed_list:      0
        voluntary_ctxt_switches:        150
        nonvoluntary_ctxt_switches:     545
        ' Pid:  24624]
--- FAIL: TestFcntlFlock (0.03s)
    syscall_unix_test.go:107: child process: "--- FAIL: TestFcntlFlock (0.00s)\n    syscall_unix_test.go:124: FcntlFlock got {1 0 [0 0 0 0] 0 4294967296 0 [0 0 0 0]}, want {1 0 [0 0 0 0] 31415 271828 24624 [0 0 0 0]}\nFAIL\n", exit status 1
FAIL
FAIL    syscall 5.177s

@prattmic prattmic added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 3, 2023
@prattmic
Copy link
Member

prattmic commented Oct 3, 2023

WSL1 uses system call emulation, so I suspect that these are cases where WSL1 is simply not faithly emulating the system calls (e.g., it looks like their /proc/PID/status simply doesn't implement the "Groups" field).

We have a WSL builder, but I believe it is WSL2, so we don't see WSL1 failures.

cc @golang/windows

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 9, 2023
@mknyszek mknyszek added this to the Backlog milestone Oct 11, 2023
@mknyszek
Copy link
Contributor

We discussed this issue in triage, but we're not really sure what the right path forward is since we don't have a defined policy for WSL1 vs. WSL2. I filed #63503 to try and figure that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

4 participants