You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "strophy (via GitHub)" <gi...@apache.org> on 2026/06/12 15:25:43 UTC
[PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
strophy opened a new pull request, #1194:
URL: https://github.com/apache/iceberg-go/pull/1194
https://github.com/minio/warp recently added iceberg-go as a dependency. iceberg-go encounters the following compiler error on s390x architecture (big-endian) during packaging for Alpine Linux:
```
# github.com/minio/warp
github.com/apache/iceberg-go/table/internal.newStatAgg[go.shape.bool]: runtime.staticuint64s+42100384 is not 2-byte aligned
github.com/apache/iceberg-go/table/internal.newStatAgg[go.shape.bool]: runtime.staticuint64s+42100384 is not 2-byte aligned
github.com/apache/iceberg-go.getComparator[go.shape.bool]: runtime.staticuint64s+42100384 is not 2-byte aligned
github.com/apache/iceberg-go.getComparator[go.shape.bool]: runtime.staticuint64s+42100384 is not 2-byte aligned
>>> ERROR: warp-s3: build failed
```
The issue here is instantiating the generic bool comparator on a generic zero value, resulting in an alignment bug on big-endian architecture. This fix replaces the generic zero-value comparator initialization with explicit typed comparators, allowing compilation on s390x.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "strophy (via GitHub)" <gi...@apache.org>.
strophy commented on PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194#issuecomment-4698231231
Looks good from my end, iceberg-go compiles with GOARCH=s390x from this PR branch both in isolation and as a dependency of warp. Your fix is much cleaner, thanks for your quick response here!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194#issuecomment-4693248886
Thanks for digging into this, @strophy 🙏 I pushed an alternative fix to this branch (force-pushed over your commit — the previous version is still reachable via the PR's force-push timeline). It resolves the same s390x failure but keeps the generics intact.
**Root cause** (confirmed with a local repro + upstream [golang/go#76744](https://github.com/golang/go/issues/76744)): the crash isn't in the comparator logic — it's the generic instantiation boxing a scalar *zero value* into an interface (`var z T; NewLiteral(z)` with `T = bool`). Boxing a 1-byte value makes the compiler reference `runtime.staticuint64s`, and on big-endian the resulting relocation isn't aligned the way the s390x linker requires.
**Fix:** perform `NewLiteral`'s type switch on `&val` (a pointer) instead of `val`. Pointer values take the compiler's `IsDirectIface` path and skip the `staticuint64s` optimization entirely, so the bad relocation is never emitted. Because the boxing was the only problem, everything else stays as-is:
- `getComparator` and `newStatAgg` keep their original generic bodies — no new exported API, no per-call-site comparators.
- Only `NewLiteral` in `literals.go` changes; `manifest.go`, `parquet_files.go`, and `table/internal/utils.go` are untouched.
- Behavior and allocation counts are unchanged (benchmarked bool/int64/string — identical allocs).
**Verification:** the failure reproduces on any machine with `GOOS=linux GOARCH=s390x go build ./...` (it's a link-time error, so it has to link a main package) — no s390x hardware required. Confirmed fixed, and the full test suite passes.
I also added a `cross-compile` CI job that links for **s390x** so this can't silently regress. Worth noting: s390x specifically is what catches it — I tested ppc64 (also big-endian) and its linker does *not* reject the relocation, so a ppc64 check would stay green even with the bug present.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194#issuecomment-4692675492
Hmm, is there any change we can make to the bool comparator that would let us keep the zero-value initialization?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194#issuecomment-4692774964
Hmm, thanks for the reply. I'll take a little look into this myself shortly and see what I can come up with. I'll also want to see if there's a way we can get a big-endian build into the CI so that we can prevent something like this from recurring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "laskoviymishka (via GitHub)" <gi...@apache.org>.
laskoviymishka merged PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: runtime.staticuint64s+42100384 is not 2-byte aligned on big-endian [iceberg-go]
Posted by "strophy (via GitHub)" <gi...@apache.org>.
strophy commented on PR #1194:
URL: https://github.com/apache/iceberg-go/pull/1194#issuecomment-4692737017
Hi @zeroshade thanks for the lightning-quick review! A quick disclaimer, I'm an Alpine package maintainer, not a specialist in s390x or Golang, so I'm leaning heavily on AI here and careful review (or a better solution) is needed. Apologies in advance if this is against your contibutor guidelines, this is a [genuine bug I'm hitting](https://gitlab.alpinelinux.org/strophy/aports/-/jobs/2387614) and not a drive-by slop PR. :sweat_smile:
According to Claude, there is no way to keep the zero-value initialization because:
- The failure site is the generic instantiation path, not comparator logic: it blows up at `getComparator`/`newStatAgg` specialization time, before any bool comparison executes.
- The problematic pattern is the zero-value generic conversion path in `iceberg-go/literals.go` and the former generic helper call sites in `iceberg-go/manifest.go` and `iceberg-go/table/internal/utils.go`.
- Changing the body of `BoolLiteral.Comparator` in `iceberg-go/literals.go` does not remove the monomorphization/type-assertion path that triggers the s390x alignment issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org