Skip to content

yosys-abc deadlocks on Ubuntu 24.04 (glibc 2.39) when invoked via pipe — works on Ubuntu 22.04 #4267

@mguthaus

Description

@mguthaus

Originally filed against The-OpenROAD-Project/yosys#28; refiling here because the issue manifests through the ORFS flow and the workaround lives in ORFS usage rather than yosys source.

Subject

[yosys / yosys-abc interaction]

Describe the bug

yosys-abc invoked by yosys through a pipe deadlocks indefinitely on Ubuntu 24.04 hosts. Yosys remains blocked in pipe_read waiting for output from abc; yosys-abc remains blocked in do_select on its stdin pipe. Both processes sit at 0% CPU. Standalone yosys-abc -s -F script.txt completes the same script in under one second, so the abc binary itself is healthy — only the pipe-driven invocation from yosys hangs.

Expected Behavior

make DESIGN_CONFIG=./designs/asap7/gcd/config.mk synth should complete normally as it does in the upstream openroad/orfs docker image (Ubuntu 22.04 inside).

Environment

  • OS (broken): Ubuntu 24.04 LTS, ldd (Ubuntu GLIBC 2.39-0ubuntu8.7) 2.39
  • Compiler: g++ 13.3.0-6ubuntu2~24.04.1
  • Yosys SHA: 6d2c445ae (Release version 0.64, The-OpenROAD-Project/yosys fork)
  • OS (working): Ubuntu 22.04 with glibc 2.35 (the openroad/orfs docker image)

The same source SHA (6d2c445ae) is used in both, so this is a runtime regression rather than a source change.

To Reproduce

# On an Ubuntu 24.04 host with a locally built tree (./build_openroad.sh --local)
source env.sh
cd flow
make DESIGN_CONFIG=./designs/asap7/gcd/config.mk synth
# → never makes it past `Executing ABC pass ... Extracting gate netlist ... to <abc-temp-dir>/input.blif`

A minimal reproducer (no make harness needed):

timeout 60 yosys -p "read_verilog flow/designs/src/gcd/gcd.v; synth -top gcd; abc -liberty flow/platforms/asap7/lib/NLDM/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz" </dev/null

Diagnosis

strace -f -e trace=read,write,pipe2,close,dup2,fork,wait4 on the hung pair shows yosys-abc reading its stdin one byte at a time (line-discipline behavior, as if isatty(0) returns true), echoing each char back to its stdout. After yosys writes the full source /tmp/yosys-abc-…/abc.script\n command and abc echoes it, both deadlock:

762992 read(0, "t", 1)                  = 1
762992 read(0, "\n", 1)                 = 1
762992 write(1, "source /tmp/yosys-abc-AaX2kh/abc"..., 39) = 39
762985 read(5, "source /tmp/yosys-abc-AaX2kh/abc"..., 1023) = 39
762985 read(5, 0x7ffd…, 1023)           = ? ERESTARTSYS    ← blocks here forever

yosys-abc then never produces any more output; yosys blocks waiting for it. 5-minute wait did not unblock. Suggests a libreadline / TTY-detection path in abc that misbehaves with glibc 2.39's pipe semantics.

Workarounds tried

  • stdbuf -i 4096 -o 4096 -e 4096 wrapper on yosys-abc: no effect.
  • Same binary works inside an Ubuntu 22.04 docker container; same docker-built binary copied onto the 24.04 host also hangs → not a build issue, a runtime/glibc issue.

Current workaround

Run make synth inside the openroad/orfs docker image (Ubuntu 22.04), then continue with locally built OpenROAD for the remaining stages on the host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions