From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 14 13:32:17 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 A5A3F106564A for ; Tue, 14 Jun 2011 13:32:17 +0000 (UTC) (envelope-from robert.lorentz@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 67ECF8FC0C for ; Tue, 14 Jun 2011 13:32:17 +0000 (UTC) Received: by iyj12 with SMTP id 12so6898612iyj.13 for ; Tue, 14 Jun 2011 06:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=7jnFoDeJg5plxtzxpyRNIuyCQ51KUhK9jYLW2p7AOLA=; b=GWYc/bXMLA2b3npG6o/EqXYSnocud3nZt/qEu2v6PsgRfjkJcQeK+ZDwksLd8AlO8/ L0V07QXBmLJvPrpfBhK+00IT1D3ynCHKAjVO2JQEsqXuy8Va77HiJnLe+cywoDNdRII+ KWPk7C0J/6vBm+/FFGUMm0xMwNBBi8fjksL9Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=tHYZXcQ0uEJGN/nnsHkT8U4w03e/9zqT7CbJb/99TIqGZOF9lnxui08OGAdeZXmAPZ HrBC86xvcCjudiDrROG3ompkUuKiVdORF127NsJMCAdzaPHiNI7WdXuP1A03EvdHpIl7 sKhF0AYKebAT0D6rjGj3Ywi5kuaboCsi9vIk8= Received: by 10.42.59.74 with SMTP id l10mr8417914ich.62.1308056982008; Tue, 14 Jun 2011 06:09:42 -0700 (PDT) Received: from [10.19.88.192] (mobile-198-228-227-017.mycingular.net [198.228.227.17]) by mx.google.com with ESMTPS id hp8sm5627284icc.23.2011.06.14.06.09.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2011 06:09:40 -0700 (PDT) References: <201106140400.p5E40OML033995@freefall.freebsd.org> In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <1FFD5740-1B27-4915-9521-968603FE8A8F@gmail.com> X-Mailer: iPhone Mail (9A5220p) From: Robert Lorentz Date: Tue, 14 Jun 2011 09:09:23 -0400 To: Oliver Pinter 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 13:32:17 -0000 Oliver, > op@pandora-d ~> uname -m -r -p && primes 4295360520 4295360522 | xargs > -n 1 factor > 7.4-STABLE amd64 amd64 > 4295360521: 65539 65539 >=20 >> On FreeBSD 9.0-CURRENT I debugged the source in =3D >> /usr/ports/math/primegen/work/primegen-0.97 a bit and realized that if I =3D= >> ran the compiled version in =3D >> /usr/ports/math/primegen/work/primegen-0.97/primes I got the correct =3D >> expected results. However, if I run the installed version in =3D >> /usr/games/primes, I get the incorrect results. The binaries in those =3D= >> two places aren't the same (verified using md5). =3D20 >>=20 >> This appears to be an issue with the port building, probably building in =3D= >> 32 bit. If the inputs to primes are interpreted as 32bit then a "low" =3D= >> of (2^32 + 1) is interpreted as 1, therefore being less than 1000000000, =3D= >> therefore the code would continue to generate primes, and if this is the =3D= >> case then I wouldn't be surprised that the prime generation code also =3D= >> would misbehave. >>=20 If you run the built binary in the /usr/ports/math/primegen/work/../ path do= you get the same results?=