NetBSD Problem Report #51802

From diro@nixsyspaus.org  Sun Jan  8 23:44:27 2017
Return-Path: <diro@nixsyspaus.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6372F7A27F
	for <gnats-bugs@gnats.netbsd.org>; Sun,  8 Jan 2017 23:44:27 +0000 (UTC)
Message-Id: <20170108234424.111B82041ED@asche.nixsyspaus.org>
Date: Sun,  8 Jan 2017 23:44:23 +0000 (UTC)
From: diro@nixsyspaus.org
Reply-To: diro@nixsyspaus.org
To: gnats-bugs@gnats.netbsd.org
Subject: security/mozilla-rootcerts doesn't build with gawk
X-Send-Pr-Version: 3.95

>Number:         51802
>Category:       pkg
>Synopsis:       security/mozilla-rootcerts doesn't build with gawk
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    yyamano
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 08 23:45:00 +0000 2017
>Closed-Date:    Wed Feb 01 02:30:17 +0000 2017
>Last-Modified:  Wed Feb 01 02:30:17 +0000 2017
>Originator:     diro@nixsyspaus.org
>Release:        openSUSE Leap 42.1
>Organization:
>Environment:
System: Linux sammy 4.1.36-44-default #1 SMP PREEMPT Mon Dec 12 21:24:10
UTC 2016 (b1c0ac2) x86_64 x86_64 x86_64 GNU/Linux
Architecture: amd64
Machine: amd64
>Description:
	security/mozilla-rootcerts/files/mozilla-rootcerts.sh doesn't work
with GNU awk.
[...]
===> Extracting for mozilla-rootcerts-1.0.20160610
/bin/cp /home/rodent/pkgsrc/security/mozilla-rootcerts/files/mozilla-rootcerts.sh /home/rodent/pkgsrc/security/mozilla-rootcerts/work
/bin/cp /home/rodent/pkgsrc/distfiles/certdata-20160610.txt /home/rodent/pkgsrc/security/mozilla-rootcerts/work
===> Patching for mozilla-rootcerts-1.0.20160610
===> Creating toolchain wrappers for mozilla-rootcerts-1.0.20160610
===> Configuring for mozilla-rootcerts-1.0.20160610
=> Checking for portability problems in extracted files
=> Replacing hard-coded paths.
===> Building for mozilla-rootcerts-1.0.20160610
/bin/mkdir -p /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certs
cd /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certs &&  /bin/sh /home/rodent/pkgsrc/security/mozilla-rootcerts/work/mozilla-rootcerts.sh -f /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certdata-20160610.txt extract
mozilla-rootcert-0.pem
unable to load certificate
139806274594448:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
mozilla-rootcert-1.pem
unable to load certificate
139630471976592:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
mozilla-rootcert-2.pem
unable to load certificate
140643485718160:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
mozilla-rootcert-3.pem
unable to load certificate
140135767295632:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
awk: cmd. line:28: (FILENAME=- FNR=577) fatal: printf to "/home/rodent/pkg/bin/openssl x509 -inform der -outform pem -text >mozilla-rootcert-3.pem" failed (Broken pipe)
*** Error code 2

Stop.
bmake[1]: stopped in /home/rodent/pkgsrc/security/mozilla-rootcerts
*** Error code 1

Stop.
bmake: stopped in /home/rodent/pkgsrc/security/mozilla-rootcerts
>How-To-Repeat:
	Build security/mozilla-rootcerts on Linux
>Fix:
	(Bandage solution)

1. Install lang/nawk;
2. Add "_TOOLS_USE_PKGSRC.awk=yes" to security/mozilla-rootcerts/Makefile

Real solution is either to fix the script to work with gawk or require
nawk on Linux.

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
Date: Mon, 9 Jan 2017 18:03:21 +0000

 On Sun, Jan 08, 2017 at 11:45:00PM +0000, diro@nixsyspaus.org wrote:
  > mozilla-rootcert-0.pem
  > unable to load certificate
  > 139806274594448:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
  > mozilla-rootcert-1.pem
  > unable to load certificate
  > 139630471976592:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
  > mozilla-rootcert-2.pem
  > unable to load certificate
  > 140643485718160:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
  > mozilla-rootcert-3.pem
  > unable to load certificate
  > 140135767295632:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
  > awk: cmd. line:28: (FILENAME=- FNR=577) fatal: printf to "/home/rodent/pkg/bin/openssl x509 -inform der -outform pem -text >mozilla-rootcert-3.pem" failed (Broken pipe)
  > *** Error code 2

 What's it doing that gawk doesn't like? Not a whole lot to go on in
 the output...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Yuji Yamano <yyamano@kt.rim.or.jp>
To: gnats-bugs@NetBSD.org, diro@nixsyspaus.org
Cc: pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
Date: Thu, 26 Jan 2017 16:26:00 +0900 (JST)

 > cd /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certs &&  /bin/sh /home/rodent/pkgsrc/security/mozilla-rootcerts/work/mozilla-rootcerts.sh -f /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certdata-20160610.txt extract

 > unable to load certificate
 > 140135767295632:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
 > awk: cmd. line:28: (FILENAME=- FNR=577) fatal: printf to "/home/rodent/pkg/bin/openssl x509 -inform der -outform pem -text >mozilla-rootcert-3.pem" failed (Broken pipe)

 Do you set LC_ALL? I get similar errors with LC_ALL=en_US.UTF-8.

 % export LC_ALL=en_US.UTF-8
 % sh ../mozilla-rootcerts.sh -f ../certdata-20160610.txt  extract
 mozilla-rootcert-0.pem
 unable to load certificate
 139719110055568:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
 mozilla-rootcert-1.pem
 unable to load certificate
 140638067934864:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
 mozilla-rootcert-2.pem
 unable to load certificate
 140246152611472:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
 mozilla-rootcert-3.pem
 unable to load certificate
 139990967465616:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
 mozilla-rootcert-4.pem
 unable to load certificate
 139656006665872:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
 gawk: cmd. line:28: (FILENAME=- FNR=698) fatal: printf to "/usr/bin/openssl x509 -inform der -outform pem -text >mozilla-rootcert-4.pem" failed (Broken pipe)

 -- 
 Yuji Yamano

From: rodent@NetBSD.org
To: Yuji Yamano <yyamano@kt.rim.or.jp>
Cc: gnats-bugs@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
Date: Thu, 26 Jan 2017 18:21:21 -0500

 On Thu, Jan 26, 2017 at 04:26:00PM +0900, Yuji Yamano wrote:
 > > cd /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certs &&  /bin/sh /home/rodent/pkgsrc/security/mozilla-rootcerts/work/mozilla-rootcerts.sh -f /home/rodent/pkgsrc/security/mozilla-rootcerts/work/certdata-20160610.txt extract
 > 
 > > unable to load certificate
 > > 140135767295632:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157:
 > > awk: cmd. line:28: (FILENAME=- FNR=577) fatal: printf to "/home/rodent/pkg/bin/openssl x509 -inform der -outform pem -text >mozilla-rootcert-3.pem" failed (Broken pipe)
 > 
 > Do you set LC_ALL? I get similar errors with LC_ALL=en_US.UTF-8.
 > [...]

 rodent@sammy:~/pkgsrc/security/mozilla-rootcerts% locale
 LANG=POSIX
 LC_CTYPE="en_US.UTF-8"
 LC_NUMERIC="en_US.UTF-8"
 LC_TIME="en_US.UTF-8"
 LC_COLLATE="en_US.UTF-8"
 LC_MONETARY="en_US.UTF-8"
 LC_MESSAGES="en_US.UTF-8"
 LC_PAPER="en_US.UTF-8"
 LC_NAME="en_US.UTF-8"
 LC_ADDRESS="en_US.UTF-8"
 LC_TELEPHONE="en_US.UTF-8"
 LC_MEASUREMENT="en_US.UTF-8"
 LC_IDENTIFICATION="en_US.UTF-8"
 LC_ALL=en_US.UTF-8

 security/mozilla-rootcerts/files/mozilla-rootcerts.sh sets LANG to C. Perhaps,
 it needs to set some of the other locale envvars too?

From: Yuji Yamano <yyamano@kt.rim.or.jp>
To: rodent@NetBSD.org
Cc: gnats-bugs@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
Date: Fri, 27 Jan 2017 08:46:35 +0900 (JST)

 On Thu, 26 Jan 2017 18:21:21 -0500, rodent@NetBSD.org wrote:

 > security/mozilla-rootcerts/files/mozilla-rootcerts.sh sets LANG to C. Perhaps,
 > it needs to set some of the other locale envvars too?

 I guess you need to set LC_ALL=C. Here is code snippet from gawk's main.c:

         const char *env_lc;

         env_lc = getenv("LC_ALL");
         if (env_lc == NULL)
                 env_lc = getenv("LANG");
         if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c')
                 gawk_mb_cur_max = 1;

 -- Yuji Yamano

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	diro@nixsyspaus.org
Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
Date: Fri, 27 Jan 2017 02:39:01 +0100

 On Thu, Jan 26, 2017 at 11:50:00PM +0000, Yuji Yamano wrote:
 > The following reply was made to PR pkg/51802; it has been noted by GNATS.
 > 
 > From: Yuji Yamano <yyamano@kt.rim.or.jp>
 > To: rodent@NetBSD.org
 > Cc: gnats-bugs@NetBSD.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org
 > Subject: Re: pkg/51802: security/mozilla-rootcerts doesn't build with gawk
 > Date: Fri, 27 Jan 2017 08:46:35 +0900 (JST)
 > 
 >  On Thu, 26 Jan 2017 18:21:21 -0500, rodent@NetBSD.org wrote:
 >  
 >  > security/mozilla-rootcerts/files/mozilla-rootcerts.sh sets LANG to C. Perhaps,
 >  > it needs to set some of the other locale envvars too?
 >  
 >  I guess you need to set LC_ALL=C. Here is code snippet from gawk's main.c:
 >  
 >          const char *env_lc;
 >  
 >          env_lc = getenv("LC_ALL");
 >          if (env_lc == NULL)
 >                  env_lc = getenv("LANG");
 >          if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c')
 >                  gawk_mb_cur_max = 1;

 Seriously?! That's complete f**ked up. The correct way to query the
 locale looks different...

 Joerg

Responsible-Changed-From-To: pkg-manager->yyamano
Responsible-Changed-By: yyamano@NetBSD.org
Responsible-Changed-When: Wed, 01 Feb 2017 01:52:21 +0000
Responsible-Changed-Why:
will take it.


From: "Yuji Yamano" <yyamano@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51802 CVS commit: pkgsrc/security/mozilla-rootcerts/files
Date: Wed, 1 Feb 2017 01:58:52 +0000

 Module Name:	pkgsrc
 Committed By:	yyamano
 Date:		Wed Feb  1 01:58:52 UTC 2017

 Modified Files:
 	pkgsrc/security/mozilla-rootcerts/files: mozilla-rootcerts.sh

 Log Message:
 Set LC_ALL=C to avoid gawk's output data corruption
 Fixed PR pkg/51802.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 \
     pkgsrc/security/mozilla-rootcerts/files/mozilla-rootcerts.sh

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

State-Changed-From-To: open->closed
State-Changed-By: yyamano@NetBSD.org
State-Changed-When: Wed, 01 Feb 2017 02:30:17 +0000
State-Changed-Why:
I just committed it. Thank you.


>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.