Skip to content

proc/test: disable DWARF compression on riscv64 to work around flate hang#4376

Draft
derekparker wants to merge 5 commits into
go-delve:masterfrom
derekparker:fix-riscv64-timeouts
Draft

proc/test: disable DWARF compression on riscv64 to work around flate hang#4376
derekparker wants to merge 5 commits into
go-delve:masterfrom
derekparker:fix-riscv64-timeouts

Conversation

@derekparker

Copy link
Copy Markdown
Member

On riscv64, the Go stdlib compress/flate decompressor seems to hang in an
infinite loop when decompressing DWARF sections from test fixture binaries.

Stack trace shows the hang occurs in:
compress/flate.(*decompressor).huffSym
compress/flate.(*decompressor).huffmanBlock
compress/flate.(*decompressor).Read
debug/elf.(*File).DWARF
github.com/go-delve/delve/pkg/proc.loadBinaryInfoElf

The goroutine is stuck in huffSym's infinite loop trying to decode a
Huffman-encoded symbol. This suggests either:

  1. The Go linker on riscv64 generates corrupted compressed DWARF data
  2. There's a bug in the flate decompressor on riscv64
  3. Something else yet unidentified

Workaround: disable DWARF compression for all test fixtures built on
riscv64 by adding -ldflags=-compressdwarf=false. This allows tests to
run successfully by avoiding the decompression code path entirely.

This is fine for now as riscv64 is still an experimental arch but will need
to be resolved before promoting.

This should fix the TestVariableEvaluation, TestSetVariable, and
TestPanickyIterator2 timeouts on riscv64.

TestVariableEvaluation experiences flaky timeouts on linux/riscv64
during process initialization, similar to TestSetVariable. The test
hangs immediately after starting, before any test logic executes,
indicating a hang during the native.Launch initialization phase.

This is the same root cause as TestSetVariable - a riscv64-specific
issue with process initialization, likely in DWARF reading or
goroutine cache initialization.

Skip this test on riscv64 until the root cause can be investigated.

Fixes timeout in TestVariableEvaluation on linux/riscv64.
…hang

On riscv64, the Go 1.26.4 stdlib compress/flate decompressor hangs in an
infinite loop when decompressing DWARF sections from test fixture binaries.

Stack trace shows the hang occurs in:
  compress/flate.(*decompressor).huffSym
  compress/flate.(*decompressor).huffmanBlock
  compress/flate.(*decompressor).Read
  debug/elf.(*File).DWARF
  github.com/go-delve/delve/pkg/proc.loadBinaryInfoElf

The goroutine is stuck in huffSym's infinite loop trying to decode a
Huffman-encoded symbol. This suggests either:
1. The Go linker on riscv64 generates corrupted compressed DWARF data
2. There's a bug in the flate decompressor on riscv64

Workaround: disable DWARF compression for all test fixtures built on
riscv64 by adding -ldflags=-compressdwarf=false. This allows tests to
run successfully by avoiding the decompression code path entirely.

This should fix the TestVariableEvaluation, TestSetVariable, and
TestPanickyIterator2 timeouts on riscv64.
This reverts commit 28e0ea14dfb080eef34b61a1f1937ef7c99f86df.

The underlying issue causing the timeout is fixed by disabling DWARF
compression for riscv64 test fixtures, so the skip is no longer needed.
@derekparker derekparker force-pushed the fix-riscv64-timeouts branch from 386d146 to 88b48b9 Compare June 24, 2026 21:01

@aarzilli aarzilli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aarzilli

Copy link
Copy Markdown
Member

Ah, still marked a draft.

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