From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 14 19:40:28 2011 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F321065691 for ; Tue, 14 Jun 2011 19:40:28 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 864418FC1A for ; Tue, 14 Jun 2011 19:40:28 +0000 (UTC) Received: by wyf23 with SMTP id 23so6484251wyf.13 for ; Tue, 14 Jun 2011 12:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tZFxiy/CJuDU1RGAZ8Du5WNgegQ/6UU9wmSTf7kmNxI=; b=eqYr3YfXzlsoQS15MKJ1i6nsRqdZpKNs/RuomUmCyp+e1tpP84k1oq19Lmc+GTFIeN 1fMPpGdtNP8uEs1bqCAFu1pL2JxyKWb/zjwr//t1Ww2k13w+6S7Er9usRSeQe/ODVkBG vsZa8a/1z7NJCISca8yH8qC7jkfYXosvf0EbY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=QO3eicPGTg5FIdIkBnXbus48xL98a+C3UUua36dzk++tUyQ6HIH+qHrV7c7dMtPIyw 0cQ1r6ik8H2BopC2qHzhM/2u20sGOE1XDeuXBSWk3RBQi0DsL5jYd/XQNMg7mcJaq4Lr 8EwrL53EYKigECioWlfwxLiEGuKEsnTbpRIqY= MIME-Version: 1.0 Received: by 10.227.100.219 with SMTP id z27mr1777181wbn.45.1308080427373; Tue, 14 Jun 2011 12:40:27 -0700 (PDT) Received: by 10.227.209.209 with HTTP; Tue, 14 Jun 2011 12:40:27 -0700 (PDT) In-Reply-To: <1FFD5740-1B27-4915-9521-968603FE8A8F@gmail.com> References: <201106140400.p5E40OML033995@freefall.freebsd.org> <1FFD5740-1B27-4915-9521-968603FE8A8F@gmail.com> Date: Tue, 14 Jun 2011 21:40:27 +0200 Message-ID: From: Oliver Pinter To: Robert Lorentz Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-bugs@freebsd.org" Subject: Re: bin/157177: primes(1) prints non-prime for numbers > 2^32 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 19:40:29 -0000 hi! no, the result is: op@pandora-d ~> /usr/ports/math/primegen/work/primegen-0.97/primes 4295360520 4295360522 && echo $? 0 op@pandora-d ~> uname -m -r -p && /usr/ports/math/primegen/work/primegen-0.97/primes 4295360520 4295360522 | xargs -n 1 factor 7.4-STABLE amd64 amd64 On 6/14/11, Robert Lorentz wrote: > Oliver, > >> op@pandora-d ~> uname -m -r -p && primes 4295360520 4295360522 | xargs >> -n 1 factor >> 7.4-STABLE amd64 amd64 >> 4295360521: 65539 65539 >> >>> On FreeBSD 9.0-CURRENT I debugged the source in = >>> /usr/ports/math/primegen/work/primegen-0.97 a bit and realized that if I >>> = >>> ran the compiled version in = >>> /usr/ports/math/primegen/work/primegen-0.97/primes I got the correct = >>> expected results. However, if I run the installed version in = >>> /usr/games/primes, I get the incorrect results. The binaries in those = >>> two places aren't the same (verified using md5). =20 >>> >>> This appears to be an issue with the port building, probably building in >>> = >>> 32 bit. If the inputs to primes are interpreted as 32bit then a "low" = >>> of (2^32 + 1) is interpreted as 1, therefore being less than 1000000000, >>> = >>> therefore the code would continue to generate primes, and if this is the >>> = >>> case then I wouldn't be surprised that the prime generation code also = >>> would misbehave. >>> > > If you run the built binary in the /usr/ports/math/primegen/work/../ path do > you get the same results?