NetBSD Problem Report #53353

From www@NetBSD.org  Fri Jun  8 06:48:02 2018
Return-Path: <www@NetBSD.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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BB8657A177
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  8 Jun 2018 06:48:01 +0000 (UTC)
Message-Id: <20180608064800.A7ABD7A233@mollari.NetBSD.org>
Date: Fri,  8 Jun 2018 06:48:00 +0000 (UTC)
From: mayuresh@acm.org
Reply-To: mayuresh@acm.org
To: gnats-bugs@NetBSD.org
Subject: devel/nss fails to build on armv7 on rpi2
X-Send-Pr-Version: www-1.0

>Number:         53353
>Category:       pkg
>Synopsis:       devel/nss fails to build on armv7 on rpi2
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    tnn
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 08 06:50:00 +0000 2018
>Closed-Date:    Sun Apr 26 21:50:28 +0000 2020
>Last-Modified:  Sun Apr 26 21:50:28 +0000 2020
>Originator:     Mayuresh
>Release:        pkgsrc current updated  Fri Jun 8 01:41:15 2018 +0000
>Organization:
>Environment:
NetBSD armv7 8.0_RC1 NetBSD 8.0_RC1 (RPI2.201804240813Z) evbarm

>Description:
Compilation of devel/nss results in this error:

/usbdisk/usr/pkgsrc/devel/nss/work/nss-3.37.1/nss/cmd/shlibsign/NetBSD8.0_RC1_OPT.OBJ/shlibsign
-v -i
/usbdisk/usr/pkgsrc/devel/nss/work/nss-3.37.1/nss/cmd/shlibsign/../../../dist/NetBSD8.0_RC1_OPT.OBJ/lib/libsoftokn3.so
moduleSpec configdir='' certPrefix='' keyPrefix='' secmod=''
flags=noCertDB, noModDB
C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR
NSPR error code: -5977: Failure to load dynamic library
Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR
NSPR error code: -5977: Failure to load dynamic library
Makefile:92: recipe for target
'../../../dist/NetBSD8.0_RC1_OPT.OBJ/lib/libsoftokn3.chk' failed


I am havng 1GB RAM + 4GB swap, so shouldn't be memory issue.
>How-To-Repeat:
Compile devel/nss on armv7, but may be the issue exists on others.
>Fix:
Not known.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 07 Sep 2019 12:50:07 +0000
State-Changed-Why:
Are you still having trouble with this package? it's nt failing on bulk builds.
Out-of-RAM issues can be identified with the associated dmesg output


Responsible-Changed-From-To: pkg-manager->tnn
Responsible-Changed-By: tnn@NetBSD.org
Responsible-Changed-When: Thu, 19 Sep 2019 18:09:52 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: feedback->open
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Thu, 19 Sep 2019 18:09:52 +0000
State-Changed-Why:
I just got this issue on aarch64. It was OK a couple of weeks ago, must be related to some local setting.


From: "Tobias Nygren" <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53353 CVS commit: pkgsrc/devel/nss
Date: Thu, 19 Sep 2019 19:14:39 +0000

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Thu Sep 19 19:14:39 UTC 2019

 Modified Files:
 	pkgsrc/devel/nss: distinfo
 	pkgsrc/devel/nss/patches: patch-me

 Log Message:
 nss: aarch64 build fix

 From OpenBSD. Similar to PR pkg/53353 for ARM. Although different symbols
 missing in that case and that's believed to be fixed already.


 To generate a diff of this commit:
 cvs rdiff -u -r1.99 -r1.100 pkgsrc/devel/nss/distinfo
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/nss/patches/patch-me

 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: tnn@NetBSD.org
State-Changed-When: Thu, 19 Sep 2019 19:16:00 +0000
State-Changed-Why:
Fixed for aarch64, probably ARMv7 problem is no longer present.


State-Changed-From-To: feedback->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 05 Oct 2019 08:01:02 +0000
State-Changed-Why:
submitter said they cannot test, so closing to avoid feedback. any issue will show up on bulk builds.


From: Timo Buhrmester <fstd.lkml@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53353 (devel/nss fails to build on armv7 on rpi2)
Date: Wed, 15 Apr 2020 21:44:05 +0200

 > believed to be fixed already

 I just had this happen with 2020Q1 on a native armv7hf build
 (9_STABLE on a Banana Pi (the original/first one I believe))

 It boils down to shlibsign (via NSPR) attempting a to dlopen(3)
 libfreebl3.so with RTLD_NOW, however, libfreebl3.so, as built
 on this HW at least, cannot be dlopen()ed with RTLD_NOW because
 the symbol "gcm_HashInit_hw" cannot be found (as confirmed with
 a testcase and dynamic linker debugging, below)

 | [...]
 | search referencing object for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "gcm_HashInit_hw" in /pkg_comp/obj/pkgsrc/devel/nss/default/nss-3.51/nss/lib/freebl/NetBSD9.0_STABLE_OPT.OBJ/NetBSD_SINGLE_SHLIB/libfreebl3.so
 | check "gcm_HashInit_hw" vs "malloc" in /pkg_comp/obj/pkgsrc/devel/nss/default/nss-3.51/nss/lib/freebl/NetBSD9.0_STABLE_OPT.OBJ/NetBSD_SINGLE_SHLIB/libfreebl3.so
 | search _rtld_list_main for gcm_HashInit_hw
 | search object 0x7bec0000 (./tc) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "__syscall" in ./tc
 | check "gcm_HashInit_hw" vs "dlopen" in ./tc
 | check "gcm_HashInit_hw" vs "_exit" in ./tc
 | search object 0x7bec0400 (/libkver/lib/libkver.so) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "warnx" in /libkver/lib/libkver.so
 | search object 0x7bec0800 (/usr/lib/libc.so.12) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "_Unwind_GetIPInfo" in /usr/lib/libc.so.12
 | search _rtld_list_global for gcm_HashInit_hw
 | search DAG with root 0x7bec0c00 (/pkg_comp/obj/pkgsrc/devel/nss/default/nss-3.51/nss/lib/freebl/NetBSD9.0_STABLE_OPT.OBJ/NetBSD_SINGLE_SHLIB/libfreebl3.so) for gcm_HashInit_hw
 | search object 0x7bec1000 (/usr/pkg/lib/nspr/libplc4.so) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "PL_strnchr" in /usr/pkg/lib/nspr/libplc4.so
 | search object 0x7bec1800 (/usr/pkg/lib/nspr/libnspr4.so) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "malloc" in /usr/pkg/lib/nspr/libnspr4.so
 | search object 0x7bc1a000 (/usr/lib/libpthread.so.1) for gcm_HashInit_hw
 | search object 0x7bec1400 (/usr/pkg/lib/nspr/libplds4.so) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "libVersionPoint" in /usr/pkg/lib/nspr/libplds4.so
 | search object 0x7bec1c00 (/pkg_comp/obj/pkgsrc/devel/nss/default/nss-3.51/nss/cmd/shlibsign/../../../dist/NetBSD9.0_STABLE_OPT.OBJ/lib/libnssutil3.so) for gcm_HashInit_hw
 | check "gcm_HashInit_hw" vs "SEC_UniversalStringTemplate" in /pkg_comp/obj/pkgsrc/devel/nss/default/nss-3.51/nss/cmd/shlibsign/../../../dist/NetBSD9.0_STABLE_OPT.OBJ/lib/libnssutil3.so
 | Search the dynamic linker itself.
 | check "gcm_HashInit_hw" vs "dlvsym" in /usr/libexec/ld.elf_so
 | check "gcm_HashInit_hw" vs "dlsym" in /usr/libexec/ld.elf_so
 | check "gcm_HashInit_hw" vs "__dlclose" in /usr/libexec/ld.elf_so
 | lookup failed

 The patch below "fixes" it for me, in the sense that it at least finishes
 compiling -- I can't predict what runtime consequences it might have.

 Timo

 ---------8<--------------------------------------------

 --- nss/lib/freebl/genload.c.orig	2020-04-15 18:42:03.836791127 +0000
 +++ nss/lib/freebl/genload.c	2020-04-15 18:42:06.837963155 +0000
 @@ -102,7 +102,7 @@
  #endif
              libSpec.type = PR_LibSpec_Pathname;
              libSpec.value.pathname = fullName;
 -            dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
 +            dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY | PR_LD_LOCAL);
              PORT_Free(fullName);
          }
      }

State-Changed-From-To: closed->open
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Thu, 16 Apr 2020 20:03:15 +0000
State-Changed-Why:
problem has returned


From: "Tobias Nygren" <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53353 CVS commit: pkgsrc/devel/nss
Date: Sun, 26 Apr 2020 21:43:43 +0000

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Sun Apr 26 21:43:43 UTC 2020

 Modified Files:
 	pkgsrc/devel/nss: distinfo
 Added Files:
 	pkgsrc/devel/nss/patches: patch-nss_coreconf_NetBSD.mk

 Log Message:
 nss: fix wrong value of CPU_ARCH on NetBSD/evbarm-earmv7hf

 Fixes PR pkg/53353 and maybe also PR pkg/55158


 To generate a diff of this commit:
 cvs rdiff -u -r1.111 -r1.112 pkgsrc/devel/nss/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/devel/nss/patches/patch-nss_coreconf_NetBSD.mk

 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: tnn@NetBSD.org
State-Changed-When: Sun, 26 Apr 2020 21:50:28 +0000
State-Changed-Why:
Fixed, again. Thanks for the report.
I wish nss had better error diagnostics for this.
(They should use dlerror!)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.