dft: ScanStitch::Stitch dereferences std::deque::end() on chains of 3+ cells
I maintainer di solito rispondono entro 1 giorno
@mmporong ci sta già lavorando.
Dal 26/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- testing-qa
Direzione di ricerca
Inizia in src/dft/src/stitch/ScanStitch.cpp, in corrispondenza di ScanStitch::Stitch, e segui come viene formata la deque e come vengono collegate la prima e l’ultima cella. L’issue indica src/dft/test/scan_architect_no_mix_sky130.tcl come riproduttore; eseguilo con una libreria standard hardened o con ASan per evidenziare l’accesso non valido. Il lavoro è completato quando le catene di tre o più celle vengono collegate in ordine senza dereferenziare oltre la deque, preservando l’ordine di connessione indicato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
ScanStitch::Stitch(block, scan_chain, ordinal) in src/dft/src/stitch/ScanStitch.cpp dereferences std::deque::end() when a chain has 3 or more cells, which is undefined behaviour.
The chain's cells are copied into a std::deque, the first and last are popped off, and the middle cells are walked with:
for (auto it = scan_cells.begin(); it != scan_cells.end(); ++it) {
const std::unique_ptr<ScanCell>& current = *it;
const std::unique_ptr<ScanCell>& next = *(it + 1);
next->connectScanIn(current->getScanOut());
}
On the last middle cell, it + 1 == scan_cells.end(), so next is read from past the end.
Why the regressions pass anyway: with libc++, the slot just past the end still holds the element that pop_back() removed, which is the last cell of the chain. So the read returns the last cell, and the last cell's scan-in ends up connected to the last middle cell's scan-out. Nothing else connects the last cell when there are 3+ cells; the explicit "connect the last cell" branch only runs when the middle is empty. The correct result therefore depends on the stale slot.
Reproducer: any execute_dft_plan that builds a chain of 3 or more cells, e.g. src/dft/test/scan_architect_no_mix_sky130.tcl. A hardened standard library (libc++ hardened mode, _GLIBCXX_ASSERTIONS) or ASan should flag the dereference. A different standard library, or a deque layout where that slot is no longer the popped element, could connect the wrong cell or crash.
Suggested fix: connect the cells pairwise in chain order instead of popping both ends, e.g. after connecting the first cell's scan-in, for i in 1..n: cells[i]->connectScanIn(cells[i-1]->getScanOut()), then the last cell's scan-out as today. The connections, and the order they are made in, stay what the current binary produces.
Seen at 27288f5c90 and still present on master (3c92de5213).
- Lingua principale
- Verilog
- Stelle
- 3.3k
- Fork
- 1.1k
- Merge medio
- 2g 14h
- PR unite (30g)
- 277
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di The-OpenROAD-Project/OpenROAD
-
bazel enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
The-OpenROAD-Project/OpenROAD#12160 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
odb: Bazel build fails on linux/aarch64 — char fc compared to EOF in def/lef lexersForse già presa @shivarammysore l’ha presa 4 giorni fa. Apertabazel bug odb
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
The-OpenROAD-Project/OpenROAD#12095 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
OpenRCX: extMeasure::calcRes0 segfaults on a null getRes() result when a rules file has sparse per-layer tablesForse già presa @AcKoucher l’ha presa 5 giorni fa. Apertabug rcx
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
The-OpenROAD-Project/OpenROAD#12052 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
syn: acd_resynth -apply segfaults on a database resynthesized in an earlier processForse già presa @povik l’ha presa 3 giorni fa. Apertabug syn
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
The-OpenROAD-Project/OpenROAD#12046 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
check_placement: padding check flags a legal cell above a fixed block whose bottom is in the upper half of a rowForse già presa @gudeh l’ha presa 5 giorni fa. Apertabug dpl
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
The-OpenROAD-Project/OpenROAD#12038 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di The-OpenROAD-Project/OpenROAD
Issue simili
-
book-layout.spec fails when the similar-books rail holds other projects' booksForse già presa @praetorianer777 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
praetorianer777/GoTome#373 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement priority Sales
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
I maintainer di solito rispondono entro 1 giorno
-
Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
getsentry/sentry-javascript#26203 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
code-health
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tinaudio/synth-setter#3750 ·
I maintainer di solito rispondono entro 1 giorno