google / google/nftables

Test failures on s390x: endianness problems?

Open
#210 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

In addition to the hopefully easy 32-bit issue (#209), I'm wondering whether big endian systems might be entirely busted. That's hard to say for sure since s390x is the only one big endian system available on the https://ci.debian.net/ infrastructure…

I'll just quote one occurrence:

```
=== RUN TestConfigureNAT
nftables_test.go:313: message 2: got -- want
02 00 00 00 -- 02 00 00 00
! 00 08 00 01 -- 08 00 01 00
6e 61 74 00 -- 6e 61 74 00
! 00 08 00 02 -- 08 00 02 00
00 00 00 00 -- 00 00 00 00
--
```

In `!` lines, see how byte pairs are swapped. There are many more occurrences of this issue.

Here's an apparently different issue, but maybe that's the same reason (with the length being misread due to swapped bytes):

```
=== RUN TestGetRules
nftables_test.go:831: message 0: got -- want
02 00 00 00 -- 02 00 00 00
! 00 0b 00 01 -- 0b 00 01 00
66 69 6c 74 -- 66 69 6c 74
65 72 00 00 -- 65 72 00 00
! 00 0a 00 02 -- 0a 00 02 00
69 6e 70 75 -- 69 6e 70 75
74 00 00 00 -- 74 00 00 00
--
nftables_test.go:853: invalid attribute; length too short or too large
--- FAIL: TestGetRules (0.00s)
```

and another one (might also be due to swapped bytes):

```
=== RUN TestListChains
nftables_test.go:1550: error returned from TestDial unexpected header type: got unknown(0), want unknown(2563)
--- FAIL: TestListChains (0.00s)
```

There's a final issue that looks like bytes are getting stashed in the wrong direction, and not just swapped:

```
=== RUN TestOtherTypes
binaryutil_test.go:136: PutInt32 failure, expected: []byte{0x78, 0x56, 0x34, 0x12}, got: []byte{0x12, 0x34, 0x56, 0x78}
--- FAIL: TestOtherTypes (0.00s)
FAIL
```

The full log is available at: https://ci.debian.net/data/autopkgtest/testing/s390x/g/golang-github-google-nftables/29113914/log.gz and I'm attaching it for reference.
[golang-github-google-nftables_s390x_29113914.log](https://github.com/google/nftables/files/10198919/golang-github-google-nftables_s390x_29113914.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.