NetBSD Problem Report #52452

From www@NetBSD.org  Wed Aug  2 02:48:54 2017
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" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7A7ED7A213
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  2 Aug 2017 02:48:54 +0000 (UTC)
Message-Id: <20170802024853.554AA7A26E@mollari.NetBSD.org>
Date: Wed,  2 Aug 2017 02:48:53 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: qt3-tools build 'uic' stuck in "fdclose" w/modular Xorg on i386-8.0_BETA and i386-8.99.1
X-Send-Pr-Version: www-1.0

>Number:         52452
>Category:       pkg
>Synopsis:       qt3-tools build 'uic' stuck in "fdclose" w/modular Xorg on i386-8.0_BETA and i386-8.99.1
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 02 02:50:00 +0000 2017
>Closed-Date:    Sat Apr 28 08:31:48 +0000 2018
>Last-Modified:  Sat Apr 28 08:31:48 +0000 2018
>Originator:     John D. Baker
>Release:        NetBSD/i386-8.0_BETA, NetBSD/i386-8.99.1, pkgsrc-2017Q1, pkgsrc-2017Q2
>Organization:
>Environment:
NetBSD plex760.technoskunk.fur 8.0_BETA NetBSD 8.0_BETA (GENERIC_PAE) #89: Wed Jul 26 19:42:40 CDT 2017  sysop@x3650.technoskunk.fur:/r1/build/netbsd-8/obj/i386/sys/arch/i386/compile/GENERIC_PAE i386

NetBSD avaya.technoskunk.fur 8.0_BETA NetBSD 8.0_BETA (RACKMOUNT) #91: Wed Jul 26 19:37:08 CDT 2017  sysop@x3650.technoskunk.fur:/r1/build/netbsd-8/obj/i386/sys/arch/i386/compile/RACKMOUNT i386

et al.
>Description:
While building "x11/qt3-tools" on i386-8.0_BETA or i386-8.99.1, the
local tool 'uic' doesn't terminate, getting stuck in "fdclose" state.

Tail end of build on a system with MAKE_JOBS=5 (hw.ncpu +1):

[...]
gmake[3]: Entering directory '/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/tools/designer/designer'
/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins listboxeditor.ui -o listboxeditor.h
/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins editfunctions.ui -o editfunctions.h
/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins newform.ui -o newform.h
/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins listvieweditor.ui -o listvieweditor.h
/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins customwidgeteditor.ui -o customwidgeteditor.h

'top' reports:
$ top -n -t | grep uic$
11734     1 sysop     95 fdclos/0   0:00  0.00%  0.00% -         uic
 5594     1 sysop     95 fdclos/0   0:00  0.00%  0.00% -         uic
13326     1 sysop     95 fdclos/0   0:00  0.00%  0.00% -         uic
14376     1 sysop     95 fdclos/0   0:00  0.00%  0.00% -         uic
25508     1 sysop     95 fdclos/0   0:00  0.00%  0.00% -         uic
 3684     1 sysop     85 fdclos/0   0:00  0.00%  0.00% -         uic
 7410     1 sysop     85 fdclos/0   0:00  0.00%  0.00% -         uic
19371     1 sysop     85 fdclos/0   0:00  0.00%  0.00% -         uic
13609     1 sysop     85 fdclos/0   0:00  0.00%  0.00% -         uic
 3298     1 sysop     85 fdclos/0   0:00  0.00%  0.00% -         uic

This only occurs on systems with modular Xorg
("meta-pkgs/modular-xorg").

Systems with native Xorg do not exhibit this problem.

>How-To-Repeat:
Attempt to build "x11/qt3-tools" on i386-8.0_BETA or i386-8.99.1 systems
with modular Xorg.
>Fix:
Please.

>Release-Note:

>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Tue, 1 Aug 2017 22:39:38 -0500 (CDT)

 The stuck 'uic' processes are unkillable, resisting even "-KILL".

 Attaching 'ktruss' to one of them produces no output.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Wed, 2 Aug 2017 11:35:42 -0500 (CDT)

 After rebooting, I restricted MAKE_JOBS to 1 for "qt3-tools".  The build
 gets stuck in the same place:

 [...]
 cd designer && /usr/pkg/bin/gmake -f Makefile
 gmake[3]: Entering directory '/tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/tools/designer/designer'
 /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /tmp/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins listboxeditor.ui -o listboxeditor.h


 Pressing Ctrl-T reports:

 load: 0.00  cmd: sh 28007 [wait] 0.00u 0.00s 0% 1288k
 make: Working in: /x/pkgsrc-2017Q2/x11/qt3-tools
 make[1]: Working in: /x/pkgsrc-2017Q2/x11/qt3-tools

 and 'top' reports:

 $ top -nt | grep uic
   278     1 sysop     81 fdclos/0   0:00  0.00%  0.00% -         uic


 So far the problem has manifested only on NetBSD-8.0_BETA or -8.99.1
 with modular Xorg on i386.  A test with NetBSD-7.1_STABLE-i386 and
 modular Xorg is in progress.

 I normally have no need of modular Xorg on amd64, but perhaps a test
 setup can be arranged.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Wed, 2 Aug 2017 17:14:45 -0500 (CDT)

 Rebooting to clear out the stuck 'uic' processes then executing the
 same command line under 'ktruss' shows:

 $ cd /d0/build/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/tools/designer/designer
 $ ktruss /d0/build/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic -L /d0/build/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/plugins listboxeditor.ui -o listboxeditor.h
    825      1 ktruss   fcntl(0x4, 0x3, 0)          = 4194305
    825      1 ktruss   emul(netbsd)
    825      1 ktruss   fcntl(0x4, 0x4, 0x400001)   = 0
    825      1 uic      execve("/d0/build/pkgsrc/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic", 0xbfbe1884, 0xbfbe18a0) JUSTRETURN
    825      1 uic      emul(netbsd)
    825      1 uic      mmap(0, 0x8000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xadcd7000
    825      1 uic      open("/etc/ld.so.conf", 0, 0) = 3
    825      1 uic      read(0x3, 0xbfbd8144, 0x80) = 70
        "libm.so.0\tmachdep.fpu_present\t1:libm387.so.0,libm.so.0\n/usr/local/"
    825      1 uic      close(0x3)                  = 0
    825      1 uic      open("/usr/local/lib/libqt-mt.so.3", 0, 0) Err#2 ENOENT
    825      1 uic      open("/usr/pkg/lib/libqt-mt.so.3", 0, 0) Err#2 ENOENT
    825      1 uic      open("/usr/pkg/qt3/lib/libqt-mt.so.3", 0, 0) = 3
    825      1 uic      __fstat50(0x3, 0xbfbd7e6c)  = 0
    825      1 uic      mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xadcd6000
    825      1 uic      munmap(0xadcd6000, 0x1000)  = 0
    825      1 uic      mmap(0, 0x717000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xad5c0000
    825      1 uic      mmap(0xadc96000, 0x3e000, 0x3, 0x12, 0x3, 0, 0x6d6000, 0) = 0xadc96000
    825      1 uic      mmap(0xadcd4000, 0x3000, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xadcd4000
    825      1 uic      close(0x3)                  = 0
    825      1 uic      open("/usr/local/lib/libpng16.so.16", 0, 0xbfbd7e6c) Err#2 ENOENT
    825      1 uic      open("/usr/pkg/lib/libpng16.so.16", 0, 0xbfbd7e6c) = 3
    825      1 uic      __fstat50(0x3, 0xbfbd7e6c)  = 0
    825      1 uic      mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xad5bf000
    825      1 uic      munmap(0xad5bf000, 0x1000)  = 0
    825      1 uic      mmap(0, 0x33000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xad58d000
    825      1 uic      mmap(0xad5bf000, 0x1000, 0x3, 0x12, 0x3, 0, 0x31000, 0) = 0xad5bf000
    825      1 uic      mmap(0xad5c0000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xad5c0000
    825      1 uic      close(0x3)                  = 0
    825      1 uic      open("/usr/local/lib/libGLU.so.1", 0, 0xbfbd7e6c) Err#2 ENOENT
    825      1 uic      open("/usr/pkg/lib/libGLU.so.1", 0, 0xbfbd7e6c) = 3
    825      1 uic      __fstat50(0x3, 0xbfbd7e6c)  = 0
    825      1 uic      mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xad58c000
    825      1 uic      munmap(0xad58c000, 0x1000)  = 0
    825      1 uic      mmap(0, 0x81000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xad50c000
    825      1 uic      mmap(0xad58c000, 0x1000, 0x3, 0x12, 0x3, 0, 0x80000, 0) = 0xad58c000
    825      1 uic      mmap(0xad58d000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xad58d000
    825      1 uic      close(0x3)                  = 0
    825      1 uic      open("/usr/local/lib/libGL.so.1", 0, 0xbfbd7e6c) Err#2 ENOENT
    825      1 uic      open("/usr/pkg/lib/libGL.so.1", 0, 0xbfbd7e6c) = 3
    825      1 uic      __fstat50(0x3, 0xbfbd7e6c)  = 0
    825      1 uic      mmap(0, 0x9000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xad503000
    825      1 uic      mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xad502000
    825      1 uic      munmap(0xad502000, 0x1000)  = 0
    825      1 uic      mmap(0, 0x67000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xad49c000
    825      1 uic      mmap(0xad4f5000, 0xe000, 0x7, 0x12, 0x3, 0, 0x58000, 0) Err#13 EACCES
    825      1 uic      munmap(0xad49c000, 0x67000) = 0
 [stuck here]

 The EACCESS result from "mmap()" suggests perhaps a PAX MPROTECT issue?

 Setting:

   paxctl +m ${WRKOBJDIR}/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic

 Allowed it to complete.  Again, this is only needed when using modular
 Xorg.

 "qt4-tools" also builds a 'uic' tool but it does not exhibit any problem
 with modular Xorg.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Wed, 2 Aug 2017 21:41:43 -0500 (CDT)

 On Wed, 2 Aug 2017, John D. Baker wrote:

 > Setting:
 > 
 >   paxctl +m ${WRKOBJDIR}/x11/qt3-tools/work/qt-x11-free-3.3.8/bin/uic
 > 
 > Allowed it to complete.  Again, this is only needed when using modular
 > Xorg.

 I've been trying to figure out how to automate this.  Qt being what it is,

   ${WRKSRC}/tools/designer/uic/Makefile

 is generated during the "configure" phase.  A suitable SUBST arrangement
 should do the trick, but my 'sed'-foo is weak.  By itself, the following:

 sed '/-o \$(TARGET)/a\
 	paxctl +m $(TARGET)
 '

 would add the necessary bits, but trying to cast it into something that
 will satisfy both 'sed' and 'make' has been elusive so far.  Something
 like:

 .if !empty(MACHINE_PLATFORM:MNetBSD-[89].*-i386)
 SUBST_CLASSES+=		mprotect
 SUBST_STAGE.mprotect=	post-configure
 SUBST_MESSAGE.mprotect=	Arrange for PAX MPROTECT flags
 SUBST_FILES.mprotect=	${WRKSRC}/tools/designer/uic/Makefile
 SUBST_SED.mprotect=	-e '/-o \$$(TARGET)/a\
 	paxctl +m $(TARGET)
 '
 .endif

 except the above "SUBST_SED" program won't satisfy both 'make' and 'sed'
 at the same time.  As I said, my 'sed'-foo is weak.

 Another mechanism is to do something in a "post-configure:" target, but
 again, getting 'sed' and 'make' to both be happy is being elusive.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Wed, 2 Aug 2017 22:59:42 -0500 (CDT)

 On Wed, 2 Aug 2017, John D. Baker wrote:

 > Rebooting to clear out the stuck 'uic' processes then executing the
 > same command line under 'ktruss' shows:
 [snip]
 > 
 > The EACCESS result from "mmap()" suggests perhaps a PAX MPROTECT issue?

 I've just noticed the same issue with 'mplayer'.  As with 'uic', it hangs
 trying to "mmap()" the file descriptor previously obtained by opening
 ""/usr/pkg/lib/libGL.so.1".

 [...]
    105      1 mplayer  open("/usr/pkg/lib/libGL.so.1", 0, 0xbfb53350) = 3
    105      1 mplayer  __fstat50(0x3, 0xbfb53350)  = 0
    105      1 mplayer  mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xb125b000
    105      1 mplayer  munmap(0xb125b000, 0x1000)  = 0
    105      1 mplayer  mmap(0, 0x67000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xb11f5000
    105      1 mplayer  mmap(0xb124e000, 0xe000, 0x7, 0x12, 0x3, 0, 0x58000, 0) Err#13 EACCES
    105      1 mplayer  munmap(0xb11f5000, 0x67000) = 0
 [hangs here]

 Again, this only occurs with modular Xorg.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Thu, 3 Aug 2017 11:28:39 +0200

 On Thu, Aug 03, 2017 at 04:00:01AM +0000, John D. Baker wrote:
 > The following reply was made to PR pkg/52452; it has been noted by GNATS.
 > 
 > From: "John D. Baker" <jdbaker@mylinuxisp.com>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 >  Xorg on i386-8.0_BETA and i386-8.99.1
 > Date: Wed, 2 Aug 2017 22:59:42 -0500 (CDT)
 > 
 >  On Wed, 2 Aug 2017, John D. Baker wrote:
 >  
 >  > Rebooting to clear out the stuck 'uic' processes then executing the
 >  > same command line under 'ktruss' shows:
 >  [snip]
 >  > 
 >  > The EACCESS result from "mmap()" suggests perhaps a PAX MPROTECT issue?
 >  
 >  I've just noticed the same issue with 'mplayer'.  As with 'uic', it hangs
 >  trying to "mmap()" the file descriptor previously obtained by opening
 >  ""/usr/pkg/lib/libGL.so.1".
 >  
 >  [...]
 >     105      1 mplayer  open("/usr/pkg/lib/libGL.so.1", 0, 0xbfb53350) = 3
 >     105      1 mplayer  __fstat50(0x3, 0xbfb53350)  = 0
 >     105      1 mplayer  mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xb125b000
 >     105      1 mplayer  munmap(0xb125b000, 0x1000)  = 0
 >     105      1 mplayer  mmap(0, 0x67000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xb11f5000
 >     105      1 mplayer  mmap(0xb124e000, 0xe000, 0x7, 0x12, 0x3, 0, 0x58000, 0) Err#13 EACCES
                                                    ^ this is an RWX mapping?

 Can you run it in GDB with a break point on mmap and figure out where
 that call is from?

 Joerg

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sat, 19 Aug 2017 19:11:54 -0500 (CDT)

 On Thu, 3 Aug 2017, Joerg Sonnenberger wrote:
 >  >  On Wed, 2 Aug 2017, John D. Baker wrote:
 >  >  
 >  >     105      1 mplayer  mmap(0xb124e000, 0xe000, 0x7, 0x12, 0x3, 0, 0x58000, 0) Err#13 EACCES
 >                                                     ^ this is an RWX mapping?
 >  
 >  Can you run it in GDB with a break point on mmap and figure out where
 >  that call is from?

 I instead hacked on "qt3-tools" to build 'uic' with debugging symbols
 and ran it under 'gdb', since the behavior is the same as in mplayer
 (and modular/pkgsrc 'Xorg').

 Results as follows:

 [...]
 (gdb) cont
 Continuing.

 Breakpoint 1, _mmap (addr=addr@entry=0xae6f6000, len=len@entry=57344, 
     prot=prot@entry=7, flags=flags@entry=18, fd=fd@entry=3, offset=360448)
     at /x/current/src/lib/libc/sys/mmap.c:59
 59      {
 (gdb) bt
 #0  _mmap (addr=addr@entry=0xae6f6000, len=len@entry=57344, prot=prot@entry=7, 
     flags=flags@entry=18, fd=fd@entry=3, offset=360448)
     at /x/current/src/lib/libc/sys/mmap.c:59
 #1  0xbab0f251 in _rtld_map_object (
     path=path@entry=0xbfb6efac "/usr/pkg/lib/libGL.so.1", fd=fd@entry=3, 
     sb=sb@entry=0xbfb6eef0)
     at /x/current/src/libexec/ld.elf_so/map_object.c:364
 #2  0xbab0fbb5 in _rtld_load_object (
     filepath=filepath@entry=0xbfb6efac "/usr/pkg/lib/libGL.so.1", 
     flags=flags@entry=2) at /x/current/src/libexec/ld.elf_so/load.c:160
 #3  0xbab1039a in _rtld_search_library_path (
     name=name@entry=0x804c3b6 "libGL.so.1", namelen=namelen@entry=10, 
     dir=<optimized out>, dirlen=12, flags=flags@entry=2)
     at /x/current/src/libexec/ld.elf_so/search.c:96
 #4  0xbab105d6 in _rtld_load_library (name=name@entry=0x804c3b6 "libGL.so.1", 
     refobj=refobj@entry=0xaeedd000, flags=flags@entry=2)
     at /x/current/src/libexec/ld.elf_so/search.c:153
 #5  0xbab0ffcf in _rtld_load_by_name (flags=2, needed=<synthetic pointer>, 
     obj=0xaeedd000, name=0x804c3b6 "libGL.so.1")
     at /x/current/src/libexec/ld.elf_so/load.c:299
 #6  _rtld_load_needed_objects (first=0xaeedd000, flags=flags@entry=2)
     at /x/current/src/libexec/ld.elf_so/load.c:323
 #7  0xbab0ae52 in _rtld (sp=<optimized out>, relocbase=3132129280)
     at /x/current/src/libexec/ld.elf_so/rtld.c:692
 #8  0xbab084aa in .rtld_start () from /usr/libexec/ld.elf_so
 (gdb) 

 Looks like it's 'ld.elf_so' that's trying to do a RWX mapping?

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sat, 19 Aug 2017 19:25:00 -0500 (CDT)

 On Sat, 19 Aug 2017, John D. Baker wrote:

 > I instead hacked on "qt3-tools" to build 'uic' with debugging symbols
 > and ran it under 'gdb', since the behavior is the same as in mplayer
 > (and modular/pkgsrc 'Xorg').

 Curiously, clearing the breakpoint and continuing the program under 'gdb'
 allowed it to complete successfully.

 Remaining in 'gdb' and running the program with each subsequent input
 shown in the Makefile completes normally.

 Resuming 'make build' phase normally causes 'uic' to hang in "fdclose"
 on the next target it builds.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sun, 20 Aug 2017 04:22:54 +0200

 On Sun, Aug 20, 2017 at 12:30:01AM +0000, John D. Baker wrote:
 >  Curiously, clearing the breakpoint and continuing the program under 'gdb'
 >  allowed it to complete successfully.

 ptrace implicitly disables mprotect.

 Joerg

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sun, 20 Aug 2017 04:23:42 +0200

 On Sun, Aug 20, 2017 at 12:15:01AM +0000, John D. Baker wrote:
 >  Looks like it's 'ld.elf_so' that's trying to do a RWX mapping?

 That would likely mean that the library has a text relocation or so. Can
 you put it somewhere for download?

 Joerg

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sat, 19 Aug 2017 22:04:46 -0500 (CDT)

 On Sun, 20 Aug 2017, Joerg Sonnenberger wrote:

 >  On Sun, Aug 20, 2017 at 12:15:01AM +0000, John D. Baker wrote:
 >  >  Looks like it's 'ld.elf_so' that's trying to do a RWX mapping?
 >  
 >  That would likely mean that the library has a text relocation or so. Can
 >  you put it somewhere for download?

 Find it here:

   http://bobdbob.com/~jdbaker/nbsd-debug/i386nb9mod/libGL.so.1.2.0

 Normally lives in "/usr/pkg/lib" on an i386-8.99.1 system.

 Is it necessary to install shared-object libraries with mode a+x?  That's
 how everything in "/usr/pkg/lib" is set.  Seems fraught to me.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sun, 20 Aug 2017 09:30:38 +0200

 --nFreZHaLTZJo0R7j
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 On Sun, Aug 20, 2017 at 03:10:00AM +0000, John D. Baker wrote:
 > The following reply was made to PR pkg/52452; it has been noted by GNATS.
 > 
 > From: "John D. Baker" <jdbaker@mylinuxisp.com>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 >  Xorg on i386-8.0_BETA and i386-8.99.1
 > Date: Sat, 19 Aug 2017 22:04:46 -0500 (CDT)
 > 
 >  On Sun, 20 Aug 2017, Joerg Sonnenberger wrote:
 >  
 >  >  On Sun, Aug 20, 2017 at 12:15:01AM +0000, John D. Baker wrote:
 >  >  >  Looks like it's 'ld.elf_so' that's trying to do a RWX mapping?
 >  >  
 >  >  That would likely mean that the library has a text relocation or so. Can
 >  >  you put it somewhere for download?
 >  
 >  Find it here:
 >  
 >    http://bobdbob.com/~jdbaker/nbsd-debug/i386nb9mod/libGL.so.1.2.0

 Try rebuilding MesaLib with the attached patch please.

 >  Is it necessary to install shared-object libraries with mode a+x?  That's
 >  how everything in "/usr/pkg/lib" is set.  Seems fraught to me.

 Historic practise.

 Joerg

 --nFreZHaLTZJo0R7j
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="Makefile.diff"

 Index: Makefile
 ===================================================================
 RCS file: /home/joerg/repo/netbsd/pkgsrc/graphics/MesaLib/Makefile,v
 retrieving revision 1.137
 diff -u -p -r1.137 Makefile
 --- Makefile	22 Mar 2017 20:22:31 -0000	1.137
 +++ Makefile	20 Aug 2017 07:29:34 -0000
 @@ -2,7 +2,7 @@

  DISTNAME=	mesa-11.2.2
  PKGNAME=	${DISTNAME:S/mesa/MesaLib/}
 -PKGREVISION=	5
 +PKGREVISION=	6
  CATEGORIES=	graphics x11
  MASTER_SITES=	ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
  EXTRACT_SUFX=	.tar.xz
 @@ -61,6 +61,10 @@ SUBST_SED.drirc+=		 -e 's|/etc/|${PREFIX
  .include "../../mk/compiler.mk"
  .include "options.mk"

 +.if ${MACHINE_ARCH} == "i386"
 +CONFIGURE_ARGS+=	--enable-glx-read-only-text
 +.endif
 +
  .if !empty(PKGSRC_COMPILER:Mclang)
  SUBST_CLASSES+=		tr1
  SUBST_STAGE.tr1=	pre-configure

 --nFreZHaLTZJo0R7j--

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sun, 20 Aug 2017 09:15:30 -0500 (CDT)

 On Sun, 20 Aug 2017, Joerg Sonnenberger wrote:

 >  Try rebuilding MesaLib with the attached patch please.

 Done.

 Subsequent attempt building "x11/qt3-tools" succeeds.  Excerpt from
 'ktrace':

 [...]
  13353      1 uic      open("/usr/pkg/lib/libGL.so.1", 0, 0xbfb90b10) = 3
  13353      1 uic      __fstat50(0x3, 0xbfb90b10)  = 0
  13353      1 uic      mmap(0, 0x9000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xb2ca6000
  13353      1 uic      mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xb2ca5000
  13353      1 uic      munmap(0xb2ca5000, 0x1000)  = 0
  13353      1 uic      mmap(0, 0x66000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xb2c40000
  13353      1 uic      mmap(0xb2ca4000, 0x2000, 0x3, 0x12, 0x3, 0, 0x64000, 0) = 0xb2ca4000
  13353      1 uic      mmap(0xb2ca6000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xb2ca6000
  13353      1 uic      close(0x3)                  = 0
 [...]

 Will check 'mplayer' (modulo 'ffmpeg3' text relocations) and 'Xorg' soon. 

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52452: qt3-tools build 'uic' stuck in "fdclose" w/modular
 Xorg on i386-8.0_BETA and i386-8.99.1
Date: Sun, 20 Aug 2017 12:10:07 -0500 (CDT)

 On Sun, 20 Aug 2017, John D. Baker wrote:

 > Will check 'mplayer' (modulo 'ffmpeg3' text relocations) and 'Xorg' soon. 

 'mplayer' gets past this hurdle:

 [...]
   4554      1 mplayer  open("/usr/pkg/lib/libGL.so.1", 0, 0xbfbeb7e0) = 3
   4554      1 mplayer  __fstat50(0x3, 0xbfbeb7e0)  = 0
   4554      1 mplayer  mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xb5aaf000
   4554      1 mplayer  munmap(0xb5aaf000, 0x1000)  = 0
   4554      1 mplayer  mmap(0, 0x66000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xb5a4a000
   4554      1 mplayer  mmap(0xb5aae000, 0x2000, 0x3, 0x12, 0x3, 0, 0x64000, 0) = 0xb5aae000
   4554      1 mplayer  mmap(0xb5ab0000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xb5ab0000
   4554      1 mplayer  close(0x3)                  = 0
 [...]

 but ultimately fails due to text relocations and attempt to write-enable
 a text segment.  That's likely a topic for a different PR.

 Modular Xorg no-longer hangs in "fdclose", but now segfaults.  Excerpt
 from "Xorg.0.log":

 [...]
 [ 65749.280] (II) Using input driver 'kbd' for '<default keyboard>'
 [ 65749.280] (**) Option "CoreKeyboard" "on"
 [ 65749.280] (**) <default keyboard>: always reports core events
 [ 65749.280] (**) <default keyboard>: always reports core events
 [ 65749.281] (**) Option "Protocol" "standard"
 [ 65749.281] (**) Option "XkbRules" "base"
 [ 65749.281] (**) Option "XkbModel" "pc105"
 [ 65749.281] (**) Option "XkbLayout" "us"
 [ 65749.281] (II) XINPUT: Adding extended input device "<default keyboard>" (type: KEYBOARD, id 7)
 [ 65749.303] (EE) Segmentation fault at address 0x4
 [ 65749.306] (EE) 
 Fatal server error:
 [ 65749.306] (EE) Caught signal 11 (Segmentation fault). Server aborting
 [ 65749.307] (EE) 
 [ 65749.307] (EE) 
 Please consult the The X.Org Foundation support 
          at http://wiki.x.org
  for help. 
 [ 65749.307] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
 [ 65749.308] (EE) 
 [ 65750.402] (EE) Server terminated with error (1). Closing log file.


 It did not leave a core file.  This, too, is likely a topic for a
 different PR.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 28 Apr 2018 08:31:48 +0000
State-Changed-Why:
The problem here was fixed by the patch, and the patch got committed.
Please do file the other issues you hit (if you haven't already...)


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