Skip to content

rsz: Fix UB in performEarlySizingRound - #11195

Merged
jhkim-pii merged 4 commits into
The-OpenROAD-Project:masterfrom
mikesinouye:sigill
Aug 21, 2026
Merged

rsz: Fix UB in performEarlySizingRound#11195
jhkim-pii merged 4 commits into
The-OpenROAD-Project:masterfrom
mikesinouye:sigill

Conversation

@mikesinouye

@mikesinouye mikesinouye commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

In OpenSTA when a net has no explicit set_max_fanout constraint sta_->checkFanout() returns max_fanout sta::INF, 1e30f. openroad checks (max_fanout <= 0) { max_fanout = 1e9; } which doesn't modify the 1e30f.

When passing max_fanout into performGainBuffering(..., int max_fanout), this results in int overflow (1e30 > INT_MAX), triggers UBSan.

Type of Change

  • Bug fix

Impact

Prevent ub in repair_design -pre_placement

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

…gRound

Signed-off-by: Mike Inouye <mikeinouye@google.com>
Co-authored-by: Simon Bucher <ebners@google.com>
@mikesinouye
mikesinouye requested a review from a team as a code owner August 20, 2026 20:03
@mikesinouye
mikesinouye requested a review from jhkim-pii August 20, 2026 20:03

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request moves the call to findBufferSizes() to the beginning of the RepairDesign::performEarlySizingRound function, ensuring it executes before user annotations are tracked and other processing occurs. There are no review comments, and I have no feedback to provide.

Signed-off-by: Mike Inouye <mikeinouye@google.com>
@jhkim-pii

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c52ede8043

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/rsz/src/RepairDesign.cc Outdated
Signed-off-by: Mike Inouye <mikeinouye@google.com>
Signed-off-by: Mike Inouye <mikeinouye@google.com>
@mikesinouye mikesinouye changed the title rsz: Run findBufferSizes before annotating slews in performEarlySizingRound rsz: Fix UB in performEarlySizingRound Aug 21, 2026
@jhkim-pii
jhkim-pii merged commit c76d2a2 into The-OpenROAD-Project:master Aug 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants