NetBSD Problem Report #52496

From www@NetBSD.org  Sun Aug 20 23:24:29 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 8750F7A17B
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 Aug 2017 23:24:29 +0000 (UTC)
Message-Id: <20170820232428.711FF7A27C@mollari.NetBSD.org>
Date: Sun, 20 Aug 2017 23:24:28 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@consolidated.net
To: gnats-bugs@NetBSD.org
Subject: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
X-Send-Pr-Version: www-1.0

>Number:         52496
>Notify-List:    jdbaker@consolidated.net
>Category:       pkg
>Synopsis:       modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 20 23:25:00 +0000 2017
>Last-Modified:  Tue Jan 29 06:32:07 +0000 2019
>Originator:     John D. Baker
>Release:        NetBSD/i386-8.99.1, NetBSD/i386-8.0_BETA, pkgsrc-2017Q2
>Organization:
>Environment:
NetBSD verthandi 8.99.1 NetBSD 8.99.1 (VERTHANDI) #5: Fri Aug 18 12:12:32 CDT 2017  sysop@x3650.technoskunk.fur:/r1/build/current/obj/i386/sys/arch/i386/compile/VERTHANDI i386

>Description:
Once the following change:

  http://mail-index.netbsd.org/pkgsrc-changes/2017/08/20/msg161829.html

has been implemented and "graphics/MesaLib" rebuilt, the 'Xorg' server
fails with a segmentation fault.  Rebuilding with the "debug" option
and running under 'gdb' produces the following:

[...]
input-thread: registered device 9
client(0): Reserved pid(15928).
client(0): Reserved cmdname(/usr/pkg/bin/Xorg) and cmdargs(-retro).
input-thread: creating thread
[New LWP 2]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000004 in ?? ()
(gdb) bt
#0  0x00000004 in ?? ()
#1  0x08192b7e in DRIBlockHandler (blockData=0x0, pTimeout=0xbfb9fbb8)
    at dri.c:1673
#2  0x08077e8c in BlockHandler (pTimeout=pTimeout@entry=0xbfb9fbb8)
    at dixutils.c:388
#3  0x081c5118 in WaitForSomething (are_ready=<optimized out>) at WaitFor.c:219
#4  0x0807300c in Dispatch () at dispatch.c:422
#5  0x0807752f in dix_main (argc=argc@entry=2, argv=argv@entry=0xbfb9fcdc, 
    envp=envp@entry=0xbfb9fce8) at main.c:287
#6  0x081de9ea in main (argc=2, argv=0xbfb9fcdc, envp=0xbfb9fce8)
    at stubmain.c:34

The 'gdb' session hangs on exit and must be kill()ed with "-9".

In case it matters, the machine on which this test is run has an
ATI Rage 128 video card and the kernel is built without any DRMKMS
drivers and with the UMS "r128drm" driver included.
>How-To-Repeat:
Starting with pkgsrc-2017Q2, update "graphics/MesaLib" to HEAD and
replace.

Attempt to start modular Xorg ('X' or 'Xorg').

>Fix:

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52496: modular-xorg-server segfaults on i386-8.99.1,
 -8.0_BETA
Date: Mon, 21 Aug 2017 04:28:34 +0000

 > without any DRMKMS drivers and with the UMS "r128drm" driver included.

 That seems like a dead end...
 - Try the olddrm drivers - they're commented out in GENERIC (radeondrm*
   at drm?)
 - Open a separate bug report for why you're not using the newer DRMKMS
   drivers?
 - Use old Xorg/MesaLib in pkgsrc, or in netbsd base

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Mon, 21 Aug 2017 01:12:43 -0500 (CDT)

 On Mon, 21 Aug 2017, coypu@sdf.org wrote:

 >  > without any DRMKMS drivers and with the UMS "r128drm" driver included.
 >  
 >  That seems like a dead end...
 >  - Try the olddrm drivers - they're commented out in GENERIC (radeondrm*
 >    at drm?)

 That's what I'm using.  The "old drm" drivers are UMS.  As this particular
 machine has a Rage 128 card, the correct driver is "r128drm* at drm?".
 It works fine with native Xorg on netbsd-7.  It used to work fine on
 7.99.x before the Xorg r128 driver was up-de-graded.  It then worked fine
 with modular/pkgsrc Xorg until PAX MPROTECT was enabled by default.

 >  - Open a separate bug report for why you're not using the newer DRMKMS
 >    drivers?

 There are no DRMKMS drivers for the ATI Rage 128 cards.  Only radeons,
 and then only if they are new enough (most of mine are not).  Of those
 are are new enough, they are AGP cards and have "issues"...

 >  - Use old Xorg/MesaLib in pkgsrc, or in netbsd base

 Modular/pkgsrc Xorg worked fine before PAX MPROTECT was turned on.
 The MesaLib problem appears to be fixed in pkgsrc-HEAD.

 "native" Xorg was broken on Rage 128 and intel i810e devices for a while,
 but works now (still broken for i810e w/GCC 4.8.x).

 So I no-longer have a need for modular Xorg on anything except i810e
 machines running netbsd-7.

 Thought I'd do something constructive instead of just 'rm -rf' all of
 my -8 and -current modular/pkgsrc Xorg setups.

 Perhaps I'll try -current with modular Xorg on the i810e systems as they
 have no DRM drivers at all to confuse the issue.

 -- 
 |/"\ 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/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Mon, 21 Aug 2017 09:48:21 -0500 (CDT)

 FWIW, I visited the test system's console this morning and the X server
 did manage to correctly initialize the screen before it segfaulted.  As
 I ran it with the "-retro" option, the screen displayed the classic
 "root weave" pattern with the "X" cursor in the middle of the screen.

 -- 
 |/"\ 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/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Mon, 21 Aug 2017 15:28:06 -0500 (CDT)

 On Mon, 21 Aug 2017, John D. Baker wrote:

 > Perhaps I'll try -current with modular Xorg on the i810e systems as they
 > have no DRM drivers at all to confuse the issue.

 The i810e-based machine had no problems with modular Xorg server.  Note
 that updating "graphics/MesaLib" to pkgsrc-HEAD was necessary before this
 could happen.

 This would seem to indicate that modular-xorg-server-1.19.3 can't cope
 with the old "r128drm* at drm?".  It used to work, but I haven't checked
 very often--I just use that machine to build the packages.

 I'll try again booting the Rage128-equipped machine with GENERIC which
 will effectively mean _no_ DRM drivers of any kind.

 Might also be useful to re-check with netbsd-7.

 -- 
 |/"\ 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/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Tue, 22 Aug 2017 10:02:26 -0500 (CDT)

 On Mon, 21 Aug 2017, John D. Baker wrote:

 > I'll try again booting the Rage128-equipped machine with GENERIC which
 > will effectively mean _no_ DRM drivers of any kind.

 The first attempt locked the machine up hard and there was only one line
 in "Xorg.0.log".  It was not helpful.

 After rebooting and cleaning up, logging in via SSH and running the X
 server under 'gdb' seems to have worked.  The display is properly
 initialized, mouse and keyboard respond.  Clients can connect and display.

 First 'twm' was launched with:

   $ twm -display :0 &

 Then, from the 'twm' menu, 'xterm' was launched.  Using the XTerm,
 'xrdb -merge .Xresources' was run.  The XTerm was closed and a new
 one opened, reflecting the preferences in .Xresources.

 The XTerm was closed, and 'twm' told to exit via its menu.  Immediately
 the display froze.  The 'gdb' session reported:

 [...]
 Thread 2 received signal SIGPIPE, Broken pipe.
 [Switching to LWP 2]
 0xaeda0df7 in poll () from /usr/lib/libc.so.12
 (gdb) 
 (gdb) 
 (gdb) bt
 #0  0xaeda0df7 in poll () from /usr/lib/libc.so.12
 #1  0xaeef9beb in poll (fds=0xa85e3000, nfds=3, timeout=timeout@entry=-1)
     at /x/current/src/lib/libpthread/pthread_cancelstub.c:412
 #2  0x081cba5d in ospoll_wait (ospoll=0xae877340, timeout=timeout@entry=-1)
     at ospoll.c:417
 #3  0x081c9457 in InputThreadDoWork (arg=0x0) at inputthread.c:367
 #4  0xaeefec33 in pthread__create_tramp (cookie=0xa85e2000)
     at /x/current/src/lib/libpthread/pthread.c:593
 #5  0xaedf4060 in __mknod50 () from /usr/lib/libc.so.12
 #6  0xa85e2000 in ?? ()
 Backtrace stopped: previous frame inner to this frame (corrupt stack?)

 -- 
 |/"\ 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/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Tue, 22 Aug 2017 11:01:33 -0500 (CDT)

 On Tue, 22 Aug 2017, John D. Baker wrote:

 > The XTerm was closed, and 'twm' told to exit via its menu.  Immediately
 > the display froze.  The 'gdb' session reported:
 > 
 > [...]
 > Thread 2 received signal SIGPIPE, Broken pipe.

 After killing the 'gdb' session, starting X normally worked properly.

 Similarly to PR xsrc/50599, the r128 driver and/or X server claim only
 to see a DVI output when the card has none.  Nevertheless, it proceeds
 to recover EDID data and a plethora of modes, allegedly from the monitor.
 It reports DDC capability, but claims the DDC read attempt failed.  The
 only mode it will choose by default is 2048x1536x85 which is out of
 range of any monitor I have.  (The CRT it is presently using will do
 2048x1536x60 and an LCD I tested it with will only do 1440x900x75,
 1440x900x60 and smaller, but the driver always picks 2048x1536x85.)

 Therefore, a minimal "xorg.conf" is needed with a Monitor section to
 describe the timings and available modes and a Screen section using that
 monitor with a Display subsection to list the preferred modes.

 Will try again with the custom kernel with "r128drm* at drm?", although
 that may wait until the latest update to -current is finished building.

 -- 
 |/"\ 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: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52496: modular-xorg-server segfaults on i386-8.99.1,
 -8.0_BETA
Date: Wed, 23 Aug 2017 04:37:13 +0000

 drm2 does have Rage128 code under src/sys/external/bsd/drm2/dist/drm/r128

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52496: modular-xorg-server segfaults on i386-8.99.1, -8.0_BETA
Date: Wed, 23 Aug 2017 13:54:11 -0500 (CDT)

 On Tue, 22 Aug 2017, John D. Baker wrote:

 > Will try again with the custom kernel with "r128drm* at drm?", although
 > that may wait until the latest update to -current is finished building.

 *sigh*

 Now it works just fine.  Must have been PoM/sunspots/swamp gas/etc.

 Will re-check after further updates.  In the meantime, rebuild
 modular-xorg-server w/o "debug" option so it'll be less SPAM-y, but
 keep debugging symbols.

 -- 
 |/"\ 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

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