Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the mpfr stack str bug of the deadloop in the while #657

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

FAKERINHEART
Copy link

No description provided.

@ckormanyos
Copy link
Member

Hi @FAKERINHEART thanks for looking into this. Our workflow requires approvel for first-time contributors. I've just approved your CI workflow run so let's see how the CI tests run through.

Cc: @jzmaddock

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (83d5844) to head (716eb0e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop    #657   +/-   ##
=======================================
  Coverage     94.1%   94.1%           
=======================================
  Files          279     279           
  Lines        28979   28979           
=======================================
  Hits         27253   27253           
  Misses        1726    1726           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83d5844...716eb0e. Read the comment docs.

@ckormanyos
Copy link
Member

ckormanyos commented Feb 24, 2025

Oh Also, @FAKERINHEART, do you have a test case that exercises this change to the for-loop?. That would be nice because then we could add the test case as well for the new lines.

@jzmaddock
Copy link
Collaborator

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

@ckormanyos
Copy link
Member

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

Do you mean to remove the outer while-loop at line $848$?

I agree @jzmaddock.

  • But then also remove the break; statement at line $853$ that, at the moment, breaks from the outer while-loop, right?
  • Do we need a range-check on offset + 1?

Cc: @FAKERINHEART

@FAKERINHEART
Copy link
Author

FAKERINHEART commented Feb 24, 2025

Oh Also, @FAKERINHEART, do you have a test case that exercises this change to the for-loop?. That would be nice because then we could add the test case as well for the new lines.

No, I think that it may be no needs to add a new test case. Please look into mpfr.hpp:431, and its commit log: 485fa7c. It was fixed for the mpfr_float_imp<digits10, allocate_dynamic> three years ago, but it forgot to fix mpfr_float_imp<digits10, allocate_stack> which is for this merge case. They are in the same condition, and the previous has been add tests in the 485fa7c.

@FAKERINHEART
Copy link
Author

FAKERINHEART commented Feb 24, 2025

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

Do you mean to remove the outer while-loop at line 848 ?

I agree @jzmaddock.

  • But then also remove the break; statement at line
    853
    that, at the moment, breaks from the outer while-loop, right?
  • Do we need a range-check on offset + 1?

Cc: @FAKERINHEART

If we wanna remove the whole loop, please take its effect both to mpfr_float_imp<digits10, allocate_dynamic> and mpfr_float_imp<digits10, allocate_stack>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants