NetBSD Problem Report #23663

Received: (qmail 22687 invoked by uid 605); 5 Dec 2003 17:57:10 -0000
Message-Id: <200312051756.hB5HufFi011932@acad0039.act.uji.es>
Date: Fri, 5 Dec 2003 18:56:41 +0100 (CET)
From: Charlie Root <jacereda@users.sourceforge.net>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jacereda@users.sourceforge.net
To: gnats-bugs@gnats.netbsd.org
Subject: games/factor fails regression test
X-Send-Pr-Version: 3.95

>Number:         23663
>Category:       bin
>Synopsis:       games/factor fails regression test
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 05 17:58:00 +0000 2003
>Closed-Date:    Tue Jul 12 05:03:03 +0000 2016
>Last-Modified:  Tue Jul 12 05:03:03 +0000 2016
>Originator:     Jorge Acereda
>Release:        NetBSD 1.6ZF
>Organization:

>Environment:


System: NetBSD acad0039.act 1.6ZF NetBSD 1.6ZF (CENUTRIO) #6: Tue Dec 2 19:12:14 CET 2003 root@acad0039.act:/sys/arch/i386/compile/CENUTRIO i386
Architecture: i386
Machine: i386
>Description:

	When building with MKCRYPTO=no, factor can't handle bignums.
	The regression test code seems to assume it has been compiled
	with openssl.
>How-To-Repeat:

	set MKCRYPTO=no in /etc/mk.conf
	$ cd /usr/src/games/factor && make factor install
	$ cd /usr/src/regress/games/factor && make regress
	apply patch
	$ cd /usr/src/games/factor && make factor install
	$ cd /usr/src/regress/games/factor && make regress

>Fix:

My proposal:

Index: regress/games/factor/Makefile
===================================================================
RCS file: /cvsroot/src/regress/games/factor/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- regress/games/factor/Makefile	2003/08/12 03:03:20	1.1
+++ regress/games/factor/Makefile	2003/12/04 17:17:48
@@ -3,6 +3,6 @@
 NOMAN=  	# defined

 regress:
-	@ksh ${.CURDIR}/factor.sh
+	@ksh ${.CURDIR}/factor.sh ${MKCRYPTO}

 .include <bsd.prog.mk>
Index: regress/games/factor/factor.sh
===================================================================
RCS file: /cvsroot/src/regress/games/factor/factor.sh,v
retrieving revision 1.2
diff -u -r1.2 factor.sh
--- regress/games/factor/factor.sh	2003/09/30 03:29:08	1.2
+++ regress/games/factor/factor.sh	2003/12/04 17:17:48
@@ -1,4 +1,6 @@
 #!/bin/ksh
+# Usage: factor.sh <test-openssl>
+# Where <test-openssl> is "yes" for factor compiled with HAVE_OPENSSL

 function test_factor {
 	echo "Testing: \`/usr/games/factor $1\`"
@@ -14,6 +16,9 @@

 # Test overflow cases
 test_factor '8675309' '8675309: 8675309'
-test_factor '6172538568' '6172538568: 2 2 2 3 7 17 2161253'
+
+if [ $1 = "yes" ] ; then
+    test_factor '6172538568' '6172538568: 2 2 2 3 7 17 2161253'
+fi

 exit 0
>Release-Note:
>Audit-Trail:
From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: RE: bin/23663
Date: Mon, 27 Jun 2016 09:15:49 +0800 (PHT)

 The current factor program properly factors the number from the old 
 regression test:

  	# factor 6172538568
  	6172538568: 2 2 2 3 7 17 2161253
  	#

 And the program properly passes all current atf-based regression tests, 
 which includes the same example.

  	# atf-run t_factor | atf-report
  	Tests root: /usr/tests/games

  	t_factor (1/1): 2 test cases
  	    loop: [0.017136s] Passed.
  	    overflow: [0.014292s] Passed.
  	[0.031564s]

  	Summary for 1 test programs:
  	    2 passed test cases.
  	    0 failed test cases.
  	    0 expected failed test cases.
  	    0 skipped test cases.




 +------------------+--------------------------+------------------------+
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
 +------------------+--------------------------+------------------------+

Responsible-Changed-From-To: bin-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Mon, 27 Jun 2016 01:49:36 +0000
Responsible-Changed-Why:
I'll handle it.


State-Changed-From-To: open->analyzed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Mon, 27 Jun 2016 01:49:36 +0000
State-Changed-Why:
We know the problem.  will verify that it still exists, and if so I have
a fix in mind.


From: "Paul Goyette" <pgoyette@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/23663 CVS commit: src/tests/games
Date: Mon, 27 Jun 2016 05:08:18 +0000

 Module Name:	src
 Committed By:	pgoyette
 Date:		Mon Jun 27 05:08:18 UTC 2016

 Modified Files:
 	src/tests/games: t_factor.sh

 Log Message:
 Split each test into its own test case.

 For test case loop2, where there are multiple prime factors greater
 than 65535, skip the test if the program was not built with crypto
 support.  We need crypto/openssl for large factors.

 Should address PR bin/23663


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/tests/games/t_factor.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: analyzed->pending-pullups
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Mon, 27 Jun 2016 05:12:45 +0000
State-Changed-Why:
Waiting for pull-up to netbsd-7 branch.  Ticket pullup-7 #1190


State-Changed-From-To: pending-pullups->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Tue, 12 Jul 2016 05:03:03 +0000
State-Changed-Why:
Pullup request is merged with those for PR 51282, which needs more work
done.  This is fixed on head but unlikely to be fixed on the branch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.