NetBSD Problem Report #48522

From www@NetBSD.org  Wed Jan 15 07:48:19 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A5008A6464
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Jan 2014 07:48:19 +0000 (UTC)
Message-Id: <20140115074817.CAE3DA6483@mollari.NetBSD.org>
Date: Wed, 15 Jan 2014 07:48:17 +0000 (UTC)
From: rhansen@bbn.com
Reply-To: rhansen@bbn.com
To: gnats-bugs@NetBSD.org
Subject: lang/mono2 fails to build on i386 NetBSD 6.1
X-Send-Pr-Version: www-1.0

>Number:         48522
>Category:       pkg
>Synopsis:       lang/mono2 fails to build on i386 NetBSD 6.1
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 15 07:50:00 +0000 2014
>Closed-Date:    Sat Apr 11 18:59:28 +0000 2020
>Last-Modified:  Sat Apr 11 18:59:28 +0000 2020
>Originator:     Richard Hansen
>Release:        6.1
>Organization:
>Environment:
NetBSD foo 6.1 NetBSD 6.1 (GENERIC) ... i386
>Description:
See PR/45828 for a full description
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45828

Note that just like PR/45828, i386 is broken but amd64 is OK.

That PR was marked as closed, perhaps because lang/mono has since been updated to a version that doesn't have the problem.  However, this bug is about lang/mono2, not lang/mono.  lang/mono2 is an older version of mono.  At the time 45828 was filed, lang/mono was at 2.10.6.  lang/mono2 is currently at 2.10.9 (2013Q4), which is probably similar enough that the problem I'm experiencing is indeed the same as PR/45828.

Applying the patch in PR/45828 fixed the problem for me, but I don't know if that's the "right" solution.  (Disabling garbage collection completely seems non-ideal to me, although maybe it only disables garbage collection for the lightweight C# compiler used to bootstrap?)

Upstream has tagged 2.10.10 through 2.10.12 in their Git repository, but they have not made any official release tarballs for these versions.  Release notes are not available for these revisions so it's unclear whether this bug has been fixed upstream between 2.10.10 and 2.10.12.

Also see PR/46147, which has similar symptoms but is unrealated (AFAIK).  That bug it was caused by a regression(?) in pthread introduced after netbsd-6 was already cut, and it affects amd64 unlike this bug.
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=46147

Here is the tail end of the build output without the patch applied:

---------------------------------------------------
gmake[6]: Entering directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
gmake[6]: gmcs: Command not found
build/profiles/basic.make:91: recipe for target 'build/deps/basic-profile-check.exe' failed
gmake[6]: *** [build/deps/basic-profile-check.exe] Error 127
gmake[6]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
gmake[6]: Entering directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
*** The compiler 'gmcs' doesn't appear to be usable.
*** Trying the 'monolite' directory.
gmake[7]: Entering directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
gmake[8]: Entering directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
[1]   Abort trap (core dumped) MONO_PATH=".//cl...
build/profiles/basic.make:91: recipe for target 'build/deps/basic-profile-check.exe' failed
gmake[8]: *** [build/deps/basic-profile-check.exe] Error 134
gmake[8]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
gmake[8]: Entering directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
*** The contents of your 'monolite' directory may be out-of-date
*** You may want to try 'make get-monolite-latest'
build/profiles/basic.make:75: recipe for target 'do-profile-check-monolite' failed
gmake[8]: *** [do-profile-check-monolite] Error 1
gmake[8]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
build/profiles/basic.make:58: recipe for target 'do-profile-check' failed
gmake[7]: *** [do-profile-check] Error 2
gmake[7]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
build/profiles/basic.make:83: recipe for target 'do-profile-check-monolite' failed
gmake[6]: *** [do-profile-check-monolite] Error 2
gmake[6]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
build/profiles/basic.make:58: recipe for target 'do-profile-check' failed
gmake[5]: *** [do-profile-check] Error 2
gmake[5]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
Makefile:95: recipe for target 'profile-do--basic--all' failed
gmake[4]: *** [profile-do--basic--all] Error 2
gmake[4]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
Makefile:91: recipe for target 'profiles-do--all' failed
gmake[3]: *** [profiles-do--all] Error 2
gmake[3]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
Makefile:490: recipe for target 'all-local' failed
gmake[2]: *** [all-local] Error 2
gmake[2]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/runtime'
Makefile:415: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9'
Makefile:340: recipe for target 'all' failed
gmake: *** [all] Error 2
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/lang/mono2
---------------------------------------------------

Note the "Abort trap (core dumped)" above.  If you examine the core file, you get a backtrace similar to the one in PR/45828.
>How-To-Repeat:
1. install NetBSD 6.1
2. fetch pkgsrc-2013Q4 into /usr/pkgsrc
3. cd /usr/pkgsrc/lang/mono2
4. make package
>Fix:
see patch in PR/45828

or maybe it could be fixed by depending on devel/boehm-gc and linking against libgc.so from that package via '--with-gc=boehm' (instead of using the probably very old version of the Boehm garbage collector that comes with mono 2.10.9)

>Release-Note:

>Audit-Trail:
From: Richard Hansen <rhansen@bbn.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48522: lang/mono2 fails to build on i386 NetBSD 6.1
Date: Wed, 15 Jan 2014 03:36:40 -0500

 I tried building against devel/boehm-gc (with
 PKG_OPTIONS.boehm-gc+=threads) by using the following patch:

 diff --git a/pkgsrc/lang/mono2/Makefile b/pkgsrc/lang/mono2/Makefile
 index 36bd493..d078818 100644
 --- a/pkgsrc/lang/mono2/Makefile
 +++ b/pkgsrc/lang/mono2/Makefile
 @@ -31,6 +31,7 @@ CONFIGURE_ARGS+=      --with-icu=yes
  CONFIGURE_ARGS+=       --with-preview=yes
  CONFIGURE_ARGS+=       --with-libgdiplus=installed
  CONFIGURE_ARGS+=       --disable-dtrace
 +CONFIGURE_ARGS+=       --with-gc=boehm

  .include "options.mk"

 @@ -158,6 +159,7 @@ ULIMIT_CMD_datasize=        ulimit -d 524288
  ULIMIT_CMD_stacksize=  ulimit -s 10240
  .endif

 +.include "../../devel/boehm-gc/buildlink3.mk"
  .include "../../devel/gettext-lib/buildlink3.mk"
  .include "../../lang/python/application.mk"
  .include "../../textproc/icu/buildlink3.mk"
 diff --git a/pkgsrc/lang/mono2/distinfo b/pkgsrc/lang/mono2/distinfo
 index 7956ab1..7596a03 100644
 --- a/pkgsrc/lang/mono2/distinfo
 +++ b/pkgsrc/lang/mono2/distinfo
 @@ -4,7 +4,7 @@ SHA1 (mono-2.10.9.tar.bz2) =
 1a6e8c5a0c3d88d87982259aa04402e028a283de
  RMD160 (mono-2.10.9.tar.bz2) = ac9784c413eb2cdb490750a86a96cce5c11ad5bd
  Size (mono-2.10.9.tar.bz2) = 34038017 bytes
  SHA1 (patch-aa) = f3c88247c143cba6d0475f1dabb653adbc841bdb
 -SHA1 (patch-ab) = bc7c65758bd4c24340ab75f42e6fae9831c0498b
 +SHA1 (patch-ab) = 10eb6f4453c626f0bedce4b0ce6519ba6aea4d5f
  SHA1 (patch-ac) = 78f3b0786480e066959cc191e3f45d3f773220e2
  SHA1 (patch-ad) = 2dc253928695966b5310457b0cec52cd919a4851
  SHA1 (patch-ae) = 2b032ad658e8aa23c4e3825474d2d284b00557cd
 diff --git a/pkgsrc/lang/mono2/patches/patch-ab
 b/pkgsrc/lang/mono2/patches/patch-ab
 index c3a9915..074f28e 100644
 --- a/pkgsrc/lang/mono2/patches/patch-ab
 +++ b/pkgsrc/lang/mono2/patches/patch-ab
 @@ -18,7 +18,7 @@ Support 64-bit SunOS.
                 libmono_ldflags="-pthread"
                 need_link_unlink=yes
  -              libdl="-ldl"
 -+              libdl="-ldl /libexec/ld.elf_so"
 ++              libdl=
                 libgc_threads=pthreads
                 with_sigaltstack=no
                 use_sigposix=yes


 Unfortunately the build still failed, but with a slightly different error:

 ...
 gmake[6]: Entering directory
 '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
 gmake[6]: gmcs: Command not found
 build/profiles/basic.make:91: recipe for target
 'build/deps/basic-profile-check.exe' failed
 gmake[6]: *** [build/deps/basic-profile-check.exe] Error 127
 gmake[6]: Leaving directory
 '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
 gmake[6]: Entering directory
 '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
 *** The compiler 'gmcs' doesn't appear to be usable.
 *** Trying the 'monolite' directory.
 gmake[7]: Entering directory
 '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
 gmake[8]: Entering directory
 '/pkg_comp/obj/pkgsrc/lang/mono2/work/mono-2.10.9/mcs'
 Insufficient memory for GC_all_nils
 ...

 Note that it no longer segfaults; it instead errors out with
 "Insufficient memory for GC_all_nils".

 -Richard

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/48522: lang/mono2 fails to build on i386 NetBSD 6.1
Date: Wed, 15 Jan 2014 10:14:09 +0100

 On Wed, Jan 15, 2014 at 08:40:01AM +0000, Richard Hansen wrote:
 >  Note that it no longer segfaults; it instead errors out with
 >  "Insufficient memory for GC_all_nils".

 Can you try playing around with the UNLIMIT_RESOURCES variable?
 E.g. add
 UNLIMIT_RESOURCES=datasize stacksize memorysize
 in the Makefile; if that works, try finding the smallest
 necessary subset of these.

 Thanks,
  Thomas

From: Richard Hansen <rhansen@bbn.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48522: lang/mono2 fails to build on i386 NetBSD 6.1
Date: Wed, 15 Jan 2014 12:14:09 -0500

 On 2014-01-15 04:15, Thomas Klausner wrote:
 > Can you try playing around with the UNLIMIT_RESOURCES variable?
 > E.g. add
 > UNLIMIT_RESOURCES=datasize stacksize memorysize
 > in the Makefile; if that works, try finding the smallest
 > necessary subset of these.

 In which Makefile?  devel/boehm-gc or lang/mono2?

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/48522: lang/mono2 fails to build on i386 NetBSD 6.1
Date: Wed, 15 Jan 2014 18:23:14 +0100

 On Wed, Jan 15, 2014 at 05:15:01PM +0000, Richard Hansen wrote:
 >  On 2014-01-15 04:15, Thomas Klausner wrote:
 >  > Can you try playing around with the UNLIMIT_RESOURCES variable?
 >  > E.g. add
 >  > UNLIMIT_RESOURCES=datasize stacksize memorysize
 >  > in the Makefile; if that works, try finding the smallest
 >  > necessary subset of these.
 >  
 >  In which Makefile?  devel/boehm-gc or lang/mono2?

 The one that fails building, i.e. lang/mono2.
  Thomas

From: Richard Hansen <rhansen@bbn.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48522: lang/mono2 fails to build on i386 NetBSD 6.1
Date: Wed, 15 Jan 2014 14:16:01 -0500

 On 2014-01-15 04:15, Thomas Klausner wrote:
 > Can you try playing around with the UNLIMIT_RESOURCES variable?
 > E.g. add
 > UNLIMIT_RESOURCES=datasize stacksize memorysize
 > in the Makefile; if that works, try finding the smallest
 > necessary subset of these.

 No luck.  I tried just adding UNLIMIT_RESOURCES and there was no change
 in behavior.  I also tried both setting UNLIMIT_RESOURCES and linking
 against devel/boehm-gc using the patch I pasted in a previous comment to
 this PR, and there was no change in the behavior there, either.

State-Changed-From-To: open->closed
State-Changed-By: adam@NetBSD.org
State-Changed-When: Sat, 11 Apr 2020 18:59:28 +0000
State-Changed-Why:
mono2 has been removed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 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.