The-OpenROAD-Project / OpenSTA

OpenSTA engine
GNU General Public License v3.0
404 stars 173 forks source link

crash when isConstrained uses a nullptr for a Port #141

Closed maliberty closed 1 year ago

maliberty commented 1 year ago

In

Sdc::isConstrained(const Pin *pin) const
{
  Pin *pin1 = const_cast<Pin*>(pin);
  Port *port = network_->isTopLevelPort(pin) ? network_->port(pin) : nullptr;
  return ... hasPortExtCap(port)

when port is null the call in

Sdc::hasPortExtCap(const Port *port) const
{
...    if (port_ext_cap_maps_[corner_index].hasKey(port))

leads to

PortIdLess::operator()(const Port *port1,
                      const Port *port2) const
{
  return network_->id(port1) < network_->id(port2);

where port1 is a nullptr and

ObjectId
ConcreteNetwork::id(const Port *port) const
{
  const ConcretePort *cport = reinterpret_cast<const ConcretePort*>(port);
  return cport->id();

is a seg fault. This happens during remove_buffers on microwatt. For now I'm working around it by overriding this method in dbNetwork.