Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions src/odb/src/db/dbDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,61 @@ _dbDatabase::_dbDatabase(_dbDatabase* /* unused: db */, int id)
schema_major_ = kSchemaMajor;
schema_minor_ = kSchemaMinor;
master_id_ = 0;
logger_ = nullptr;
unique_id_ = id;
dbu_per_micron_ = 0;
hierarchy_ = false;

alignment_marker_rule_tbl_ = new dbTable<_dbAlignmentMarkerRule>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

In the placement-new constructor _dbDatabase::_dbDatabase(_dbDatabase*, int id), logger_ is initialized to nullptr (at line 612). Since dbDatabase::clear() destructs the database and reconstructs it using this constructor, the database's logger becomes nullptr after clear(). Any subsequent database operation that attempts to log (which calls getLogger()) will find logger_ is nullptr and terminate the program. To prevent this, we should initialize logger_ to utl::Logger::defaultLogger() during reconstruction.

  logger_ = utl::Logger::defaultLogger();
  alignment_marker_rule_tbl_ = new dbTable<_dbAlignmentMarkerRule>(

this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbAlignmentMarkerRuleObj);
chip_tbl_ = new dbTable<_dbChip, 2>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipObj);
chip_hash_.setTable(chip_tbl_);
prop_tbl_ = new dbTable<_dbProperty>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbPropertyObj);
chip_inst_tbl_ = new dbTable<_dbChipInst>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipInstObj);
chip_region_inst_tbl_ = new dbTable<_dbChipRegionInst>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbChipRegionInstObj);
chip_conn_tbl_ = new dbTable<_dbChipConn>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipConnObj);
chip_bump_inst_tbl_
= new dbTable<_dbChipBumpInst>(this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbChipBumpInstObj);
chip_net_tbl_ = new dbTable<_dbChipNet>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbChipNetObj);
unfolded_chip_inst_tbl_ = new dbTable<_dbUnfoldedChipInst>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbUnfoldedChipInstObj);
unfolded_chip_region_inst_tbl_ = new dbTable<_dbUnfoldedChipRegionInst>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbUnfoldedChipRegionInstObj);
unfolded_chip_bump_inst_tbl_ = new dbTable<_dbUnfoldedChipBumpInst>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbUnfoldedChipBumpInstObj);
unfolded_chip_conn_tbl_ = new dbTable<_dbUnfoldedChipConn>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbUnfoldedChipConnObj);
unfolded_chip_net_tbl_ = new dbTable<_dbUnfoldedChipNet>(
this,
this,
(GetObjTbl_t) &_dbDatabase::getObjectTable,
dbUnfoldedChipNetObj);

gds_lib_tbl_ = new dbTable<_dbGDSLib, 2>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbGdsLibObj);
Expand All @@ -626,9 +674,6 @@ _dbDatabase::_dbDatabase(_dbDatabase* /* unused: db */, int id)
lib_tbl_ = new dbTable<_dbLib>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbLibObj);

prop_tbl_ = new dbTable<_dbProperty>(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable, dbPropertyObj);

name_cache_ = new _dbNameCache(
this, this, (GetObjTbl_t) &_dbDatabase::getObjectTable);

Expand Down
Loading