hodlinator
commented at 3:48 PM on March 25, 2025:
contributor
Been debugging this, and I suspect the issue is down to unspecified/differing evaluation order. I suspect MSVC is sometimes evaluating the RHS of the ==-expression before the LHS.
Edit: Tried things like breaking out both sides into lambdas which log messages to prove evaluation order, but cannot reproduce the failure, so it seems to be specific conditions causing the evaluation order to reverse.
maflcko
commented at 4:37 PM on March 25, 2025:
member
@hodlinator Thanks! When the evaluation order isn't specified by the standard, it is unspecified. Mind submitting a fix?
l0rinc
commented at 5:48 PM on March 25, 2025:
contributor
evaluations of operands of individual operators [...] are unsequenced. [...] If a side effect on a memory location [...] is unsequenced relative to [...] a value computation using the value of any object in the same memory location [...], the behavior is undefined
It seems that because the operands of == are unsequenced, side effects can lead to undefined behavior - my bad, it didn't even occur to me that this was UB - and makes me wonder how many other cases we have, if none of the linters were complaining.
@hodlinator I can push a PR with your email - I introduced the faulure, I should fix it.
hodlinator
commented at 7:57 PM on March 25, 2025:
contributor
Since I introduced the idea to write the code like this, I'm happy to be part of resolving it. And happy to review your PR.
l0rinc referenced this in commit b1de59e896 on Mar 25, 2025
l0rinc
commented at 8:40 PM on March 25, 2025:
contributor
I have opened #32141 - but still can't fuzz properly on mac, so would appreciate if someone could run it for a few minutes (especially on Windows).
fanquake closed this on Mar 27, 2025
fanquake referenced this in commit b413b088ae on Mar 27, 2025
glozow referenced this in commit 7bc7af9951 on Mar 28, 2025
bitcoin deleted a comment on Apr 23, 2025
maflcko referenced this in commit 91fa3c6dcd on Jul 23, 2025
janus referenced this in commit 736fa83601 on Sep 7, 2025
morozow referenced this in commit 0e77e5ca5b on May 8, 2026
Kino1994 referenced this in commit cc521334f9 on Jun 28, 2026
Kino1994 referenced this in commit e74bb5dbdd on Jun 28, 2026
BigcoinBGC referenced this in commit 4cd80ff440 on Jun 30, 2026
BigcoinBGC referenced this in commit b94db8fb34 on Jun 30, 2026
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-08-11 10:51 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me