NetBSD Problem Report #36662

From martin@duskware.de  Tue Jul 17 15:20:30 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id DA3B363BA01
	for <gnats-bugs@gnats.netbsd.org>; Tue, 17 Jul 2007 15:20:30 +0000 (UTC)
Message-Id: <20070717113758.4B17663B93E@narn.NetBSD.org>
Date: Tue, 17 Jul 2007 11:37:58 +0000 (UTC)
From: srcshelton@gmail.com
Reply-To: srcshelton@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: pkgtools/pkg_install's audit_packages appears to be platform-specific
X-Send-Pr-Version: www-1.0

>Number:         36662
>Category:       pkg
>Synopsis:       pkgtools/pkg_install's audit_packages appears to be platform-specific
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    joerg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 17 15:25:00 +0000 2007
>Closed-Date:    Wed Nov 07 18:20:04 +0000 2007
>Last-Modified:  Tue Nov 13 21:10:04 +0000 2007
>Originator:     Stuart Shelton
>Release:        n/a
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30
>Description:

I've spotted two problems with pkgtools/pkg_install-20070715:

In audit_pacakges.c:

Line 44
'#include <err.h>' is no good on platforms which lack err.h
Correcting this to '#include <nbcompat/err.h>' works.

Line 771
't_pvfile = pvstat.st_ctimespec.tv_sec;' is odd, because I can't find any stat() implementation which returns a 'st_ctimespec' struct (this seems to be entirely *BSD specific)!  Changing this to 't_pvfile = pvstat.st_ctime;' allows the code to compile - but I'm not sure it will do what the author intended.

Further bugs in audit_packages:

Currently, 'pkg-vulnerabilities' is downloaded to '/usr/bsd/src/distfiles/'.  Even if I pass the '-K' flag to audit_packages, it only appears to look in '/usr/bsd/var/db/pkg/'.

If I use the '-v' flag, the output is:
"/usr/bsd/var/db/pkg/pkg-vulnerabilities more than a week old, continuing...
audit-packages: Unable to open: /usr/bsd/var/db/pkg/pkg-vulnerabilities"
... so the code (admittedly, affected by the about change) is calling stat() on a file which doesn't exist before checking if it exists.

If I use '-vv' then I always get:
"Reading settings from: /usr/bsd/etc/audit-packages.conf
debug2: Using PKGDB_DIR: /usr/bsd/var/db/pkg
debug2: Using pkg-vulnerabilities file: /usr/bsd/var/db/pkg/pkg-vulnerabilities
debug2: Using verify tool: /usr/bsd/bin/gpg
debug2: Using ignore directives: Segmentation fault (core dumped)"
... upon which dbx says:
"Core from signal SIGSEGV: Segmentation violation
(dbx) where
>  0 strlen(0x0, 0x2, 0xfb55d08, 0xfb55d10, 0xfb4fbc8, 0x0, 0x1, 0x0) ["/xlv52/patches/7143/work/irix/lib/libc/libc_n32_M4/strings/strlen.s":58, 0xfa43040]
   1 _doprnt_s(0x1, 0xfb4fbe8, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0) ["/xlv52/patches/7143/work/irix/lib/libc/libc_n32_M4/print/inline_doprnt.c":486, 0xfaac360]
   2 <Unknown>() [< unknown >, 0x10004b34]"

This appears to be because IRIX' libc (in common with some other UNIX platforms?) can't seem to handle a NULL argument to *printf().

The fix would appear to be to insert 'if (ignore != NULL)' before line 311.

Finally, running download-vulnerability-list results in audit-packages dying with a Bus Error on lines 172 and 173.

Running this through a debugger, the fault occurs on line 702 of libnbcompat's sha2.c in the function SHA512_Transform

audit-packages from pkg_install-20070416 works perfectly.
>How-To-Repeat:

Attempt to install pkg_install-20070715, attempt to compile on non-NetBSD platform; attempt to use audit-packages.
>Fix:

Reverting to pkg_install-20070416 seems to be the best fix - this compiles cleanly first-time, and audit-packages works just fine and doesn't segfault.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->adrianp
Responsible-Changed-By: adrianp@netbsd.org
Responsible-Changed-When: Tue, 17 Jul 2007 16:12:06 +0000
Responsible-Changed-Why:
This is mine.


Responsible-Changed-From-To: adrianp->joerg
Responsible-Changed-By: joerg@netbsd.org
Responsible-Changed-When: Wed, 18 Jul 2007 01:26:43 +0000
Responsible-Changed-Why:
I'll take care of the libnbcompat side.


From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: src/common/lib/libc/hash
Date: Wed, 18 Jul 2007 13:57:54 +0000 (UTC)

 Module Name:	src
 Committed By:	joerg
 Date:		Wed Jul 18 13:57:54 UTC 2007

 Modified Files:
 	src/common/lib/libc/hash/rmd160: rmd160.c
 	src/common/lib/libc/hash/sha2: sha2.c

 Log Message:
 Fix SIGBUS issues on strict alignment issues. Use le32dec in RMD160
 as the data pointer to RMD160_Update doesn't have to be aligned.
 In SHA256_Update and SHA512_Update, only operate directly on the passed
 in data if no left-over in the context exists and the data is correctly
 aligned. The problem was exposed by the audit-packages rewrite in C
 and reported for the libnbcompat version in PR pkg/36662.


 To generate a diff of this commit:
 cvs rdiff -r1.2 -r1.3 src/common/lib/libc/hash/rmd160/rmd160.c
 cvs rdiff -r1.4 -r1.5 src/common/lib/libc/hash/sha2/sha2.c

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

State-Changed-From-To: open->feedback
State-Changed-By: joerg@netbsd.org
State-Changed-When: Wed, 18 Jul 2007 14:10:11 +0000
State-Changed-Why:
Do you still get the trap with the fixed libnbcompat?


From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: pkgsrc/pkgtools/libnbcompat
Date: Wed, 18 Jul 2007 14:09:56 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	joerg
 Date:		Wed Jul 18 14:09:56 UTC 2007

 Modified Files:
 	pkgsrc/pkgtools/libnbcompat: Makefile
 	pkgsrc/pkgtools/libnbcompat/files: sha2.c

 Log Message:
 Fix SHA256/SHA512 to work on strict alignment platforms. This was
 exposed by the C version of audit-packages and report in PR pkg/36662.


 To generate a diff of this commit:
 cvs rdiff -r1.51 -r1.52 pkgsrc/pkgtools/libnbcompat/Makefile
 cvs rdiff -r1.6 -r1.7 pkgsrc/pkgtools/libnbcompat/files/sha2.c

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

From: "Liam J. Foy" <liamjfoy@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: [netbsd-4] src/common/lib/libc/hash
Date: Wed, 18 Jul 2007 20:20:28 +0000 (UTC)

 Module Name:	src
 Committed By:	liamjfoy
 Date:		Wed Jul 18 20:20:28 UTC 2007

 Modified Files:
 	src/common/lib/libc/hash/rmd160 [netbsd-4]: rmd160.c
 	src/common/lib/libc/hash/sha2 [netbsd-4]: sha2.c

 Log Message:
 Pull up following revision(s) (requested by joerg in ticket #776):
 	common/lib/libc/hash/sha2/sha2.c: revision 1.5
 	common/lib/libc/hash/sha2/sha2.c: revision 1.6
 	common/lib/libc/hash/rmd160/rmd160.c: revision 1.3
 Fix SIGBUS issues on strict alignment issues. Use le32dec in RMD160
 as the data pointer to RMD160_Update doesn't have to be aligned.
 In SHA256_Update and SHA512_Update, only operate directly on the passed
 in data if no left-over in the context exists and the data is correctly
 aligned. The problem was exposed by the audit-packages rewrite in C
 and reported for the libnbcompat version in PR pkg/36662.
 cast to void* to avoid a fatal warning


 To generate a diff of this commit:
 cvs rdiff -r1.2 -r1.2.4.1 src/common/lib/libc/hash/rmd160/rmd160.c
 cvs rdiff -r1.2.4.2 -r1.2.4.3 src/common/lib/libc/hash/sha2/sha2.c

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

From: Adrian Portelli <adrianp@stindustries.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 platform-specific
Date: Wed, 18 Jul 2007 23:15:00 +0100

 Hi,

 Could you please do a 'cvs update' to make sure you have all the latest
 changes and then apply the following patch:

 http://www.stindustries.net/NetBSD/stuff/pkg_install.diff

 (cd ${PREFIX} && cat pkg_install.diff | patch -p0)

 And see if this fixes your issues.

 thanks,

 adrian.

From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org, adrianp@stindustries.net
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Thu, 19 Jul 2007 17:48:07 +0100

 It's still breaking because <err.h> rather than <nbcompat/err.h> is included...

 ... and because <sys/cdefs.h> (which defines the macro __P) isn't
 being included...

 ... but, having said this, when run with "-g" it does produce a hash,
 and with "-vvv" it does show reasonable looking output - so I think
 that's cracked it.

 Cheers,

 Stuart


 On 19/07/07, Adrian Portelli <adrianp@stindustries.net> wrote:
 > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 >
 > From: Adrian Portelli <adrianp@stindustries.net>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 >  platform-specific
 > Date: Wed, 18 Jul 2007 23:15:00 +0100
 >
 >  Hi,
 >
 >  Could you please do a 'cvs update' to make sure you have all the latest
 >  changes and then apply the following patch:
 >
 >  http://www.stindustries.net/NetBSD/stuff/pkg_install.diff
 >
 >  (cd ${PREFIX} && cat pkg_install.diff | patch -p0)
 >
 >  And see if this fixes your issues.
 >
 >  thanks,
 >
 >  adrian.
 >
 >

From: Adrian Portelli <adrianp@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: pkgsrc/pkgtools/pkg_install/files
Date: Sat, 21 Jul 2007 10:21:05 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	adrianp
 Date:		Sat Jul 21 10:21:05 UTC 2007

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files: configure configure.ac
 	pkgsrc/pkgtools/pkg_install/files/audit-packages: audit-packages.c
 	    audit-packages.conf.5.in audit-packages.conf.cat5.in

 Log Message:
 Misc man page fixes
 Update to autoconf 2.61
 Add checks for AC_TYPE_UINT{8,16,32,64}_T
 Add checks for stdint.h
 Change how config file notification works
 If no IGNORE_URLS directive is found then just say that
 Check that pkg-vulnerabilities exists before we try any operations on it
 Use st_ctime as opposed to st_ctimespec.tv_sec as the former is SUSv3
 This update should fix PR #36655 and go part way to fixing PR #36662

 Thanks to tnn@ and joerg@ for suggested fixes and Yakovetsky Vladimir and
  Stuart Shelton for testing and patches.


 To generate a diff of this commit:
 cvs rdiff -r1.21 -r1.22 pkgsrc/pkgtools/pkg_install/files/configure
 cvs rdiff -r1.19 -r1.20 pkgsrc/pkgtools/pkg_install/files/configure.ac
 cvs rdiff -r1.2 -r1.3 \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.conf.5.in \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.conf.cat5.in

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

State-Changed-From-To: feedback->open
State-Changed-By: joerg@netbsd.org
State-Changed-When: Sat, 21 Jul 2007 13:35:06 +0000
State-Changed-Why:
Problem with @gzcat@ expansion for bootstrap builds not yet fixed.


From: Adrian Portelli <adrianp@stindustries.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 platform-specific
Date: Sat, 21 Jul 2007 16:04:07 +0100

 Hi,

 Could you please do a 'cvs update' to make sure you have all the latest
 changes and then apply the following patch:

 http://www.stindustries.net/NetBSD/stuff/pkg_install.diff

 (cd ${PREFIX} && cat pkg_install.diff | patch -p0)

 This should fix the remainder of the issues in this PR.

 thanks,

 adrian.

From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 12:00:14 +0100

 Still two outstanding issues:

 * <err.h> is still being unconditionally included.  This is wrong.  It
 should be replaced with a conditional include from nbcompat/, as with
 sha2.h a few lines below.

 * There's something screwey in nbcompat/err.h, which breaks IRIX'
 cdefs.h - and cdefs.h must be included in order to get the __P macro.
 So <sys/cdefs.h> must be included *before* <nbcompat/err.h>

 Patch:

 --- audit-packages/audit-packages.c.dist        2007-07-23
 11:16:00.420162080 +0100
 +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 @@ -44,7 +44,12 @@
  #ifdef HAVE_INTTYPES_H
  #include <stdint.h>
  #endif
 +#include <sys/cdefs.h>
 +#ifdef PKGSRC
 +#include <nbcompat/err.h>
 +#else
  #include <err.h>
 +#endif
  #include <string.h>
  #include <sys/types.h>
  #include <sys/stat.h>

 Cheers,

 Stuart


 On 21/07/07, Adrian Portelli <adrianp@stindustries.net> wrote:
 > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 >
 > From: Adrian Portelli <adrianp@stindustries.net>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 >  platform-specific
 > Date: Sat, 21 Jul 2007 16:04:07 +0100
 >
 >  Hi,
 >
 >  Could you please do a 'cvs update' to make sure you have all the latest
 >  changes and then apply the following patch:
 >
 >  http://www.stindustries.net/NetBSD/stuff/pkg_install.diff
 >
 >  (cd ${PREFIX} && cat pkg_install.diff | patch -p0)
 >
 >  This should fix the remainder of the issues in this PR.
 >
 >  thanks,
 >
 >  adrian.
 >
 >

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: Stuart Shelton <srcshelton@gmail.com>
Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 13:04:36 +0200

 On Mon, Jul 23, 2007 at 12:00:14PM +0100, Stuart Shelton wrote:
 > 11:16:00.420162080 +0100
 > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100

 ... add a line to include <nbcompat.h> first please and report if that
 works.

 Joerg

From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 12:14:20 +0100

 Additionally, I have a peculiar problem with pkg_install *only*

 When I go to "bmake" any target (other than clean) for it, I get:

 netbsd@octane ~/pkgtools/pkg_install # bmake patch
 => Required installed package digest>=20010302: digest-20070703 found
 ===> _flavor-check-vulnerable [pkg_install-20070720] ===> Checking for
 vulnerabilities in pkg_install-20070720
 ===> depends-message [pkg_install-20070720] ===> Installing
 dependencies for pkg_install-20070720
 /usr/bsd/src/mk/flavor/pkg/resolve-dependencies[2]:
 PKG_DBDIR=/usr/bsd/var/db/pkg:  not found
 ERROR: [resolve-dependencies] A package matching ``digest>=20010302'' should
 ERROR:     be installed, but one cannot be found.  Perhaps there is a
 ERROR:     stale work directory for ../../pkgtools/digest?
 *** Error code 1

 Stop.
 bmake: stopped in /usr/bsd/src/pkgtools/pkg_install

 /usr/bsd/var/db/pkg is the correct directory, there is no stale work
 directory for digest, and (as the first line shows) the digest package
 is clearly installed.

 As I said, this affects no other package...

 (It looks as if the shell is trying to interpret the PKG_DBDIR
 variable as a command - but the strange thing is that after a
 seemingly variable number of attempts, with or without cleans and with
 different targets, it will eventually work.)


 On 23/07/07, Stuart Shelton <srcshelton@gmail.com> wrote:
 > Still two outstanding issues:
 >
 > * <err.h> is still being unconditionally included.  This is wrong.  It
 > should be replaced with a conditional include from nbcompat/, as with
 > sha2.h a few lines below.
 >
 > * There's something screwey in nbcompat/err.h, which breaks IRIX'
 > cdefs.h - and cdefs.h must be included in order to get the __P macro.
 > So <sys/cdefs.h> must be included *before* <nbcompat/err.h>
 >
 > Patch:
 >
 > --- audit-packages/audit-packages.c.dist        2007-07-23
 > 11:16:00.420162080 +0100
 > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 > @@ -44,7 +44,12 @@
 >  #ifdef HAVE_INTTYPES_H
 >  #include <stdint.h>
 >  #endif
 > +#include <sys/cdefs.h>
 > +#ifdef PKGSRC
 > +#include <nbcompat/err.h>
 > +#else
 >  #include <err.h>
 > +#endif
 >  #include <string.h>
 >  #include <sys/types.h>
 >  #include <sys/stat.h>
 >
 > Cheers,
 >
 > Stuart
 >
 >
 > On 21/07/07, Adrian Portelli <adrianp@stindustries.net> wrote:
 > > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 > >
 > > From: Adrian Portelli <adrianp@stindustries.net>
 > > To: gnats-bugs@NetBSD.org
 > > Cc:
 > > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 > >  platform-specific
 > > Date: Sat, 21 Jul 2007 16:04:07 +0100
 > >
 > >  Hi,
 > >
 > >  Could you please do a 'cvs update' to make sure you have all the latest
 > >  changes and then apply the following patch:
 > >
 > >  http://www.stindustries.net/NetBSD/stuff/pkg_install.diff
 > >
 > >  (cd ${PREFIX} && cat pkg_install.diff | patch -p0)
 > >
 > >  This should fix the remainder of the issues in this PR.
 > >
 > >  thanks,
 > >
 > >  adrian.
 > >
 > >
 >

From: Adrian Portelli <adrianp@stindustries.net>
To: gnats-bugs@NetBSD.org
Cc: srcshelton@gmail.com
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 platform-specific
Date: Mon, 23 Jul 2007 12:26:18 +0100

 Joerg Sonnenberger wrote:
 > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 > 
 > From: Joerg Sonnenberger <joerg@britannica.bec.de>
 > To: Stuart Shelton <srcshelton@gmail.com>
 > Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
 > 	pkgsrc-bugs@netbsd.org
 > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
 > Date: Mon, 23 Jul 2007 13:04:36 +0200
 > 
 >  On Mon, Jul 23, 2007 at 12:00:14PM +0100, Stuart Shelton wrote:
 >  > 11:16:00.420162080 +0100
 >  > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 >  
 >  ... add a line to include <nbcompat.h> first please and report if that
 >  works.
 >  
 >  Joerg
 >  

 That's exactly what the updated patch does.  Stuart, have you tested the
 updated patch I posted a few days ago on audit-packages.c v1.4 ?

 For the record the here's the patch
 [http://www.stindustries.net/NetBSD/stuff/pkg_install.diff]:

 Index: pkgtools/pkg_install/files/audit-packages/audit-packages.c
 ===================================================================
 RCS file:
 /cvsroot/pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c,v
 retrieving revision 1.3
 diff -u -r1.3 audit-packages.c
 --- pkgtools/pkg_install/files/audit-packages/audit-packages.c	21 Jul
 2007 10:21:04 -0000	1.3
 +++ pkgtools/pkg_install/files/audit-packages/audit-packages.c	21 Jul
 2007 14:44:02 -0000
 @@ -35,6 +35,7 @@
  #include "config.h"
  #endif

 +#include <nbcompat.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <limits.h>
 @@ -44,7 +45,9 @@
  #ifdef HAVE_INTTYPES_H
  #include <stdint.h>
  #endif
 -#include <err.h>
 +#ifdef HAVE_SYS_CDEFS_H
 +#include <sys/cdefs.h>
 +#endif
  #include <string.h>
  #include <sys/types.h>
  #include <sys/stat.h>

 thanks,

 adrian.

From: "Stuart Shelton" <srcshelton@gmail.com>
To: "Joerg Sonnenberger" <joerg@britannica.bec.de>
Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 12:26:18 +0100

 Yep - adding <nbcompat.h> fixes the problem of needing <sys/cdefs.h>
 (but doesn't fix the fact that <nbcompat/err.h> is the only err.h on
 the system)!

 Stuart


 On 23/07/07, Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
 > On Mon, Jul 23, 2007 at 12:00:14PM +0100, Stuart Shelton wrote:
 > > 11:16:00.420162080 +0100
 > > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 >
 > ... add a line to include <nbcompat.h> first please and report if that
 > works.
 >
 > Joerg
 >

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 14:06:47 +0200

 On Mon, Jul 23, 2007 at 11:55:03AM +0000, Stuart Shelton wrote:
 > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 > 
 > From: "Stuart Shelton" <srcshelton@gmail.com>
 > To: "Joerg Sonnenberger" <joerg@britannica.bec.de>
 > Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
 > 	pkgsrc-bugs@netbsd.org
 > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
 > Date: Mon, 23 Jul 2007 12:26:18 +0100
 > 
 >  Yep - adding <nbcompat.h> fixes the problem of needing <sys/cdefs.h>
 >  (but doesn't fix the fact that <nbcompat/err.h> is the only err.h on
 >  the system)!

 It was meant in addition to the patch changing that ;-)

 Joerg

From: Adrian Portelli <adrianp@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: pkgsrc/pkgtools/pkg_install/files/audit-packages
Date: Mon, 23 Jul 2007 12:29:33 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	adrianp
 Date:		Mon Jul 23 12:29:33 UTC 2007

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/audit-packages: audit-packages.c

 Log Message:
 Include nbcompat.h to sort out err.h
 Add a conditional include for cdefs.h
 This resolves the remainder of the issues in PR #36662
 Thanks to Stuart Shelton for testing and feedback.


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c

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

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 14:40:09 +0200

 On Mon, Jul 23, 2007 at 11:15:05AM +0000, Stuart Shelton wrote:
 >  Additionally, I have a peculiar problem with pkg_install *only*

 I'm aware of this as well. Not sure yet where it comes from.

 Joerg

From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 13:15:40 +0100

 Actually, it looks as if any target (patch, test, update, etc.) will
 *always* fail immediately after a "clean", but will work if any target
 has previous failed and no clean has been performed.  (I've just got
 too used to cleaning before attempting new builds...)

 But again, this affects this package only - any ideas?


 On 23/07/07, Stuart Shelton <srcshelton@gmail.com> wrote:
 > Additionally, I have a peculiar problem with pkg_install *only*
 >
 > When I go to "bmake" any target (other than clean) for it, I get:
 >
 > netbsd@octane ~/pkgtools/pkg_install # bmake patch
 > => Required installed package digest>=20010302: digest-20070703 found
 > ===> _flavor-check-vulnerable [pkg_install-20070720] ===> Checking for
 > vulnerabilities in pkg_install-20070720
 > ===> depends-message [pkg_install-20070720] ===> Installing
 > dependencies for pkg_install-20070720
 > /usr/bsd/src/mk/flavor/pkg/resolve-dependencies[2]:
 > PKG_DBDIR=/usr/bsd/var/db/pkg:  not found
 > ERROR: [resolve-dependencies] A package matching ``digest>=20010302'' should
 > ERROR:     be installed, but one cannot be found.  Perhaps there is a
 > ERROR:     stale work directory for ../../pkgtools/digest?
 > *** Error code 1
 >
 > Stop.
 > bmake: stopped in /usr/bsd/src/pkgtools/pkg_install
 >
 > /usr/bsd/var/db/pkg is the correct directory, there is no stale work
 > directory for digest, and (as the first line shows) the digest package
 > is clearly installed.
 >
 > As I said, this affects no other package...
 >
 > (It looks as if the shell is trying to interpret the PKG_DBDIR
 > variable as a command - but the strange thing is that after a
 > seemingly variable number of attempts, with or without cleans and with
 > different targets, it will eventually work.)
 >
 >
 > On 23/07/07, Stuart Shelton <srcshelton@gmail.com> wrote:
 > > Still two outstanding issues:
 > >
 > > * <err.h> is still being unconditionally included.  This is wrong.  It
 > > should be replaced with a conditional include from nbcompat/, as with
 > > sha2.h a few lines below.
 > >
 > > * There's something screwey in nbcompat/err.h, which breaks IRIX'
 > > cdefs.h - and cdefs.h must be included in order to get the __P macro.
 > > So <sys/cdefs.h> must be included *before* <nbcompat/err.h>
 > >
 > > Patch:
 > >
 > > --- audit-packages/audit-packages.c.dist        2007-07-23
 > > 11:16:00.420162080 +0100
 > > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 > > @@ -44,7 +44,12 @@
 > >  #ifdef HAVE_INTTYPES_H
 > >  #include <stdint.h>
 > >  #endif
 > > +#include <sys/cdefs.h>
 > > +#ifdef PKGSRC
 > > +#include <nbcompat/err.h>
 > > +#else
 > >  #include <err.h>
 > > +#endif
 > >  #include <string.h>
 > >  #include <sys/types.h>
 > >  #include <sys/stat.h>
 > >
 > > Cheers,
 > >
 > > Stuart
 > >
 > >
 > > On 21/07/07, Adrian Portelli <adrianp@stindustries.net> wrote:
 > > > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 > > >
 > > > From: Adrian Portelli <adrianp@stindustries.net>
 > > > To: gnats-bugs@NetBSD.org
 > > > Cc:
 > > > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be
 > > >  platform-specific
 > > > Date: Sat, 21 Jul 2007 16:04:07 +0100
 > > >
 > > >  Hi,
 > > >
 > > >  Could you please do a 'cvs update' to make sure you have all the latest
 > > >  changes and then apply the following patch:
 > > >
 > > >  http://www.stindustries.net/NetBSD/stuff/pkg_install.diff
 > > >
 > > >  (cd ${PREFIX} && cat pkg_install.diff | patch -p0)
 > > >
 > > >  This should fix the remainder of the issues in this PR.
 > > >
 > > >  thanks,
 > > >
 > > >  adrian.
 > > >
 > > >
 > >
 >

From: "Stuart Shelton" <srcshelton@gmail.com>
To: "Adrian Portelli" <adrianp@stindustries.net>
Cc: gnats-bugs@netbsd.org
Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
Date: Mon, 23 Jul 2007 12:55:49 +0100

 Hmm - somehow I missed that one ;)

 Thanks for the patch - I'll check that now, but I'm sure it'll fix the
 problem by the looks of it.

 Cheers,

 Stuart


 On 23/07/07, Adrian Portelli <adrianp@stindustries.net> wrote:
 > Joerg Sonnenberger wrote:
 > > The following reply was made to PR pkg/36662; it has been noted by GNATS.
 > >
 > > From: Joerg Sonnenberger <joerg@britannica.bec.de>
 > > To: Stuart Shelton <srcshelton@gmail.com>
 > > Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
 > >       pkgsrc-bugs@netbsd.org
 > > Subject: Re: pkg/36662: pkgtools/pkg_install's audit_packages appears to be platform-specific
 > > Date: Mon, 23 Jul 2007 13:04:36 +0200
 > >
 > >  On Mon, Jul 23, 2007 at 12:00:14PM +0100, Stuart Shelton wrote:
 > >  > 11:16:00.420162080 +0100
 > >  > +++ audit-packages/audit-packages.c     2007-07-23 11:49:27.043021280 +0100
 > >
 > >  ... add a line to include <nbcompat.h> first please and report if that
 > >  works.
 > >
 > >  Joerg
 > >
 >
 > That's exactly what the updated patch does.  Stuart, have you tested the
 > updated patch I posted a few days ago on audit-packages.c v1.4 ?
 >
 > For the record the here's the patch
 > [http://www.stindustries.net/NetBSD/stuff/pkg_install.diff]:
 >
 > Index: pkgtools/pkg_install/files/audit-packages/audit-packages.c
 > ===================================================================
 > RCS file:
 > /cvsroot/pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c,v
 > retrieving revision 1.3
 > diff -u -r1.3 audit-packages.c
 > --- pkgtools/pkg_install/files/audit-packages/audit-packages.c  21 Jul
 > 2007 10:21:04 -0000     1.3
 > +++ pkgtools/pkg_install/files/audit-packages/audit-packages.c  21 Jul
 > 2007 14:44:02 -0000
 > @@ -35,6 +35,7 @@
 >  #include "config.h"
 >  #endif
 >
 > +#include <nbcompat.h>
 >  #include <stdio.h>
 >  #include <stdlib.h>
 >  #include <limits.h>
 > @@ -44,7 +45,9 @@
 >  #ifdef HAVE_INTTYPES_H
 >  #include <stdint.h>
 >  #endif
 > -#include <err.h>
 > +#ifdef HAVE_SYS_CDEFS_H
 > +#include <sys/cdefs.h>
 > +#endif
 >  #include <string.h>
 >  #include <sys/types.h>
 >  #include <sys/stat.h>
 >
 > thanks,
 >
 > adrian.
 >

From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: pkgsrc/pkgtools/pkg_install/files/audit-packages
Date: Thu, 26 Jul 2007 11:27:58 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	joerg
 Date:		Thu Jul 26 11:27:58 UTC 2007

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/audit-packages: audit-packages.c

 Log Message:
 As discussed in PR 36662, the include of nbcompat.h takes care of
 the need to include sys/cdefs.h. Do include err.h if it exists
 or we are not building for pkgsrc, otherwise use nbcompat/err.h.


 To generate a diff of this commit:
 cvs rdiff -r1.5 -r1.6 \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c

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

From: Geert Hendrickx <ghen@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: [netbsd-3] src
Date: Tue, 28 Aug 2007 13:31:48 +0000 (UTC)

 Module Name:	src
 Committed By:	ghen
 Date:		Tue Aug 28 13:31:48 UTC 2007

 Modified Files:
 	src/lib/libc/hash/sha2 [netbsd-3]: sha2.c
 	src/sys/crypto/ripemd160 [netbsd-3]: rmd160.c
 	src/sys/crypto/sha2 [netbsd-3]: sha2.c

 Log Message:
 Pull up patches (requested by joerg in ticket #1812):
 	lib/libc/hash/sha2/sha2.c: patch
 	sys/crypto/ripemd160/rmd160.c: patch
 	sys/crypto/sha2/sha2.c: patch
 Fix SIGBUS issues on strict alignment issues. Use le32dec in RMD160
 as the data pointer to RMD160_Update doesn't have to be aligned.
 In SHA256_Update and SHA512_Update, only operate directly on the passed
 in data if no left-over in the context exists and the data is correctly
 aligned. The problem was exposed by the audit-packages rewrite in C
 and reported for the libnbcompat version in PR pkg/36662.
 cast to void* to avoid a fatal warning


 To generate a diff of this commit:
 cvs rdiff -r1.3.2.1 -r1.3.2.2 src/lib/libc/hash/sha2/sha2.c
 cvs rdiff -r1.3 -r1.3.16.1 src/sys/crypto/ripemd160/rmd160.c
 cvs rdiff -r1.3.2.2 -r1.3.2.3 src/sys/crypto/sha2/sha2.c

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

From: Geert Hendrickx <ghen@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: [netbsd-3-0] src
Date: Tue, 28 Aug 2007 13:32:32 +0000 (UTC)

 Module Name:	src
 Committed By:	ghen
 Date:		Tue Aug 28 13:32:32 UTC 2007

 Modified Files:
 	src/lib/libc/hash/sha2 [netbsd-3-0]: sha2.c
 	src/sys/crypto/ripemd160 [netbsd-3-0]: rmd160.c
 	src/sys/crypto/sha2 [netbsd-3-0]: sha2.c

 Log Message:
 Pull up patches (requested by joerg in ticket #1812):
 	lib/libc/hash/sha2/sha2.c: patch
 	sys/crypto/ripemd160/rmd160.c: patch
 	sys/crypto/sha2/sha2.c: patch
 Fix SIGBUS issues on strict alignment issues. Use le32dec in RMD160
 as the data pointer to RMD160_Update doesn't have to be aligned.
 In SHA256_Update and SHA512_Update, only operate directly on the passed
 in data if no left-over in the context exists and the data is correctly
 aligned. The problem was exposed by the audit-packages rewrite in C
 and reported for the libnbcompat version in PR pkg/36662.
 cast to void* to avoid a fatal warning


 To generate a diff of this commit:
 cvs rdiff -r1.3.2.1 -r1.3.2.1.2.1 src/lib/libc/hash/sha2/sha2.c
 cvs rdiff -r1.3 -r1.3.20.1 src/sys/crypto/ripemd160/rmd160.c
 cvs rdiff -r1.3.2.2 -r1.3.2.2.2.1 src/sys/crypto/sha2/sha2.c

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

From: Geert Hendrickx <ghen@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36662 CVS commit: [netbsd-3-1] src
Date: Tue, 28 Aug 2007 13:33:04 +0000 (UTC)

 Module Name:	src
 Committed By:	ghen
 Date:		Tue Aug 28 13:33:04 UTC 2007

 Modified Files:
 	src/lib/libc/hash/sha2 [netbsd-3-1]: sha2.c
 	src/sys/crypto/ripemd160 [netbsd-3-1]: rmd160.c
 	src/sys/crypto/sha2 [netbsd-3-1]: sha2.c

 Log Message:
 Pull up patches (requested by joerg in ticket #1812):
 	lib/libc/hash/sha2/sha2.c: patch
 	sys/crypto/ripemd160/rmd160.c: patch
 	sys/crypto/sha2/sha2.c: patch
 Fix SIGBUS issues on strict alignment issues. Use le32dec in RMD160
 as the data pointer to RMD160_Update doesn't have to be aligned.
 In SHA256_Update and SHA512_Update, only operate directly on the passed
 in data if no left-over in the context exists and the data is correctly
 aligned. The problem was exposed by the audit-packages rewrite in C
 and reported for the libnbcompat version in PR pkg/36662.
 cast to void* to avoid a fatal warning


 To generate a diff of this commit:
 cvs rdiff -r1.3.2.1 -r1.3.2.1.4.1 src/lib/libc/hash/sha2/sha2.c
 cvs rdiff -r1.3 -r1.3.22.1 src/sys/crypto/ripemd160/rmd160.c
 cvs rdiff -r1.3.2.2 -r1.3.2.2.4.1 src/sys/crypto/sha2/sha2.c

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

State-Changed-From-To: open->feedback
State-Changed-By: joerg@netbsd.org
State-Changed-When: Wed, 07 Nov 2007 15:22:33 +0000
State-Changed-Why:
Is any of the problems still present?


From: Stuart Shelton <srcshelton@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/36662 (pkgtools/pkg_install's audit_packages appears to be
 platform-specific)
Date: Wed, 07 Nov 2007 17:20:28 +0000

 pkg_install, in the latest release, seems to have inherited that strange
 problem whereby the build will fail immediately after a 'clean', but
 will work on the second and following attempts...

 But the problem as originally reported is now fixed, yes.

 Cheers,

 Stuart


 joerg@netbsd.org wrote:
 > Synopsis: pkgtools/pkg_install's audit_packages appears to be platform-specific
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: joerg@netbsd.org
 > State-Changed-When: Wed, 07 Nov 2007 15:22:33 +0000
 > State-Changed-Why:
 > Is any of the problems still present?
 > 
 > 
 > 
 > 

State-Changed-From-To: feedback->closed
State-Changed-By: joerg@netbsd.org
State-Changed-When: Wed, 07 Nov 2007 18:20:04 +0000
State-Changed-Why:
Build issues on IRIX fixed. Can you please fill a new PR about
the make clean; make issue with the build errors for the second
make command? Thanks.


From: Stuart Shelton <srcshelton@gmail.com>
To: joerg@NetBSD.org
Cc: gnats-bugs@NetBSD.org, pkgsrc-bugs@netbsd.org,
	gnats-admin@netbsd.org
Subject: Re: pkg/36662 (pkgtools/pkg_install's audit_packages appears to be
 platform-specific)
Date: Tue, 13 Nov 2007 20:54:26 +0000

 > Build issues on IRIX fixed. Can you please fill a new PR about
 > the make clean; make issue with the build errors for the second
 > make command? Thanks.
 > 

 My mistake - I've tried again, and the only issue with pkg_install now
 is that it doesn't detect the correct invocation of the preprocessor -
 it's the only package on my system which must be built with 'CPP="cc -E"
 bmake'.

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	srcshelton@gmail.com
Subject: Re: pkg/36662 (pkgtools/pkg_install's audit_packages appears to be
	platform-specific)
Date: Tue, 13 Nov 2007 21:53:39 +0100

 On Tue, Nov 13, 2007 at 08:55:01PM +0000, Stuart Shelton wrote:
 >  My mistake - I've tried again, and the only issue with pkg_install now
 >  is that it doesn't detect the correct invocation of the preprocessor -
 >  it's the only package on my system which must be built with 'CPP="cc -E"
 >  bmake'.

 What is the concrete error message and what is in config.log?

 Joerg

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.