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

x/sys/unix: TestIoctlGetRTCWkAlrm "failed to perform ioctl: invalid argument" on linux-ppc64le-power9osu since August #48554

Closed
bcmills opened this issue Sep 22, 2021 · 9 comments
Labels
arch-ppc64x FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Sep 22, 2021

--- FAIL: TestIoctlGetRTCWkAlrm (0.00s)
    syscall_linux_test.go:121: failed to perform ioctl: invalid argument
FAIL
FAIL	golang.org/x/sys/unix	0.589s

Given the timing of the first recent failures, I suspect that CL 340369 may be related (CC @mdlayher , @tklauser).

If this syscall is not supported on linux-ppc64le, then the test should be skipped on that platform.

greplogs --dashboard -md -l -e 'FAIL: TestIoctlGetRTCWkAlrm'

2021-09-21T06:55:28-437939a/085c609/linux-ppc64le-power9osu
2021-09-21T06:55:28-437939a/3664950/linux-ppc64le-power9osu
2021-09-21T06:55:28-437939a/abc4f09/linux-ppc64le-power9osu
2021-09-21T06:55:28-437939a/e128749/linux-ppc64le-power9osu
2021-09-17T16:11:53-d61c044/1192135/linux-ppc64le-power9osu
2021-09-17T16:11:53-d61c044/abc4f09/linux-ppc64le-power9osu
2021-09-17T16:11:53-d61c044/b6dddac/linux-ppc64le-power9osu
2021-09-15T08:33:10-ed5796b/6d02ce8/linux-ppc64le-power9osu
2021-09-15T08:33:10-ed5796b/e79c297/linux-ppc64le-power9osu
2021-09-10T15:07:52-751e447/71adc65/linux-ppc64le-power9osu
2021-09-10T15:07:52-751e447/ee91bb8/linux-ppc64le-power9osu
2021-09-08T23:34:32-aa78b53/2481f6e/linux-ppc64le-power9osu
2021-09-08T23:34:32-aa78b53/a295b3c/linux-ppc64le-power9osu
2021-09-08T23:34:32-aa78b53/a53e3d5/linux-ppc64le-power9osu
2021-09-08T23:34:32-aa78b53/c84f3a4/linux-ppc64le-power9osu
2021-09-08T16:03:47-a851e7d/0406d3a/linux-ppc64le-power9osu
2021-09-08T16:03:47-a851e7d/c8d4fe2/linux-ppc64le-power9osu
2021-09-08T16:03:47-a851e7d/d419f9c/linux-ppc64le-power9osu
2021-09-06T17:05:28-6f6e228/9295723/linux-ppc64le-power9osu
2021-09-06T17:05:28-6f6e228/bab79dd/linux-ppc64le-power9osu
2021-09-06T17:05:28-6f6e228/da790cc/linux-ppc64le-power9osu
2021-09-03T07:17:46-97244b9/4957976/linux-ppc64le-power9osu
2021-09-03T07:17:12-2934436/ab7c904/linux-ppc64le-power9osu
2021-09-02T05:02:50-f475640/782aa42/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/1bd35fa/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/36c1717/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/6c5f028/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/711e1c8/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/c35f8a3/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/df4c625/linux-ppc64le-power9osu
2021-08-31T04:25:30-f4d4317/fcce86c/linux-ppc64le-power9osu
2021-08-23T07:06:55-63515b4/61120c6/linux-ppc64le-power9osu
2021-08-23T07:06:55-63515b4/8250141/linux-ppc64le-power9osu
2021-08-20T12:10:16-41cdb87/5d0c284/linux-ppc64le-power9osu
2021-08-20T12:10:16-41cdb87/6e50991/linux-ppc64le-power9osu
2021-08-20T12:10:16-41cdb87/c991278/linux-ppc64le-power9osu
2021-08-20T12:10:16-41cdb87/e17439e/linux-ppc64le-power9osu
2021-08-19T13:52:13-f52c844/3bdc179/linux-ppc64le-power9osu
2021-08-19T13:52:13-f52c844/9871726/linux-ppc64le-power9osu
2021-08-19T13:52:13-f52c844/e9e0d1e/linux-ppc64le-power9osu
2021-08-19T07:20:04-44f02d9/0d53084/linux-ppc64le-power9osu
2021-08-18T15:36:20-00dd8d7/0c83e01/linux-ppc64le-power9osu
2021-08-18T15:36:20-00dd8d7/687f2ac/linux-ppc64le-power9osu
2021-08-18T15:36:20-00dd8d7/8f0578e/linux-ppc64le-power9osu
2021-08-17T19:03:40-bfb29a6/0f85b0c/linux-ppc64le-power9osu
2021-08-17T19:03:40-bfb29a6/946e254/linux-ppc64le-power9osu
2021-08-17T19:03:40-bfb29a6/ec51703/linux-ppc64le-power9osu
2021-08-17T13:44:02-fefb4af/0d53084/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/1951afc/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/29ec74f/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/6406227/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/a05a7d4/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/a8d39f1/linux-ppc64le-power9osu
2021-08-16T18:31:51-1e6c022/df9c5d8/linux-ppc64le-power9osu
2021-08-16T17:40:21-fcbd12d/5c7a460/linux-ppc64le-power9osu
2021-08-16T07:42:44-15123e1/3d679c6/linux-ppc64le-power9osu
2021-08-16T07:42:44-15123e1/acbe242/linux-ppc64le-power9osu
2021-08-16T07:42:44-15123e1/c88e3ff/linux-ppc64le-power9osu
2021-08-16T07:39:13-b9628f2/7aa57a9/linux-ppc64le-power9osu
2021-08-16T07:10:09-649d0fc/0d53084/linux-ppc64le-power9osu
2021-08-09T22:24:54-d867a43/48dfddb/linux-ppc64le-power9osu
2021-08-09T22:24:54-d867a43/89a4f99/linux-ppc64le-power9osu
2021-08-09T22:24:54-d867a43/acbe242/linux-ppc64le-power9osu
2021-08-09T20:39:39-8946682/acbe242/linux-ppc64le-power9osu
2021-08-09T20:39:39-8946682/f1dce31/linux-ppc64le-power9osu
2021-08-06T18:45:41-e5e7981/70546f6/linux-ppc64le-power9osu
2021-06-30T00:52:30-0f9fa26/37c117f/linux-ppc64le-power9osu
2021-06-30T00:52:30-0f9fa26/818c5f6/linux-ppc64le-power9osu
2021-06-30T00:52:30-0f9fa26/ba93baa/linux-ppc64le-power9osu

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-ppc64x labels Sep 22, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Sep 22, 2021

This is a release-blocker for Go 1.18 via #11811.

@bcmills bcmills added this to the Go1.18 milestone Sep 22, 2021
@tklauser
Copy link
Member

--- FAIL: TestIoctlGetRTCWkAlrm (0.00s)
    syscall_linux_test.go:121: failed to perform ioctl: invalid argument
FAIL
FAIL	golang.org/x/sys/unix	0.589s

Given the timing of the first recent failures, I suspect that CL 340369 may be related (CC @mdlayher , @tklauser).

That CL changed ioctls related to ifreq, but the failing test doesn't involved such an ioctl. I suspect it's rather CL 340915 which may be related.

If this syscall is not supported on linux-ppc64le, then the test should be skipped on that platform.

AFAIK that syscall should be supported on linux-ppc64le and it previously worked without problems.

CL 340915 changed the way pointer arguments are passed to Syscall and incidentially on linux/ppc64le (and linux/ppc64), Syscall` is not implemented in assembly as on other platforms, see

https://github.com/golang/sys/blob/437939a70204d143b964abe4ee5e6662d973a384/unix/syscall_unix_gc_ppc64x.go#L14-L16

I suspect this might lead to problems considering the following in unsafe.Pointer docs:

The compiler handles a Pointer converted to a uintptr in the argument list of a call to a function implemented in assembly by arranging that the referenced allocated object, if any, is retained and not moved until the call completes, even though from the types alone it would appear that the object is no longer needed during the call.

see https://pkg.go.dev/unsafe#Pointer, point (4).

This specific implementation of Syscall and related functions for linux/ppc64{,le} was added in CL 146518 for #16662. /cc @laboger

@bcmills
Copy link
Contributor Author

bcmills commented Sep 22, 2021

The first failure in the August logs was from CL 340369, which was just before CL 340915 was merged.

@mdlayher
Copy link
Member

I'm afraid we are beyond my area of expertise here. I'm not sure how 340369 could have impacted an unrelated ioctl call which does not use ifreq under the hood.

@laboger
Copy link
Contributor

laboger commented Sep 23, 2021

We'll take a look.

@laboger
Copy link
Contributor

laboger commented Sep 23, 2021

I did a few experiments on some systems and I think this is kernel related. I didn't see any failures on power8, only power9 just
as on the dashboard. I have one power9 where I can make it fail consistently:
(4.18.0-305.3.1.el8_4.ppc64le #1 SMP Mon May 17 10:03:20 EDT 2021 ppc64le ppc64le ppc64le GNU/Linux)

and another where it passes consistently:
(4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:08:26 UTC 2020 ppc64le ppc64le ppc64le GNU/Linux)

Could there have been a kernel update on the power9 builder systems recently?

@laboger
Copy link
Contributor

laboger commented Sep 23, 2021

On the system where it fails the strace shows this:
ioctl(3, RTC_WKALM_RD, 0xc0001d4e90) = -1 EINVAL (Invalid argument)

When it passes I see this:
ioctl(3, RTC_WKALM_RD, {enabled=0, pending=0, time={tm_sec=0, tm_min=0, tm_hour=0, tm_mday=1, tm_mon=0, tm_year=70, ...}}) = 0

Almost like the first one doesn't like the pointer argument.

@pmur
Copy link
Contributor

pmur commented Sep 24, 2021

I think the rtc alarm ioctls return EINVAL if the device does not support an alarm feature. I think the generic PPC rtc driver is one such case. Should the test be ignored in these cases?

@gopherbot
Copy link

Change https://golang.org/cl/352090 mentions this issue: unix: skip TestIoctlGetRTCWkAlrm if unsupported

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-ppc64x FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants