Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2011 19:00:52 +0800 (CST)
From:      Kuang-che Wu <kcwu@kcwu.csie.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/157177: primes(1) prints non-prime for numbers > 2^32
Message-ID:  <201105191100.p4JB0qHY089201@kcwu.csie.org>
Resent-Message-ID: <201105191130.p4JBUBaH069607@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157177
>Category:       bin
>Synopsis:       primes(1) prints non-prime for numbers > 2^32
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 19 11:30:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Kuang-che Wu
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD kcwu.csie.org 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sun Oct 17 05:01:33 CST 2010 root@kcwu.csie.org:/usr/obj/amd64.amd64/usr/src/sys/DESKTOP amd64


	
>Description:
	
	primes(1) can generate prime numbers.
	However, its prime table (/usr/src/games/primes/pr_tbl.c) contains
	primes less than 2^16. And the program didn't generate more prime in
        runtime. So it can only determine prime less than 2^32.
	For numbers larger than 2^32, it may incorrect print non-prime numbers.

>How-To-Repeat:
	
	$ primes `echo 2^32 | bc -q` | xargs -n 1 factor  | grep '[0-9] '
	4295360521: 65539 65539
	4295622677: 65539 65543
	...

>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105191100.p4JB0qHY089201>