Summary
Enabling LLGo's current DWARF path changes executable behavior in crypto/x509: TestOID reports that two equal OIDs compare unequal. Omitting DWARF makes the same test pass.
This is a correctness bug, not merely incomplete debug metadata, and is one reason broad builds cannot safely enable the current DWARF path by default yet.
Reproduction
Confirmed locally on native Linux/arm64 with Go 1.26.5 and the current compiler from #2120:
llgo test -ldflags=-w=false -run '^TestOID$' github.com/goplus/llgo/test/std/crypto/x509
Result:
--- FAIL: TestOID (0.00s)
x509_test.go:175: OID.Equal returned false for equal OIDs
FAIL
Control:
llgo test -ldflags=-w -run '^TestOID$' github.com/goplus/llgo/test/std/crypto/x509
Result: PASS.
The same failure appears in the Go 1.24 Linux shard of https://github.com/xgo-dev/llgo/actions/runs/29549966202, so it is not specific to the local Go 1.26 toolchain.
Analysis
-w=false currently selects more than section emission. internal/build enables ssa.GlobalDebug, disables the LLVM pass pipeline, and disables C ABI optimization before asking the linker to keep DWARF. The differential test therefore isolates the bug to the DWARF-enabled build path, but does not yet prove that the metadata nodes themselves corrupt execution.
Likely investigation split:
- independently toggle
ssa.GlobalDebug, passOpt, and cabiOptimize for this test;
- compare IR for
encoding/asn1.OID.Equal and its slice/loop operations;
- determine whether the failure is debug-mode SSA lowering, unoptimized C ABI lowering, or a pass dependency that currently masks invalid IR;
- add a smaller OID/slice equality reproducer before changing the DWARF implementation.
The ignored net/url.(*URL).setPath linkname warning appears in both failing and passing controls and is therefore not the discriminator.
Expected behavior
Debug information must not change Go program semantics. OID.Equal must return true for equal values with both -w=false and -w.
Summary
Enabling LLGo's current DWARF path changes executable behavior in
crypto/x509:TestOIDreports that two equal OIDs compare unequal. Omitting DWARF makes the same test pass.This is a correctness bug, not merely incomplete debug metadata, and is one reason broad builds cannot safely enable the current DWARF path by default yet.
Reproduction
Confirmed locally on native Linux/arm64 with Go 1.26.5 and the current compiler from #2120:
Result:
Control:
Result:
PASS.The same failure appears in the Go 1.24 Linux shard of https://github.com/xgo-dev/llgo/actions/runs/29549966202, so it is not specific to the local Go 1.26 toolchain.
Analysis
-w=falsecurrently selects more than section emission.internal/buildenablesssa.GlobalDebug, disables the LLVM pass pipeline, and disables C ABI optimization before asking the linker to keep DWARF. The differential test therefore isolates the bug to the DWARF-enabled build path, but does not yet prove that the metadata nodes themselves corrupt execution.Likely investigation split:
ssa.GlobalDebug,passOpt, andcabiOptimizefor this test;encoding/asn1.OID.Equaland its slice/loop operations;The ignored
net/url.(*URL).setPathlinkname warning appears in both failing and passing controls and is therefore not the discriminator.Expected behavior
Debug information must not change Go program semantics.
OID.Equalmust return true for equal values with both-w=falseand-w.