NetBSD Problem Report #53568

From www@NetBSD.org  Sun Sep  2 07:58:42 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 C46F47A187
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  2 Sep 2018 07:58:42 +0000 (UTC)
Message-Id: <20180902075840.5477B7A218@mollari.NetBSD.org>
Date: Sun,  2 Sep 2018 07:58:40 +0000 (UTC)
From: hako@affrc.go.jp
Reply-To: hako@affrc.go.jp
To: gnats-bugs@NetBSD.org
Subject: perl-5.28.0 fails to build on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         53568
>Category:       pkg
>Synopsis:       perl-5.28.0 fails to build on Solaris 10
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 02 08:00:00 +0000 2018
>Closed-Date:    
>Last-Modified:  Thu Nov 29 07:40:00 +0000 2018
>Originator:     Hiroshi Hakoyama
>Release:        pkgsrc current
>Organization:
FRA
>Environment:
SunOS ec21 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-1000
>Description:
perl-5.28.0 fails to build on Solaris 10. perl-5.26.2 was OK.

...
gcc -c -DPERL_CORE -D_REENTRANT -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3 -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3 -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -fPIC miniperlmain.c
gcc -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o miniperl  opmini.o perlmini.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o  miniperlmain.o  -lm -ldl -lsocket -lnsl -lpthread -lrt
LD_LIBRARY_PATH=/usr/pkgsrc/lang/perl5/work/perl-5.28.0 ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
/usr/bin/bash: line 1: 28934 Bus Error               (core dumped) LD_LIBRARY_PATH=/usr/pkgsrc/lang/perl5/work/perl-5.28.0 ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>'
Failed to build miniperl. Please run make minitest
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/perl5/work/perl-5.28.0
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/perl5

>How-To-Repeat:
# bmake
>Fix:
none

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sun, 02 Sep 2018 14:08:10 +0000
Responsible-Changed-Why:
Solaris problem


State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 02 Sep 2018 14:08:10 +0000
State-Changed-Why:
Upstream bug report requested.


From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Sun, 2 Sep 2018 16:06:27 +0000

 > perl-5.28.0 fails to build on Solaris 10. perl-5.26.2 was OK.
 >
 > ...
 > gcc -c -DPERL_CORE -D_REENTRANT -O3 -mcpu=3Dultrasparc3 -mtune=3Dultraspa=
 rc3 -D_FORTIFY_SOURCE=3D2 -pthread -I/usr/include -fwrapv -fno-strict-alias=
 ing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64=
  -DPERL_USE_SAFE_PUTENV -O3 -mcpu=3Dultrasparc3 -mtune=3Dultrasparc3 -D_FOR=
 TIFY_SOURCE=3D2 -pthread -I/usr/include -Wall -Werror=3Ddeclaration-after-s=
 tatement -Werror=3Dpointer-arith -Wextra -Wc++-compat -Wwrite-strings -fPIC=
  miniperlmain.c
 > gcc -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o miniperl  op=
 mini.o perlmini.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o r=
 eentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp=
 _ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o gl=
 obals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o=
  caretx.o dquote.o time64.o  miniperlmain.o  -lm -ldl -lsocket -lnsl -lpthr=
 ead -lrt
 > LD_LIBRARY_PATH=3D/usr/pkgsrc/lang/perl5/work/perl-5.28.0 ./miniperl -w -=
 Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to b=
 uild miniperl.  Please run make minitest; exit 1'
 > /usr/bin/bash: line 1: 28934 Bus Error               (core dumped) LD_LIB=
 RARY_PATH=3D/usr/pkgsrc/lang/perl5/work/perl-5.28.0 ./miniperl -w -Ilib -Id=
 ist/Exporter/lib -MExporter -e '<?>'
 > Failed to build miniperl. Please run make minitest
 > *** Error code 1

 This sounds like an upstream regression. Please file a bug report
 upstream (bugs.perl.org) and send a link to this list.

 --=20
 Benny

From: Hiroshi Hakoyama <hako@affrc.go.jp>
To: gnats-bugs@NetBSD.org
Cc: solaris-pkg-people@NetBSD.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Sat, 22 Sep 2018 18:21:52 +0900

 I sent a PR to upstream.
 https://rt.perl.org/Public/Bug/Display.html?id=3D133495

 I found a workaround:
 A build with CFLAGS+=3D -O2 -mcpu=3Dultrasparc3 -mtune=3Dultrasparc3 was =
 OK.
 Optimization level -O3 causes the problem.

 # dbx ./miniperl core
 For information about new features see `help changes'
 To remove this message, put `dbxenv suppress_startup_message 7.6' in =
 your .dbxrc
 Reading miniperl
 dbx: warning: unknown location expression code (0xf2)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 dbx: warning: unknown location expression code (0x9e)
 core file header read successfully
 Reading ld.so.1
 Reading libm.so.2
 Reading libdl.so.1
 Reading libsocket.so.1
 Reading libnsl.so.1
 Reading libpthread.so.1
 Reading librt.so.1
 Reading libssp.so.0.0.0
 Reading libc.so.1
 Reading libaio.so.1
 Reading libmd.so.1
 Reading libgcc_s.so.1
 Reading libc_psr.so.1
 t@1 (l@1) program terminated by signal BUS (invalid address alignment)
 0x000ecf6c: Perl_hv_common+0x156c:      ld       [%g3], %o0
 (dbx) where                                                              =
    =20
 current thread: t@1
 =3D>[1] Perl_hv_common(0x5b65439d, 0x338818, 0x0, 0xffbffaaa, 0x33d1e8, =
 0x0), at 0xecf6c=20
   [2] Perl_hv_common_key_len(0x29bba8, 0x338818, 0xffbffaaa, 0x19, 0x8, =
 0x0), at 0xee2f0=20
   [3] S_init_postdump_symbols(0x29bba8, 0x338818, 0xffbffac3, =
 0xffbfede0, 0x19, 0xffbffaaa), at 0x5765c=20
   [4] perl_parse(0x0, 0x334290, 0x339820, 0xffbfece0, 0x1, 0x338758), at =
 0x5c758=20
   [5] main(0x4, 0xffbfecd4, 0xffbfece8, 0x2959b8, 0xff170100, 0x0), at =
 0x1bd9dc=20
 (dbx) quit
 dbx: internal warning: td_ta_clear_event() failed -- debugger service =
 failed
 dbx: internal warning: td_ta_sync_tracking_enable(0) failed -- debugger =
 service failed

 Hiroshi

 > 2018/09/02 23:10=E3=80=81Benny Siegert =
 <bsiegert@gmail.com>=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB:
 >=20
 > The following reply was made to PR pkg/53568; it has been noted by =
 GNATS.
 >=20
 > From: Benny Siegert <bsiegert@gmail.com>
 > To: gnats-bugs@netbsd.org
 > Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, =
 pkgsrc-bugs@netbsd.org
 > Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
 > Date: Sun, 2 Sep 2018 16:06:27 +0000
 >=20
 >> perl-5.28.0 fails to build on Solaris 10. perl-5.26.2 was OK.
 >>=20
 >> ...
 >> gcc -c -DPERL_CORE -D_REENTRANT -O3 -mcpu=3D3Dultrasparc3 =
 -mtune=3D3Dultraspa=3D
 > rc3 -D_FORTIFY_SOURCE=3D3D2 -pthread -I/usr/include -fwrapv =
 -fno-strict-alias=3D
 > ing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE =
 -D_FILE_OFFSET_BITS=3D3D64=3D
 >  -DPERL_USE_SAFE_PUTENV -O3 -mcpu=3D3Dultrasparc3 -mtune=3D3Dultrasparc3=
  -D_FOR=3D
 > TIFY_SOURCE=3D3D2 -pthread -I/usr/include -Wall =
 -Werror=3D3Ddeclaration-after-s=3D
 > tatement -Werror=3D3Dpointer-arith -Wextra -Wc++-compat =
 -Wwrite-strings -fPIC=3D
 >  miniperlmain.c
 >> gcc -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o miniperl =
  op=3D
 > mini.o perlmini.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o =
 mg.o r=3D
 > eentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o =
 scope.o pp=3D
 > _ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o =
 universal.o gl=3D
 > obals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o =
 pp_sort.o=3D
 >  caretx.o dquote.o time64.o  miniperlmain.o  -lm -ldl -lsocket -lnsl =
 -lpthr=3D
 > ead -lrt
 >> LD_LIBRARY_PATH=3D3D/usr/pkgsrc/lang/perl5/work/perl-5.28.0 =
 ./miniperl -w -=3D
 > Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed =
 to b=3D
 > uild miniperl.  Please run make minitest; exit 1'
 >> /usr/bin/bash: line 1: 28934 Bus Error               (core dumped) =
 LD_LIB=3D
 > RARY_PATH=3D3D/usr/pkgsrc/lang/perl5/work/perl-5.28.0 ./miniperl -w =
 -Ilib -Id=3D
 > ist/Exporter/lib -MExporter -e '<?>'
 >> Failed to build miniperl. Please run make minitest
 >> *** Error code 1
 >=20
 > This sounds like an upstream regression. Please file a bug report
 > upstream (bugs.perl.org) and send a link to this list.
 >=20
 > --=3D20
 > Benny
 >=20

From: maya@netbsd.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Tue, 20 Nov 2018 09:10:31 +0000

 Does a diff like the following do the trick to avoid the issue in
 pkgsrc?

 Index: hacks.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/perl5/hacks.mk,v
 retrieving revision 1.20
 diff -u -r1.20 hacks.mk
 --- hacks.mk	20 Nov 2018 09:07:06 -0000	1.20
 +++ hacks.mk	20 Nov 2018 09:10:16 -0000
 @@ -22,6 +22,13 @@
  BUILDLINK_TRANSFORM+=	opt:-O[0-9]*:-Os
  .endif

 +# Alignment fault on perl 5.28.0
 +# https://rt.perl.org/Public/Bug/Display.html?id=133495
 +.if ${OPSYS} == "SunOS" && !empty(${MACHINE_ARCH:Msparc*})
 +PKG_HACKS+=		
 +BUILDLINK_TRANSFORM+=	opt:-O3:-O2
 +.endif
 +
  ### [Fri Jan 31 11:09:04 CST 2014 : schnoebe]
  ### [Fri Oct 28 11:53:57 EDT 2016 : dholland - extended to gcc5]
  ### gcc-[45].*.* in NetBSD/alpha causes unaligned access exception in perl.

From: Hiroshi Hakoyama <hako@affrc.go.jp>
To: gnats-bugs@NetBSD.org
Cc: solaris-pkg-people@NetBSD.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Wed, 21 Nov 2018 15:15:23 +0900

 > Does a diff like the following do the trick to avoid the issue in
 > pkgsrc?
 No.=20
 But, the following modification was worked. thanks.

 .if ${OPSYS} =3D=3D "SunOS" && !empty(MACHINE_ARCH:Msparc*)

 Hiroshi


 > 2018/11/20 18:15=E3=80=81maya@netbsd.org=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=
 =AB:
 >=20
 > The following reply was made to PR pkg/53568; it has been noted by =
 GNATS.
 >=20
 > From: maya@netbsd.org
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
 > Date: Tue, 20 Nov 2018 09:10:31 +0000
 >=20
 > Does a diff like the following do the trick to avoid the issue in
 > pkgsrc?
 >=20
 > Index: hacks.mk
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > RCS file: /cvsroot/pkgsrc/lang/perl5/hacks.mk,v
 > retrieving revision 1.20
 > diff -u -r1.20 hacks.mk
 > --- hacks.mk	20 Nov 2018 09:07:06 -0000	1.20
 > +++ hacks.mk	20 Nov 2018 09:10:16 -0000
 > @@ -22,6 +22,13 @@
 >  BUILDLINK_TRANSFORM+=3D	opt:-O[0-9]*:-Os
 >  .endif
 >=20
 > +# Alignment fault on perl 5.28.0
 > +# https://rt.perl.org/Public/Bug/Display.html?id=3D133495
 > +.if ${OPSYS} =3D=3D "SunOS" && !empty(${MACHINE_ARCH:Msparc*})
 > +PKG_HACKS+=3D	=09
 > +BUILDLINK_TRANSFORM+=3D	opt:-O3:-O2
 > +.endif
 > +
 >  ### [Fri Jan 31 11:09:04 CST 2014 : schnoebe]
 >  ### [Fri Oct 28 11:53:57 EDT 2016 : dholland - extended to gcc5]
 >  ### gcc-[45].*.* in NetBSD/alpha causes unaligned access exception in =
 perl.
 >=20

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53568 CVS commit: pkgsrc/lang/perl5
Date: Wed, 21 Nov 2018 08:33:51 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Wed Nov 21 08:33:51 UTC 2018

 Modified Files:
 	pkgsrc/lang/perl5: hacks.mk

 Log Message:
 perl5: low cost hack for alignment issue on SunOS/sparc.
 Substitute -O3 with -O2.

 This is tracked upstream in https://rt.perl.org/Public/Bug/Display.html?id=133495
 From Hiroshi Hakoyama in PR pkg/53568


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 pkgsrc/lang/perl5/hacks.mk

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

From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Wed, 21 Nov 2018 09:04:45 +0000

 So, this is likely to be of many causes:
 - Perl bug
 - Compiler
 - OS (unlikely)

 I asked one of the NetBSD/sparc64 people if he has problems with this
 package, and he doesn't. He is using GCC 6.4, and you're with an older
 version. That means it's less likely to be perl.

 Can you update to a newer GCC and see if it's still an issue?

 From a pkgsrc perspective, this is a really low cost workaround,
 optimization is still on. We can just leave it alone if you can't be
 bothered.

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 26 Nov 2018 17:36:47 +0000
State-Changed-Why:
Feedback was received.
It looks like the workaround has been committed -- ok to close?


From: Hiroshi Hakoyama <hako@affrc.go.jp>
To: gnats-bugs@NetBSD.org
Cc: solaris-pkg-people@NetBSD.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Thu, 29 Nov 2018 14:24:21 +0900

 > Can you update to a newer GCC and see if it's still an issue?
 I tried to build packages from gcc5 to gcc8 using gcc version 4.9.4 from =
 pkgsrc, but I could not, as expected.
 Before the test for pkg/52568, should I submit the new bug report for =
 gcc packages?

 Hiroshi

 > 2018/11/21 18:05=E3=80=81coypu@sdf.org=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=
 :
 >=20
 > The following reply was made to PR pkg/53568; it has been noted by =
 GNATS.
 >=20
 > From: coypu@sdf.org
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
 > Date: Wed, 21 Nov 2018 09:04:45 +0000
 >=20
 > So, this is likely to be of many causes:
 > - Perl bug
 > - Compiler
 > - OS (unlikely)
 >=20
 > I asked one of the NetBSD/sparc64 people if he has problems with this
 > package, and he doesn't. He is using GCC 6.4, and you're with an older
 > version. That means it's less likely to be perl.
 >=20
 > Can you update to a newer GCC and see if it's still an issue?
 >=20
 > =46rom a pkgsrc perspective, this is a really low cost workaround,
 > optimization is still on. We can just leave it alone if you can't be
 > bothered.
 >=20

From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53568: perl-5.28.0 fails to build on Solaris 10
Date: Thu, 29 Nov 2018 08:39:25 +0100

 Hello Hiroshi,

 Hiroshi Hakoyama writes:
 > > Can you update to a newer GCC and see if it's still an issue?
 > I tried to build packages from gcc5 to gcc8 using gcc version 4.9.4 from=
  pkgsrc, but I could not, as expected.
 > Before the test for pkg/52568, should I submit the new bug report for gc=
 c packages?

 Yes, please submit a separate PR for gcc.


 Thank you very much!

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.