Skip to content

factor: Fix very-rare bug in ρ#1549

Merged
Arcterus merged 4 commits into
uutils:masterfrom
nicoonoclaste:factor/strong-pseudoprime-bug
Jun 19, 2020
Merged

factor: Fix very-rare bug in ρ#1549
Arcterus merged 4 commits into
uutils:masterfrom
nicoonoclaste:factor/strong-pseudoprime-bug

Conversation

@nicoonoclaste
Copy link
Copy Markdown
Contributor

  • Add better error message in factor::numeric::inv_mod_u64
  • Add a testcase that reliably reproduces the problem.
  • Squash the bug >:)

I introduced the problematic codepath in commit 8241037 (#1525)

The test is repeated 20 times to make it overwhelmingly-likely to fail
(the bug itself is only triggered rarely)
This bug can only be triggered when:
- the Miller-Rabin test produces a divisor `d` (rare) ;
- n / d is prime.
Comment thread src/uu/factor/src/factor.rs
@nicoonoclaste
Copy link
Copy Markdown
Contributor Author

@sylvestre Ping?

@Arcterus Arcterus merged commit f33ffc7 into uutils:master Jun 19, 2020
@nicoonoclaste nicoonoclaste deleted the factor/strong-pseudoprime-bug branch June 20, 2020 08:38
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