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

Transcript based unix:rlimits test failing on FreeBSD 13.0 amd64 #1763

Closed
krader1961 opened this issue Feb 1, 2024 · 2 comments
Closed

Transcript based unix:rlimits test failing on FreeBSD 13.0 amd64 #1763

krader1961 opened this issue Feb 1, 2024 · 2 comments

Comments

@krader1961
Copy link
Contributor

            ~> set unix:rlimits[cpu] = [&cur=[]]
            -want +got:
            @@ -1,2 +1,2 @@
            -Exception: bad value: cur in rlimit value must be number between 0 and 18446744073709551615, but is []
            +Exception: bad value: cur in rlimit value must be number between 0 and 9223372036854775807, but is []
               [tty]:1:5-21: set unix:rlimits[cpu] = [&cur=[]]
        test_transcript.go:118:
            ~> set unix:rlimits[cpu] = [&cur=1 &max=[]]
            -want +got:
            @@ -1,2 +1,2 @@
            -Exception: bad value: max in rlimit value must be number between 0 and 18446744073709551615, but is []
            +Exception: bad value: max in rlimit value must be number between 0 and 9223372036854775807, but is []
               [tty]:1:5-21: set unix:rlimits[cpu] = [&cur=1 &max=[]]
FAIL
FAIL    src.elv.sh/pkg/mods/unix        1.421s

The issue here seems to be that FreeBSD uses uint64 while other platforms use int64. Note that I get the same exception on FreeBSD prior to the recent change that introduced transcript based unit tests. The decimal value 9223372036854775807 is 0x7FFFFFFFFFFFFFFF. Which matches the definition of infinity on FreeBSD:

#define RLIM_INFINITY   ((rlim_t)(((__uint64_t)1 << 63) - 1))

Note that decimal 18446744073709551615 (the expected value) is 0xFFFFFFFFFFFFFFFF which is -1, the usual value for infinity on platforms (which is most of them) that use a signed int for these values. The old tests relied on pkg/mods/unix/rlim_t_int64.go and /pkg/modes/unix/rlim_t_uint64.go to finesse the type difference between FreeBSD and all other Unix platforms.

@krader1961
Copy link
Contributor Author

What is perplexing is why the existing FreeBSD CI environment doesn't catch this problem. Before fixing this so the test passes on my VM we should probably figure out why the existing FreeBSD CI environment didn't catch the problem.

@xiaq
Copy link
Member

xiaq commented Feb 1, 2024

It seems that a bug in Go has prevented the tests from actually running. I reported golang/go#65425.

xiaq added a commit that referenced this issue Feb 1, 2024
go test -race is not compatible with ASLR, but a current Go bug causes the test
to still appear as successful: golang/go#65425.

This commit should result in a test failure on Cirrus CI's FreeBSD runner,
because there's currently a FreeBSD-specific bug in a test case (#1763).
@xiaq xiaq closed this as completed in 4bc73cb Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants