NetBSD Problem Report #55984

From rhialto@falu.nl  Tue Feb  9 21:18:39 2021
Return-Path: <rhialto@falu.nl>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 65B771A9217
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  9 Feb 2021 21:18:39 +0000 (UTC)
Message-Id: <202102092118.119LISnX006342@murthe.falu.nl>
Date: Tue, 9 Feb 2021 22:18:28 +0100 (CET)
From: rhialto@falu.nl
Reply-To: rhialto@falu.nl
To: gnats-bugs@NetBSD.org
Cc: rhialto@falu.nl
Subject: OpenGL works in gdb, window remains black when run normally
X-Send-Pr-Version: 3.95

>Number:         55984
>Category:       xsrc
>Synopsis:       OpenGL works in gdb, remains black when run normally
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 09 21:20:00 +0000 2021
>Last-Modified:  Wed Feb 10 18:20:01 +0000 2021
>Originator:     Rhialto
>Release:        NetBSD 9.1
>Organization:
>Environment:
System: NetBSD murthe.falu.nl 9.1 NetBSD 9.1 (GENERIC) #0: Sun Oct 18 19:24:30 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
    With the Amiga emulator emulators/fs-uae, I have the following problem.
    Tried with pkgsrc-2020Q4 but the problem exists for a while, probably
    since I updated to NetBSD-9.0.

    - If I run it normally, I get a black (emulated) screen.
    - If I run it from gdb, it appears to work. At least the user
      interface is visible, and if you have a (non-free) Kickstart
      image, I get the boot screen. With a (free) AROS kickstart
      replacement, I get at least the GUI.
    - I have Driver "radeon" in my xorg.conf; probably #Driver
      "modesetting" didn't work so well.
      [    31.845] (--) RADEON(0): Chipset: "ATI Radeon HD 5450" (ChipID = 0x68f9)
    - It also fails on my laptop with Intel i945 chipset and Driver
      "modesetting" (where the "intel" driver failed horribly in
      general).
    - I'm using "native X" for both cases.
    - On all this hardware, fs-uae worked fine at some time in the past.
    - I have a report upstream but more likely it is a NetBSD problem;
      https://github.com/FrodeSolheim/fs-uae/issues/246

>How-To-Repeat:
    How to reproduce:

    - Build emulators/fs-uae
    - Run it once so that it sets up some directories in ~/FS-UAE
    - Obtain aros-rom.bin as follows:
      - on http://www.aros.org/nightly1.php download any version of
	amiga-m68k-boot-iso
      - unzip, and extract from the .iso image the file
	boot/amiga/aros-rom.bin
      - For your convenience I have placed the file at
	https://www.falu.nl/~rhialto/aros-rom.bin
    - Place aros-rom.bin in ~/FS-UAE/Kickstarts . We need it only as a
      ROM that gets accepted by fs-uae, it doesn't seem to work
      otherwise, at least in the test configuration.
    - Create the configuration file ~/FS-UAE/Configurations/Aros.fs-uae:

[fs-uae]
amiga_model = A1200
kickstart_file = aros-rom.bin

    - Run the command    fs-uae ~/FS-UAE/Configurations/Aros.fs-uae
    - Observe that you get a window that remains uniformly black.
    - When you press F12, nothing changes.
    - If your mouse gets captured, press the middle button to
      un-capture.
    - ^C this run.
    - Run the command    gdb --args fs-uae
      ~/FS-UAE/Configurations/Aros.fs-uae
    - Type "r" to the (gdb) prompt
    - Observe that you get at least a slightly-less black part in the
      center of the window and some stripes flash sometimes.
    - If you hit F12, you get the GUI and can quit normally (navigate to
      the X in the top right and hit enter)

    I wonder if this is somehow related to another weirdness I have
    observed in emulators/vice. Using the gtk3-version, the first time I
    start it after a (re)boot, it fails to initialize something with GL.
    The next time it works.
>Fix:
    Not known...

-Olaf.
-- 
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___  Anyone who is capable of getting themselves made President should on
\X/  no account be allowed to do the job.       --Douglas Adams, "THGTTG"

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/55984: OpenGL works in gdb, window remains black when run
 normally
Date: Wed, 10 Feb 2021 07:31:06 +0100

 On Tue, Feb 09, 2021 at 09:20:00PM +0000, rhialto@falu.nl wrote:
 >     - If I run it from gdb, it appears to work.

 Do you have sysctl security.pax.aslr.enabled and security.pax.aslr.global
 set to 1?

 If so, try to set them to 0 and test again?

 Martin

From: Rhialto <rhialto@falu.nl>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/55984: OpenGL works in gdb, window remains black when run
 normally
Date: Wed, 10 Feb 2021 19:15:17 +0100

 Ah yes, that is indeed a logical thing to think of when you see "it
 works in gdb". I did have indeed both those settings, but turning ASLR
 off didn't make a difference.

 If only output is failing, you'd expect that you could quit fs-uae with
 just F12 CursorUp Enter, but apparently input is somehow also affected.

 I guess I should add that I was using the pkgsrc version of GL (MesaLib).
 At some point in the past this was needed for some package or other, and
 I haven't rebuilt everything since to see if it is still needed. Here is
 the full list of libraries:

 murthe.9:.../fs-uae/work.x86_64/fs-uae-3.0.5$ ldd ./fs-uae
 ./fs-uae:
         -lgthread-2.0.0 => /usr/pkg/lib/libgthread-2.0.so.0
         -lglib-2.0.0 => /usr/pkg/lib/libglib-2.0.so.0
         -lpcre.1 => /usr/pkg/lib/libpcre.so.1
         -lc.12 => /usr/lib/libc.so.12
         -lintl.1 => /usr/lib/libintl.so.1
         -lpthread.1 => /usr/lib/libpthread.so.1
         -lopenal.1 => /usr/pkg/lib/libopenal.so.1
         -lossaudio.1 => /usr/lib/libossaudio.so.1
         -latomic.3 => /usr/pkg/gcc7/x86_64--netbsd/lib/./libatomic.so.3
         -lstdc++.7 => /usr/pkg/gcc7/x86_64--netbsd/lib/./libstdc++.so.7
         -lm.0 => /usr/lib/libm.so.0
         -lgcc_s.1 => /usr/lib/libgcc_s.so.1
         -lGL.1 => /usr/pkg/lib/libGL.so.1
         -lglapi.0 => /usr/pkg/lib/libglapi.so.0
         -ldrm.2 => /usr/pkg/lib/libdrm.so.2
         -lpci.2 => /usr/lib/libpci.so.2
         -lX11.7 => /usr/X11R7/lib/libX11.so.7
         -lxcb.2 => /usr/X11R7/lib/libxcb.so.2
         -lXau.7 => /usr/X11R7/lib/libXau.so.7
         -lXdmcp.7 => /usr/X11R7/lib/libXdmcp.so.7
         -lxcb-glx.0 => /usr/X11R7/lib/libxcb-glx.so.0
         -lX11-xcb.1 => /usr/X11R7/lib/libX11-xcb.so.1
         -lxcb-dri2.0 => /usr/X11R7/lib/libxcb-dri2.so.0
         -lXext.7 => /usr/X11R7/lib/libXext.so.7
         -lXfixes.4 => /usr/X11R7/lib/libXfixes.so.4
         -lXdamage.2 => /usr/X11R7/lib/libXdamage.so.2
         -lXxf86vm.2 => /usr/X11R7/lib/libXxf86vm.so.2
         -lexpat.2 => /usr/lib/libexpat.so.2
         -lxcb-dri3.0 => /usr/X11R7/lib/libxcb-dri3.so.0
         -lxcb-present.0 => /usr/X11R7/lib/libxcb-present.so.0
         -lxcb-sync.1 => /usr/X11R7/lib/libxcb-sync.so.1
         -lxshmfence.1 => /usr/X11R7/lib/libxshmfence.so.1
         -lrt.1 => /usr/lib/librt.so.1
         -lpng16.16 => /usr/pkg/lib/libpng16.so.16
         -lz.1 => /usr/lib/libz.so.1
         -lSDL2-2.0.0 => /usr/pkg/lib/libSDL2-2.0.so.0
         -lsamplerate.0 => /usr/pkg/lib/libsamplerate.so.0
         -lXcursor.2 => /usr/X11R7/lib/libXcursor.so.2
         -lXrender.2 => /usr/X11R7/lib/libXrender.so.2
         -lXinerama.2 => /usr/X11R7/lib/libXinerama.so.2
         -lXi.7 => /usr/X11R7/lib/libXi.so.7
         -lXrandr.3 => /usr/X11R7/lib/libXrandr.so.3
         -lXss.2 => /usr/X11R7/lib/libXss.so.2
         -lusbhid.1 => /usr/lib/libusbhid.so.1
         -lmpeg2.0 => /usr/pkg/lib/libmpeg2.so.0
         -lmpeg2convert.0 => /usr/pkg/lib/libmpeg2convert.so.0

 So I compiled a version with 

 PREFER.MesaLib = native
 PREFER.libdrm = ${PREFER.MesaLib}       # req'd by MesaLib
 PREFER.glu = ${PREFER.MesaLib}  # automatically correct for most; req'd for xscreensaver
 PREFER.glew = ${PREFER.MesaLib}
 PREFER.gle = ${PREFER.MesaLib}  # req'd by xscreensaver
 # GL (MesaLib), gle and glu should generally match up, PREFER-wise.

 murthe.9:.../fs-uae/work.x86_64/fs-uae-3.0.5$ ldd ./fs-uae
 ./fs-uae:
         -lgthread-2.0.0 => /usr/pkg/lib/libgthread-2.0.so.0
         -lglib-2.0.0 => /usr/pkg/lib/libglib-2.0.so.0
         -lpcre.1 => /usr/pkg/lib/libpcre.so.1
         -lc.12 => /usr/lib/libc.so.12
         -lintl.1 => /usr/lib/libintl.so.1
         -lpthread.1 => /usr/lib/libpthread.so.1
         -lopenal.1 => /usr/pkg/lib/libopenal.so.1
         -lossaudio.1 => /usr/lib/libossaudio.so.1
         -latomic.3 => /usr/pkg/gcc7/x86_64--netbsd/lib/./libatomic.so.3
         -lstdc++.7 => /usr/pkg/gcc7/x86_64--netbsd/lib/./libstdc++.so.7
         -lm.0 => /usr/lib/libm.so.0
         -lgcc_s.1 => /usr/lib/libgcc_s.so.1
         -lpng16.16 => /usr/pkg/lib/libpng16.so.16
         -lz.1 => /usr/lib/libz.so.1
         -lSDL2-2.0.0 => /usr/pkg/lib/libSDL2-2.0.so.0
         -lsamplerate.0 => /usr/pkg/lib/libsamplerate.so.0
         -lX11.7 => /usr/X11R7/lib/libX11.so.7
         -lxcb.2 => /usr/X11R7/lib/libxcb.so.2
         -lXau.7 => /usr/X11R7/lib/libXau.so.7
         -lXdmcp.7 => /usr/X11R7/lib/libXdmcp.so.7
         -lXext.7 => /usr/X11R7/lib/libXext.so.7
         -lXcursor.2 => /usr/X11R7/lib/libXcursor.so.2
         -lXrender.2 => /usr/X11R7/lib/libXrender.so.2
         -lXinerama.2 => /usr/X11R7/lib/libXinerama.so.2
         -lXi.7 => /usr/X11R7/lib/libXi.so.7
         -lXrandr.3 => /usr/X11R7/lib/libXrandr.so.3
         -lXss.2 => /usr/X11R7/lib/libXss.so.2
         -lXxf86vm.2 => /usr/X11R7/lib/libXxf86vm.so.2
         -lusbhid.1 => /usr/lib/libusbhid.so.1
         -lrt.1 => /usr/lib/librt.so.1
         -lmpeg2.0 => /usr/pkg/lib/libmpeg2.so.0
         -lmpeg2convert.0 => /usr/pkg/lib/libmpeg2convert.so.0

 (why don't I see -lGL here any more??)

 but this also didn't change the behaviour. Fails when run normally
 (even with ASLR off), runs fine from gdb...

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.