syn: acd_resynth -apply segfaults on a database resynthesized in an earlier process

Aperta Adatta ai principianti
#12,046 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@povik ci sta già lavorando.

Dal 4/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend, databases

Direzione di ricerca

Inizia individuando applySubstitution nell’implementazione di syn::acd::Resynthesis ed esamina come crea istanze e net nel blocco del database. Riproduci il caso con due processi usando i file a.tcl e b.tcl in src/syn/test; conferma che la correzione evita un SIGSEGV quando si applica la risintesi al database salvato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug syn

Describe the bug

syn::acd_resynth -apply crashes with SIGSEGV when the design was already resynthesized and saved by an
earlier OpenROAD process. Running two passes in one process works.

To reproduce (files from src/syn/test)

a.tcl, the first process:

read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_verilog gcd.v
link_design gcd
create_clock -period 0.52 [get_ports clk]
syn::acd_resynth -apply          ;# SYN-0064 applied 30 of 67 substitutions
write_db gcd-resynth.odb

b.tcl, the second process:

read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_db gcd-resynth.odb
create_clock -period 0.52 [get_ports clk]
syn::acd_resynth -apply          ;# SIGSEGV
$ openroad -no_splash -exit a.tcl   # exit 0
$ openroad -no_splash -exit b.tcl   # exit 139
#0 syn::acd::Resynthesis::resynthesize(...)
#1 _wrap_acd_resynth_cmd(...)

Cause, as read

applySubstitution names each new instance "remap" + std::to_string(made_++), and each new net
"remap_net" + .... made_ is a member that starts at 0 in every process. The database from the
first process already holds remap0, remap1, …, so dbInst::create returns nullptr on the
duplicate name, and the next line dereferences it (inst->getITerm(...)). In one process the counter
carries on from pass 1, which is why two passes there do not crash.

Suggested fix

Make the names unique against the block rather than the process: for example, advance the counter
while block->findInst(name) / block->findNet(name) finds the name. Or check the result of
dbInst::create / dbNet::create and report an error instead of crashing.

Environment: OpenROAD master b9ec64c30, Ubuntu 24.04, Bazel build.

Lingua principale
Verilog
Stelle
3.3k
Fork
1.1k
Merge medio
2g 14h
PR unite (30g)
277

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di The-OpenROAD-Project/OpenROAD

Tutte le issue di The-OpenROAD-Project/OpenROAD

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.