phabrics / nme

Next-generation Machine Emulator: This is the OFFICIAL repo for the new tme and will be updated here.
http://phabrics.com
Other
9 stars 1 forks source link

OSDN Ticket #47970: tmesh segv in tme_fb_xlat4 #6

Closed phabrics closed 1 year ago

phabrics commented 1 year ago

$ git config --get remote.origin.url https://aur.archlinux.org/tme.git $ git log --name-status HEAD^..HEAD commit 5b58821b7c9371e47e7c6f5c65ce5e84c38280d6 (HEAD -> master, origin/master, origin/HEAD) Author: Ruben Agin phabrics@phabrics.com Date: Sun Apr 30 04:06:18 2023 -0500

Add an external declaration to _tme_scanline_pad in display.c to force non-inlined definition inside of it, per gcc documentation. This should fix NME ticket #47963 hopefully.

$ git diff diff --git a/PKGBUILD b/PKGBUILD index a5b9f07..868393c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,7 +9,7 @@ url="http://phabrics.com" depends=('libvncserver' 'gtk4' 'sdl2') source=("https://osdn.net/dl/nme/${pkgname}-${pkgver}.tar.xz") sha256sums=('e2c90f7c63de196c7bf52c9b06f17e2ab9db86fa86d8c3ff3ee2360fb20914f8') -options=('libtool') +options=(libtool debug !strip) install=$pkgname.install

prepare() @@ -22,7 +22,7 @@ build() { cd "$pkgname-$pkgver" if test "x${CARCH}" = xx86_64; then

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/tmesh... (gdb) run MY-SUN3 Starting program: /usr/bin/tmesh MY-SUN3

This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.archlinux.org Enable debuginfod for this session? (y or [n]) [New Thread 0x7efe4e1ff6c0 (LWP 144548)] [Thread 0x7efe4e1ff6c0 (LWP 144548) exited] [New Thread 0x7efe4e1ff6c0 (LWP 144549)]

Thread 1 "tmesh" received signal SIGSEGV, Segmentation fault. 0x00007efe532c6d40 in tme_fb_xlat4 (src=0x55698fbfec70, dst=0x55698fc3c900) at /home/ambie/src/aur-tme/tme/src/tme-0.12rc10/generic/fb-xlat-auto.c:16650 warning: Source file is more recent than executable. 16650 TME_FB_XLAT_SHIFT_DST(dst_fifo0_may_be_unaligned, (gdb) l 16645 / we are now on the first pixel of the next scanline: / 16646 dst_x = 0; 16647 } 16648
16649 / shift the destination primary FIFO: / 16650 TME_FB_XLAT_SHIFT_DST(dst_fifo0_may_be_unaligned, 16651 dst_fifo0, 16652 dst_fifo0_next, 16653 dst_fifo0_bits, 16654 32, (gdb) where

0 0x00007efe532c6d40 in tme_fb_xlat4 (src=0x55698fbfec70, dst=0x55698fc3c900) at /home/ambie/src/aur-tme/tme/src/tme-0.12rc10/generic/fb-xlat-auto.c:16650

1 0x00007efe528186d9 in _tme_screen_update (screen=0x55698fd74070) at display.c:73

2 0x00007efe52818925 in tme_display_update (disp=0x55698fc3fe40) at display.c:229

3 0x00007efe52818a50 in tme_display_th_update (disp=0x55698fc3fe40) at display.c:265

4 0x00007efe5373747a in tme_sjlj_dispatch (passes=1) at threads-sjlj.c:385

5 0x00007efe5373775f in tme_sjlj_threads_main_iter (unused=0x0) at threads-sjlj.c:482

6 0x00007efe53732ba4 in tme_threads_run () at threads.c:118

7 0x000055698ee6f446 in main (argc=2, argv=0x7ffd5b31fae8) at tmesh.c:904

The MY-SUN3 configuration file is in this repo: https://github.com/ambiamber/Run-Sun3-SunOS-4.1.1 It was renamed from MY-SUN3 to just SUN3 there. I'm not using wayland.

$ echo $XDG_SESSION_TYPE x11

phabrics commented 1 year ago

I really appreciate you and I'm glad to help.

This is an image of the tmesh window running inside the Arch Linux KVM QEMU libvirt VM https://drive.google.com/file/d/1eCqQgwJCgkmP8j3POFwZhX6rHBNGLiy1/view

In the PKGBUILD for tme:

makedepends=('perl-x11-protocol') But yay doesn't display perl-x11-protocol as a Sync Dependency: AUR Explicit (1): tme-0.12rc10-1 Sync Dependency (3): libvncserver-0.9.14-2, gtk4-1:4.10.3-1, sdl2-2.26.5-1 In the ocrmypdf PKGBUILD python-wheel is only in makedepends.

NOTICE: The number of dependencies we rely on is very high. If the program does not run after an upgrade, make sure all your dep

s are upgraded, especially AUR deps! depends=('python' 'img2pdf' 'python-pillow>=7.0.0' 'tesseract' 'ghostscript' 'unpaper' 'pngquant' 'python-pikepdf' 'python-reportlab ' 'python-pdfminer' 'python-tqdm' 'python-pluggy' 'python-coloredlogs' 'python-importlib_resources' 'python-packaging')

makedepends=('python-setuptools-scm>=7.0.5' 'python-build' 'python-installer' 'python-wheel') optdepends=('jbig2enc: Better compression algorithm; results in smaller PDF files') Focusing on python-wheel, that package is not installed yet. [arch@tme ~]$ yay -Qii python-wheel error: package 'python-wheel' was not found The python-wheel package shows up on the "Sync Make Dependency" line: [arch@tme ~]$ yay -S ocrmypdf AUR Explicit (1): ocrmypdf-14.1.0-1 AUR Dependency (1): python-coloredlogs-15.0.1-3 Sync Dependency (15): unpaper-7.0.0-2, tesseract-5.3.1-1, python-pdfminer-20221105-2, python-pluggy-1.0.0-4, python-tqdm-4.65.0-3, python-packaging-23.0-3, img2pdf-0.4.4-5, python-importlib_resources-5.12.0-2, python-pikepdf-7.2.0-2, pngquant-3.0.1-3, ghostscript-10.01.1-1, python-reportlab-3.6.12-3, python-pillow-9.5.0-2, python-humanfriendly-10.0-5, python-3.11.3-1 Sync Make Dependency (6): python-build-0.10.0-3, python-installer-0.7.0-3, python-wheel-0.40.0-3, python-setuptools-scm-7.1.0-3, python-setuptools-1:67.7.0-1, python-sphinx-7.0.0-1 :: (1/2) Downloaded PKGBUILD: python-coloredlogs :: (2/2) Downloaded PKGBUILD: ocrmypdf 2 ocrmypdf (Build Files Exist) 1 python-coloredlogs (Build Files Exist) ==> Packages to cleanBuild? ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) The one thing I notice (and it might not be relevant) is that the ocrmypdf PKGBUILD puts depends= before makedepends= You're running tmesh over ssh aren't you?

XDG_SESSION_TYPE=tty When I tried to do that by using SSH into the VM it fails $ ssh -CY arch@tme ... skip ahead... [arch@tme Run-Sun3-SunOS-4.1.1]$ $ env | grep -E 'DISP|tty' XDG_SESSION_TYPE=tty DISPLAY=localhost:10.0

[arch@tme Run-Sun3-SunOS-4.1.1]$ tmesh SUN3 Thu May 4 12:43:39 2023 library versions: tmesh> source SUN3 libEGL warning: DRI3: failed to query the version libEGL warning: DRI2: failed to authenticate tmesh> ^C $ ssh -X arch@tme ... skip ahead ... [arch@tme Run-Sun3-SunOS-4.1.1]$ tmesh SUN3 Thu May 4 12:47:49 2023 library versions: tmesh> source SUN3

(process:887): Gdk-ERROR **: 12:47:49.328: XInput2 support not found on display Trace/breakpoint trap (core dumped) This is how I uninstall tme via yay: [arch@tme ~]$ yay -R tme checking dependencies...

Packages (1) tme-0.12rc10-1

Total Removed Size: 2.89 MiB

:: Do you want to remove these packages? [Y/n] :: Running pre-transaction hooks... (1/1) Removing old entries from the info directory file... :: Processing package changes... (1/1) removing tme [######################] 100% :: Running post-transaction hooks... (1/1) Arming ConditionNeedsUpdate... [arch@tme ~]$ yay -Scc

Cache directory: /var/cache/pacman/pkg/ :: Do you want to remove ALL files from cache? [y/N] y removing all files from cache...

Database directory: /var/lib/pacman/ :: Do you want to remove unused repositories? [Y/n] removing unused sync repositories...

Build directory: /home/arch/.cache/yay :: Do you want to remove ALL AUR packages from cache? [Y/n] removing AUR packages from cache... [arch@tme ~]$

phabrics commented 1 year ago

OK, so after a little more investigation, it appears that there is an issue with gtk4 that I hadn't seen before. It looks like we will have to fall back to gtk3 for it to work. It is easy enough to do this by simply changing the corresponding dependency in PKGBUILD appropriately. This build will make the window display the full screen with gtk, rather than just the partial window you're seeing now. You can also use sdl or vnc which do display properly with the current build. It's as simple as changing the "gtk" to "sdl" or "vnc" at the machine description location and starting tmesh the same way.

display0: tme/host/sdl/display I am still debugging an issue with the keyboard input handling in the graphical displays, which seems to be in Sun2/3 configs only right now. But you should be able to display the Sun screen using one of the methods above if you wish. You can also use the serial port interface on the console, but that's probably not what you want. In the meantime, I will see if I can fix what's going on with the graphical display key input. I am not using ssh, but it's an interesting testcase. I guess gtk4 doesn't support the X forwarding, or else the X via ssh doesn't support all of its requirements. Not really sure about that one. I have just been running a normal terminal, sometimes inside of emacs (which I think that was).

As for the dependency issue, I think I might just put everything in depends (or optdepends/makedepends if it allows). That would hopefully bypass the issue.

phabrics commented 1 year ago

Reply To phabrics

OK, so after a little more investigation, it appears that there is an issue with gtk4 that I hadn't seen before. It looks like we will have to fall back to gtk3 for it to work. It is easy enough to do this by simply changing the corresponding dependency in PKGBUILD appropriately.

I'm not really sure how changing to gtk3 in the PKGBUILD will work if there is already gtk4 installed for other software to use. I think configure.ac would need to be modified to not look for gtk4.

On my physical computer running tme with gtk4 I set the display to gtk. The screen works but the keyboard does not respond except to the Enter key and even that has a delay of several seconds. I also tried VNC with Remmina and the keyboard was the same. Here is a screenshot of Ninth Edition UNIX running:

https://drive.google.com/file/d/1eWTDewn0agp4jBMI6PMSkwvrzItyCikS/view

I'm working on a repo to install v9. That is my target. It requires SunOS to install it.

On my xfce VM I removed gtk4 because xfce does not require it. (I really rolled back to a qcow2 snapshot I took before installing tme). I changed the PKGBUILD to use gtk3

diff --git a/PKGBUILD b/PKGBUILD index 1c3fe86..d92a5c4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,9 +8,9 @@ license=('GPL3') url="http://phabrics.com" optdepends=('perl-x11-protocol: for computing optimal graphics parameters' 'libvncserver: graphics hosted via VNC server'