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

os: TestChmod failures with The parameter is incorrect. on Windows #58933

Open
gopherbot opened this issue Mar 8, 2023 · 4 comments
Open

os: TestChmod failures with The parameter is incorrect. on Windows #58933

gopherbot opened this issue Mar 8, 2023 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Mar 8, 2023

#!watchflakes
post <- pkg == "os" && test == "TestChmod" && `The parameter is incorrect`

Issue created automatically to collect these failures.

Example (log):

--- FAIL: TestChmod (0.00s)
    os_test.go:1278: chmod C:\Users\gopher\AppData\Local\Temp\1\_Go_TestChmod2722485006 0666: chmod C:\Users\gopher\AppData\Local\Temp\1\_Go_TestChmod2722485006: The parameter is incorrect.

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 8, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "os" && test == "TestChmod"
2023-03-07 22:05 windows-amd64-race go@99914db5 os.TestChmod (log)
--- FAIL: TestChmod (0.00s)
    os_test.go:1278: chmod C:\Users\gopher\AppData\Local\Temp\1\_Go_TestChmod2722485006 0666: chmod C:\Users\gopher\AppData\Local\Temp\1\_Go_TestChmod2722485006: The parameter is incorrect.

watchflakes

@bcmills bcmills changed the title os: TestChmod failures os: TestChmod failures with The parameter is incorrect. on Windows Mar 8, 2023
@bcmills bcmills added this to the Backlog milestone Mar 8, 2023
@bcmills
Copy link
Member

bcmills commented Mar 8, 2023

(CC @golang/windows)

@bcmills
Copy link
Member

bcmills commented Mar 8, 2023

This test was enabled on Windows in CL 250077 for #39606 (CC @iwdgo), and I marked it as safe to run in parallel in CL 458015.

It's not at all clear to me why it would fail nondeterministically, although it's curious that the one failure reported here is on the -race builder. 🤔

@alexbrainman
Copy link
Member

I just looked at the internal/poll.FD.Fchmod code again, and it does not look right to me. For example, why do we only set du.FileAttributes and not du.CreationTime and other fields here?

var du windows.FILE_BASIC_INFO
du.FileAttributes = attrs
l := uint32(unsafe.Sizeof(d))
return windows.SetFileInformationByHandle(fd.Sysfd, windows.FileBasicInfo, uintptr(unsafe.Pointer(&du)), l)

Our code appears to set CreationTime (and all time related fields) to 0. This is wrong. No?

We should extend os.TestChmod to compare file times before and after os.Chmod call.

Alex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
Status: No status
Development

No branches or pull requests

3 participants