Skip to content

[r2r] Fix verbose logging#124622

Merged
BrzVlad merged 1 commit intodotnet:mainfrom
BrzVlad:fix-r2r-verbose
Feb 20, 2026
Merged

[r2r] Fix verbose logging#124622
BrzVlad merged 1 commit intodotnet:mainfrom
BrzVlad:fix-r2r-verbose

Conversation

@BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Feb 19, 2026

ProgressReporter receives the total number of steps in the ctor and LogProgress is expected to be called this number of times, logging the progress in steps. Doing a composite r2r with --verbose is always crashing because logging fails when total < Steps due to division by 0 _increment (some assemblies being very small). Also, for other small total values, percentages over 100 were being logged. This commit fixes the crash and also this incorrect logging.

`ProgressReporter` receives the total number of steps in the ctor and `LogProgress` is expected to be called this number of times, logging the progress in steps. Doing a composite r2r with --verbose is always crashing because logging fails when `total < Steps` due to division by 0 `_increment` (some assemblies being very small). Also, for other small `total` values, percentages over 100 were being logged. This commit fixes the crash and also this incorrect logging.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes progress reporting in CoreCLR R2R object writing when running with --verbose, preventing crashes and incorrect percentage output for small totals.

Changes:

  • Replaced the progress “increment/modulo” calculation with a step-based computation derived from current/total.
  • Ensured progress logging only advances when a new step threshold is reached, preventing >100% output and avoiding divide-by-zero from _increment == 0.

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thanks!

@BrzVlad BrzVlad merged commit 29e53cc into dotnet:main Feb 20, 2026
109 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments