GNU bug report logs - #73474
Bug in factor utility of coreutils

Previous Next

Package: coreutils;

Reported by: Артем Насонов <anasonov <at> astralinux.ru>

Date: Wed, 25 Sep 2024 14:26:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 73474 <at> debbugs.gnu.org, anasonov <at> astralinux.ru
Subject: bug#73474: Bug in factor utility of coreutils
Date: Wed, 25 Sep 2024 21:48:50 +0100
On 25/09/2024 20:55, Paul Eggert wrote:
> On 2024-09-25 08:14, Pádraig Brady wrote:
>> It seems better to move the checks within the macro to avoid any future
>> issues.
>> I've also applied the same check to rsh2 in the attached.
> 
> That patch doesn't suffice (nor does Artem's) because the count can be
> negative. I'll take a further look at this.

Indeed. I had already added asserts just in case, and hit:

  $ src/factor 79228162514264337593543941441  factor: src/factor.c:427: mod2: Assertion `0 < cnt' failed.
  Aborted (core dumped)

Note factor does give the correct result on amd64 at least
without the asserts:

  $ factor 79228162514264337593543941441 | sed 's/.*: //; s/ /*/g' | bc
  79228162514264337593543941441

cheers,
Pádraig




This bug report was last modified 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.