NetBSD Problem Report #53516

From bjjl@web.mx.plus  Mon Aug 13 05:23:42 2018
Return-Path: <bjjl@web.mx.plus>
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 7C98A7A154
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 13 Aug 2018 05:23:42 +0000 (UTC)
Message-Id: <20180813052338.EA3DB107615@web.mx.plus>
Date: Mon, 13 Aug 2018 07:23:38 +0200 (CEST)
From: ben@pocket.services
Reply-To:
To: gnats-bugs@NetBSD.org
Subject: mono build error
X-Send-Pr-Version: 3.95

>Number:         53516
>Category:       pkg
>Synopsis:       mono build error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 13 05:25:00 +0000 2018
>Closed-Date:    Thu Jan 14 12:41:24 +0000 2021
>Last-Modified:  Thu Jan 14 12:41:24 +0000 2021
>Originator:     ben@pocket.services
>Release:        NetBSD 8.0
>Organization:

>Environment:


System: NetBSD web.mx.plus 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
MCS     [build] Mono.Posix.dll
Creating the per profile list ../../build/deps/build_System.Core.dll.sources ...
MCS     [build] System.Core.dll
MCS     [build] mcs.exe
cp: mcs.exe: No such file or directory
../build/executable.make:117: recipe for target '../class/lib/build/mcs.exe' failed
gmake[7]: *** [../class/lib/build/mcs.exe] Error 1
../build/rules.make:143: recipe for target 'do-all' failed
gmake[6]: *** [do-all] Error 2
build/rules.make:164: recipe for target 'all-recursive' failed
gmake[5]: *** [all-recursive] Error 1
Makefile:45: recipe for target 'profile-do--build--all' failed
gmake[4]: *** [profile-do--build--all] Error 2
Makefile:41: recipe for target 'profiles-do--all' failed
gmake[3]: *** [profiles-do--all] Error 2
Makefile:555: recipe for target 'all-local' failed
gmake[2]: *** [all-local] Error 2
gmake[2]: Leaving directory '/home/bjjl/unstable/pkgsrc/lang/mono/work/mono-4.0.4/runtime'
Makefile:522: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/home/bjjl/unstable/pkgsrc/lang/mono/work/mono-4.0.4'
Makefile:449: recipe for target 'all' failed
gmake: *** [all] Error 2
*** Error code 2

Stop.
make[8]: stopped in /home/bjjl/unstable/pkgsrc/lang/mono
*** Error code 1

>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:
From: Charlotte Koch <dressupgeekout@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53516: mono build error
Date: Sun, 9 Dec 2018 19:50:39 -0800

 I've been able to consistently reproduce on my system here:

      NetBSD sakuracity 8.99.27 NetBSD 8.99.27 (GENERIC) #9: Sun Dec  9 
 12:07:19 PST 2018 
 root@sakuracity:/usr/obj/sys/arch/amd64/compile/GENERIC amd64

 I've been doing a bunch of digging.

 mcs.exe doesn't exist because the "mini" mono compiler 
 (${WRKSRC}/mono/mini/mono) segfaults any time it needs to do anything 
 interesting.

 Basically, any time we fork out to 'mcs' (those build lines prefixed 
 with "MCS  ", dozens and dozens of them), we're actually using the 
 "mini" mono program, which segfaults. But GNU make doesn't recognize a 
 program that has segfaulted to be one that failed. So it LOOKS like 
 we're happily "MCS"-ing when in fact we're not "MCS"-ing at all.

 Check out the backtrace.

      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00000000004f3297 in mono_arch_create_generic_trampoline 
 (tramp_type=tramp_type@entry=MONO_TRAMPOLINE_JIT, 
 info=info@entry=0x7f7fff2bbb08, aot=aot@entry=0) at tramp-amd64.c:447
      #1  0x00000000004a1ba8 in create_trampoline_code 
 (tramp_type=tramp_type@entry=MONO_TRAMPOLINE_JIT) at mini-trampolines.c:1299
      #2  0x00000000004a3511 in mono_trampolines_init () at 
 mini-trampolines.c:1313
      #3  0x000000000041cded in mini_init (filename=0x7f7fff2bc6a4 
 "build/deps/basic-profile-check.exe", 
 runtime_version=runtime_version@entry=0x0) at mini.c:7354
      #4  0x00000000004783d7 in mono_main (argc=4, argv=0x7f7fff2bbd18) 
 at driver.c:1921
      #5  0x0000000000414073 in ___start ()
      #6  0x00007f7f6040d460 in ?? () from /usr/libexec/ld.elf_so
      #7  0x0000000000000004 in ?? ()
      #8  0x00007f7fff2bc628 in ?? ()
      #9  0x00007f7fff2bc65d in ?? ()
      #10 0x00007f7fff2bc666 in ?? ()
      #11 0x00007f7fff2bc6a4 in ?? ()
      #12 0x0000000000000000 in ?? ()


 Charlotte

From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, 
	ben@pocket.services
Subject: Re: pkg/53516: mono build error
Date: Wed, 19 Dec 2018 13:25:47 +0100

 Does it work if you run "paxctl +m" on the intermediate binary?



 -- 
 Benny

State-Changed-From-To: open->feedback
State-Changed-By: leot@NetBSD.org
State-Changed-When: Wed, 19 Dec 2018 12:31:21 +0000
State-Changed-Why:
Feedback requested


From: Charlotte Koch <dressupgeekout@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53516: mono build error
Date: Thu, 20 Dec 2018 01:02:29 -0800

 So, if we run =E2=80=9Cpaxctl +m=E2=80=9D on ${WRKSRC}/mono/mini/mono, =
 then we don=E2=80=99t get
 any farther in the build, but at least the program does behave =
 differently, by
 actually reporting such things as =E2=80=9Chey you=E2=80=99re actually =
 segfaulting!"

     gmake[2]: Entering directory =
 '/usr/pkgsrc/lang/mono/work/mono-4.0.4/runtime'
     if test -w /usr/pkgsrc/lang/mono/work/mono-4.0.4/mcs; then :; else =
 chmod -R +w /usr/pkgsrc/lang/mono/work/mono-4.0.4/mcs; fi
     cd /usr/pkgsrc/lang/mono/work/mono-4.0.4/mcs && /usr/pkg/bin/gmake =
 --no-print-directory -s NO_DIR_CHECK=3D1 =
 PROFILES=3D'binary_reference_assemblies net_4_5 xbuild_12 xbuild_14   ' =
 CC=3D'gcc' all-profiles
     gmake[6]: mcs: Command not found                                     =
                        =20
     gmake[6]: *** [build/profiles/basic.make:93: =
 build/deps/basic-profile-check.exe] Error 127
     *** The compiler 'mcs' doesn't appear to be usable.             =20
     *** Trying the 'monolite' directory.                                 =
         =20
                                                                          =
         =20
     =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
     Got a SIGSEGV while executing native code. This usually indicates    =
               =20
     a fatal error in the mono runtime or one of the native libraries=20
     used by your application.                                            =
                                                   =20
     =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    =20
                                                                          =
              =20
     Bootstrap compiler:                                             =20
     =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                =20
     Got a SIGSEGV while executing native code. This usually indicates
     a fatal error in the mono runtime or one of the native libraries     =
             =20
     used by your application.                                            =
 =20
     =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               =20
                                                                          =
    =20
     MCS     [basic] basic.exe                                       =20
                                                                          =
   =20
     =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      =20
     Got a SIGSEGV while executing native code. This usually indicates
     a fatal error in the mono runtime or one of the native libraries     =
           =20
     used by your application.                                       =20
     =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             =20
                                                                     =20
     MCS     [basic] mscorlib.dll                                         =
       =20
                                                                     =20
     =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         =20
    =20
    =20
 Charlotte

State-Changed-From-To: feedback->open
State-Changed-By: leot@NetBSD.org
State-Changed-When: Thu, 20 Dec 2018 15:13:22 +0000
State-Changed-Why:
Feedback provided
(probably need a `paxctl +m' in the build phase but there are also
other problems)


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53516: mono build error
Date: Sat, 22 Dec 2018 18:37:18 +0000

 On Mon, Dec 10, 2018 at 03:55:00AM +0000, Charlotte Koch wrote:
  >  Basically, any time we fork out to 'mcs' (those build lines prefixed 
  >  with "MCS  ", dozens and dozens of them), we're actually using the 
  >  "mini" mono program, which segfaults. But GNU make doesn't recognize a 
  >  program that has segfaulted to be one that failed.

 It should... did they do something silly in the makefile?

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Thu, 14 Jan 2021 12:41:24 +0000
State-Changed-Why:
In the time since this PR was opened a new lang/mono6 package was imported
which handles PaX MPROTECT properly and builds on NetBSD/amd64 9.0 at the
very least.

Sorry this bug report wasn't dealt with quickly at the time.


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