Skip to content

Avoid undefined behavior on different widths (GCC15 bug) - #4

Merged
ladnir merged 3 commits into
ladnir:masterfrom
elimbaum:eb/defined-mod3-lanes
Nov 24, 2026
Merged

ladnir merged 3 commits into
ladnir:masterfrom
elimbaum:eb/defined-mod3-lanes

Conversation

@elimbaum

Copy link
Copy Markdown
Collaborator

Hi,

Recently while trying to debug some of our code, I came across a persistent issue where our OPRF was failing correctness tests only on certain machines (specifically, Github Ubuntu26 runners), but not others.

It turns out there is a bug in GCC15 triggered by certain kinds of aliasing across different-width data types, where the optimizer doesn't realize certain memory locations have been touched by another pointer.

This bug has been fixed in GCC, but unfortunately the compiler version present on Github ubuntu-latest runners (15.2.0) has the bug. I fixed it temporarily on my end by just downgrading to the Ubuntu 24 runners. However, it seems like this really is undefined behavior, so I am opening this PR to try to fix it. I am not super familiar with the codebase, so perhaps some of these memcpys will impose a performance penalty, but at the very least wanted to bring it to your radar in case you get stuck on a similar issue in the future.

Bug was found, and fix implemented, by Grok 4.7. Let me know if you'd like any changes. Thanks!

@elimbaum
elimbaum requested a review from ladnir November 24, 2026 20:32
@elimbaum

Copy link
Copy Markdown
Collaborator Author

I think the Ubuntu CI failure is unrelated, but it may be related insofar as those are Ubuntu 26 / GCC 15 new compiler errors.

Decode packed bit-injection updates at fixed widths and cover the sampler refill, misaligned shuffle spans, and narrow word sizes.
Keep the libOTe PPRF interface used by secure-join and fetch the cryptoTools revision with the MxCircuit include fix, corrected libdivide header, and coroutine fixes in coproto and macoro.
@ladnir
ladnir merged commit 7211d17 into ladnir:master Nov 24, 2026
2 checks passed
@elimbaum
elimbaum deleted the eb/defined-mod3-lanes branch November 25, 2026 02:51
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

Successfully merging this pull request may close these issues.

2 participants