Skip to content

Commit c9e7bfa

Browse files
committed
grt: erase destroyed net from dirty set in CUGR path
GlobalRouter::removeNet only erased the net from dirty_nets_ in the FastRoute (non-CUGR) branch. When use_cugr_ is true, a net destroyed during incremental routing stayed in dirty_nets_, so updateDirtyRoutes later passed the dangling dbNet to CUGR::updateNet, which dereferenced it via Design::updateNet (db_net->getSigType()). In release builds (NDEBUG) this use-after-free is silent, so grt.incremental_deleted_net.tcl passed. With assertions enabled (coverage / RELEASEWITHASSERTS builds) the stale sig type tripped dbSigType::isSupply()'s assert(false) and aborted. Move the dirty_nets_.erase to run for both routers. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 681f0d5 commit c9e7bfa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/grt/src/GlobalRouter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4799,6 +4799,10 @@ void GlobalRouter::removeNet(odb::dbNet* db_net)
47994799
return;
48004800
}
48014801

4802+
// Drop the destroyed net from the dirty set for both routers so
4803+
// updateDirtyRoutes never dereferences a dangling dbNet.
4804+
dirty_nets_.erase(db_net);
4805+
48024806
if (use_cugr_) {
48034807
cugr_->removeNet(db_net);
48044808
} else {
@@ -4858,7 +4862,6 @@ void GlobalRouter::removeNet(odb::dbNet* db_net)
48584862
}
48594863
delete deleted_net;
48604864
db_net_map_.erase(db_net);
4861-
dirty_nets_.erase(db_net);
48624865
routes_.erase(db_net);
48634866
}
48644867
}

0 commit comments

Comments
 (0)