Skip to content

Commit 3db98cc

Browse files
committed
Fix intermittent abort when running tests on macOS
The problem was again that tests weren't cleaning up after themselves properly, and were then breaking subsequent tests: this time, they were correctly calling `NocStorage::clear_noc`, but that was failing to clear `router_id_conversion_table`. Since `unordered_map::emplace` is used to add entries to that table, writing to an entry that's already been filled doesn't do anything, and so subsequent reads wil retrieve the data from previous tests: the retrieved IDs are then used as indices, causing out-of-bounds array accesses and an eventual crash.
1 parent 067b4a9 commit 3db98cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vpr/src/noc/noc_storage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ void NocStorage::clear_noc() {
256256
link_storage.clear();
257257
router_outgoing_links_list.clear();
258258
router_incoming_links_list.clear();
259+
router_id_conversion_table.clear();
259260
grid_location_to_router_id.clear();
260261

261262
built_noc = false;

0 commit comments

Comments
 (0)