Bug 279927 - emulators/wine-devel: install failure, pkg-static: Unable to access ...
Summary: emulators/wine-devel: install failure, pkg-static: Unable to access ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-23 11:18 UTC by O. Hartmann
Modified: 2024-08-03 10:08 UTC (History)
6 users (show)

See Also:


Attachments
Proposed patch, fixing the package list of emulators/wine-devel (672 bytes, patch)
2024-06-23 14:06 UTC, Gerald Pfeifer
no flags Details | Diff
Fix for WoW64 packaging on i386 (1.60 KB, patch)
2024-06-23 23:28 UTC, Sean Farley
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2024-06-23 11:18:22 UTC
On CURRENT (FreeBSD 15.0-CURRENT #50 main-n270898-10d8f953952b: Sat Jun 22 10:44:48 CEST 2024 amd64).

Port emulators/wine-devel fails to install due to missing files, see below:

[...]

===>>> Building the port required 0 seconds
===>  Installing for wine-devel-9.9,1
===>   Registering installation for wine-devel-9.9,1
pkg-static: Unable to access file /usr/ports/emulators/wine-devel/work/stage/usr/local/lib/wine/x86_64-unix/winegstreamer.dll.so:No such file or directory
pkg-static: Unable to access file /usr/ports/emulators/wine-devel/work/stage/usr/local/lib/wine/x86_64-unix/wineoss.drv.so:No such file or directory
*** Error code 1
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2024-06-23 13:56:59 UTC
Thank you for the report, O.  Can you confirm that you changed the
default of this port from ALSA to OSS for sound?
Comment 2 Gerald Pfeifer freebsd_committer freebsd_triage 2024-06-23 14:06:14 UTC
Created attachment 251647 [details]
Proposed patch, fixing the package list of emulators/wine-devel

Please check this draft patch. How does that work for you?
Comment 3 Ivan Rozhuk 2024-06-23 21:04:47 UTC
Same for me, @stable/14.

# make showconfig
===> The following configuration options are available for wine-devel-9.9,1:
     CUPS=off: CUPS printing system support
     DOCS=off: Build and/or install documentation
     DOSBOX=off: Use DOSBox to run MS-DOS programs
     GECKO=off: Bundle Gecko MSI package for Wine
     GNUTLS=on: SSL/TLS support via GnuTLS
     MONO=off: Bundle Mono MSI package for Wine
     V4L=on: Video 4 Linux support
     WINEMAKER=on: Fully support winemaker (requires Perl)
     X11=on: X11 (graphics) support
====> Options available for the radio AUDIO: you can only select none or one of them
     ALSA=off: ALSA audio architecture support
     OSS=on: Open Sound System support
===> Use 'make config' to modify these settings

Attached patch fix issue.
Comment 4 Sean Farley freebsd_committer freebsd_triage 2024-06-23 23:27:51 UTC
(In reply to Gerald Pfeifer from comment #2)
The patch worked for me with both amd64 and i386 build environments.  However, I needed an additional patch for some WoW64 files, which I am attaching.
Comment 5 Sean Farley freebsd_committer freebsd_triage 2024-06-23 23:28:34 UTC
Created attachment 251658 [details]
Fix for WoW64 packaging on i386
Comment 6 Sean Farley freebsd_committer freebsd_triage 2024-06-24 03:12:24 UTC
Unfortunately, I cannot get winecfg to run with a fresh WINEPREFIX using the amd64 build while the i386 build works:

WINEDEBUG=warn+all WINEPREFIX=/home/sean/wineprefixes/test winecfg
wine: created the configuration directory '/home/sean/wineprefixes/test'
0024:fixme:ntdll:create_logical_proc_info stub
0024:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:fixme:ntdll:create_logical_proc_info stub
002c:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:warn:seh:dispatch_exception EXCEPTION_ACCESS_VIOLATION exception (code=c0000005) raised
002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8cb17
0024:warn:file:NtCreateFile L"\\??\\C:\\windows\\sysnative\\wow64cpu.dll" not found (c0000034)
0024:warn:module:map_wow64cpu failed to open wow64cpu, status 0xc0000034
0024:warn:file:NtCreateFile L"\\??\\C:\\windows\\syswow64\\kernel32.dll" not found (c0000034)
0024:warn:file:NtCreateFile L"\\??\\C:\\windows\\system32\\kernel32.dll" not found (c0000034)
0024:warn:file:NtCreateFile L"\\??\\C:\\windows\\system\\kernel32.dll" not found (c000003a)
0024:warn:file:NtCreateFile L"\\??\\C:\\windows\\kernel32.dll" not found (c0000034)
0024:warn:file:NtCreateFile L"\\??\\Z:\\home\\sean\\wineprefixes\\kernel32.dll" not found (c0000034)
0024:warn:module:load_dll Failed to load module L"kernel32.dll"; status=c0000135
wine: could not load kernel32.dll, status c0000135
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-06-24 07:46:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=89f7712ef739f5658db476c8f93c06a3aac3e7d5

commit 89f7712ef739f5658db476c8f93c06a3aac3e7d5
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-06-24 07:44:53 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-06-24 07:44:54 +0000

    emulators/wine-devel: Fix pkg-plist for OSS and i386

    With the large update to Wine 9.9 we missed the (non-default) OSS option
    and its impact on packaging. [1]

    Similarly, i386 does not feature the WoW64 libraries. [2]

    PR:             279927
    Co-authored-by: scf [2]
    Reported by:    O. Hartmann <ohartmann@walstatt.org> [1], scf [2]
    Tested by:      Ivan Rozhuk <rozhuk.im@gmail.com> [1], scf

 emulators/wine-devel/pkg-plist | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
Comment 8 Gerald Pfeifer freebsd_committer freebsd_triage 2024-06-24 07:52:22 UTC
(In reply to Sean Farley from comment #4)
> The patch worked for me with both amd64 and i386 build environments.  
> However, I needed an additional patch for some WoW64 files, which I 
> am attaching.

Thank you for both testing and then providing the update for i386, Sean!

> Unfortunately, I cannot get winecfg to run with a fresh WINEPREFIX
> using the amd64 build while the i386 build works:

Do you think this is bug #279269, or something else?

I don't have, full disclosure and sadly, not a good idea on how to
address this.
Comment 9 Sean Farley freebsd_committer freebsd_triage 2024-06-24 11:43:42 UTC
(In reply to Gerald Pfeifer from comment #8)

You are welcome.

> Do you think this is bug #279269, or something else?

Something else.  With Wine 9.8, I did not need to call "wine64 winecfg".  It did happen in the past.

Side question:  are wine and wine-devel supposed to have different files/wine.sh?  I have played with using the one from wine in wine-devel successfully.

> I don't have, full disclosure and sadly, not a good idea on how to
> address this.

Does winecfg work for you, or is it just my system?  It does not even build a new prefix before exiting if I do not remove the mingw bits.

At first, I wondered if it was stack protection:  https://bugs.winehq.org/show_bug.cgi?id=55139#c5

However, I am still not sure what is happening yet removing the entire --with-mingw line or just the CROSS* variables allows 64-bit apps to run.  Sadly, I am no longer able to run a program (bakkesmod) that injects into a running process (Rocket League), so I would like to find a more subtle fix.

Gentoo has a quite a bit of massaging around its build:  https://gitweb.gentoo.org/repo/gentoo.git/tree/app-emulation/wine-vanilla/wine-vanilla-9.9.ebuild
Comment 11 O. Hartmann 2024-06-24 19:05:16 UTC
(In reply to Gerald Pfeifer from comment #1)

make -C /usr/portsemulators/wine-devel rmconfig
make -C /usr/portsemulators/wine-devel config

shows ALSA as the default, the only knob I enable is CUPS and leave all others on default.
Comment 12 Sean Farley freebsd_committer freebsd_triage 2024-06-25 00:23:22 UTC
(In reply to Alex S from comment #10)
Yes, that fixed my issue with running Win64 binaries.  Thank you.  It built successfully with both the amd64 and i386 jails.

The injection failure is a separate issue that I will have to examine some more.  Bakkesmod determines it fails after GetExitCodeThread() returns a negative (and seemingly random) number at this point:  https://github.com/bakkesmodorg/BakkesModInjectorCpp/blob/master/BakkesModInjectorC%2B%2B/DllInjector.cpp#L68  My Windows knowledge is somewhat limited not to mention dated.
Comment 13 Gerald Pfeifer freebsd_committer freebsd_triage 2024-06-28 10:17:19 UTC
(In reply to Sean Farley from comment #9)
> Side question:  are wine and wine-devel supposed to have different
> files/wine.sh?  I have played with using the one from wine in wine-devel
> successfully.

@Sean:
When you say you used file/wine.sh from the wine port in the wine-devel
port successfully, do you mean it worked as before? Or that using that
other version improved things?

(I'd expect the latter, just I ran into some counterintuitive findings
recently, so I want to make sure I understand your correctly.)
Comment 14 Sean Farley freebsd_committer freebsd_triage 2024-06-29 18:08:11 UTC
(In reply to Gerald Pfeifer from comment #13)
Using files/wine.sh from emulators/wine, I copied it to emulators/wine-devel and built that port.  At least, I saw no issues from using it.

I saw updates to it in emulators/wine but emulators/wine-devel was untouched for some time, so I wanted to see how well it behaved.  It looks good to me in terms of behavior.
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-07-01 10:06:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a1490b259251fe09f42ec55658a0f2c5d89a2479

commit a1490b259251fe09f42ec55658a0f2c5d89a2479
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-07-01 10:05:19 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-07-01 10:05:19 +0000

    emulators/wine-devel: Sync files/wine.sh with emulators/wine

    This forward ports the following two commits from emulators/wine
    as far as files/wine.sh goes:

        commit ef11261971a87d2b75b352ab479b651d2f2b0b50
        Author: Gerald Pfeifer <gerald@FreeBSD.org>
        Date:   Wed Jan 31 12:27:21 2024 +0000

        emulators/wine: Simplify the logic in wine.sh

    and

        commit 0f2052c3784e3b8d5aed85aab22b8a49613ee85c
        Author: Alexander Vereeken <Alexander88207@protonmail.com>
        Date:   Sun Dec 17 22:58:41 2023 +0000

        emulators/wine: Unbreak WoW64

        This is an excerpt of 1f07ec6014 by Alex S <iwtcex@gmail.com> for
        emulators/wine-proton.

    PR:             275677, 279927
    Reported by:    scf

 emulators/wine-devel/Makefile      | 1 +
 emulators/wine-devel/files/wine.sh | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
Comment 16 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-01 10:24:37 UTC
(In reply to Sean Farley from comment #14)
> Using files/wine.sh from emulators/wine, I copied it to emulators/wine-devel
> and built that port.  At least, I saw no issues from using it.

So it did not regress anything for you, though also did not improve anything.

> I saw updates to it in emulators/wine but emulators/wine-devel was untouched
> for some time, so I wanted to see how well it behaved.  It looks good to me
> in terms of behavior.

Indeed the wine-devel port missed two updates that made it into wine; I just
committed these there as well.
Comment 17 Sean Farley freebsd_committer freebsd_triage 2024-07-01 22:00:42 UTC
(In reply to Gerald Pfeifer from comment #16)

> > Using files/wine.sh from emulators/wine, I copied it to emulators/wine-devel
> > and built that port.  At least, I saw no issues from using it.
> So it did not regress anything for you, though also did not improve anything.
Correct.

> > I saw updates to it in emulators/wine but emulators/wine-devel was untouched
> > for some time, so I wanted to see how well it behaved.  It looks good to me
> > in terms of behavior.
> Indeed the wine-devel port missed two updates that made it into wine; I just
> committed these there as well.

Thank you for taking care of it!  If it is not too much trouble, would you also apply the patch from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279927#c10 to wine-devel?  That should fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280000.  It did for me.
Comment 18 Dmitry Lukhtionov 2024-07-10 14:04:22 UTC
Installed from packages

mitya@m18:~/Desktop % pkg info wine-devel
wine-devel-9.12,1
Name           : wine-devel
Version        : 9.12,1
Installed on   : Wed Jul 10 13:19:36 2024 EEST

mitya@m18:~/Desktop % wine64 winbox64.exe 
0024:fixme:ntdll:create_logical_proc_info stub
0024:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:fixme:ntdll:create_logical_proc_info stub
002c:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7
0024:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7

winbox64 getting from https://mikrotik.com/download
Comment 19 Dmitry Lukhtionov 2024-07-19 06:57:09 UTC
Any news for me ?
The error is reproduced on other computers.
Comment 20 Sean Farley freebsd_committer freebsd_triage 2024-07-21 18:49:11 UTC
(In reply to Dmitry Lukhtionov from comment #19)
I added a patch, stolen from emulators/wine-proton, to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280000 to fix the issue.
Comment 21 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-29 21:56:56 UTC
(In reply to O. Hartmann from comment #11)
> make -C /usr/portsemulators/wine-devel rmconfig
> make -C /usr/portsemulators/wine-devel config
>
> shows ALSA as the default, the only knob I enable is CUPS and 
> leave all others on default.

I am close to 100% sure that the original situation happened when
the default was OSS, not ALSA - both based on my own experiments,
reading the code, other other reports like comment #3.

This is mostly "for the record", we appear to have address the
issue successfully.
Comment 22 commit-hook freebsd_committer freebsd_triage 2024-07-29 22:00:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ba5653b298e084faea153473a2eeefe2d0acd150

commit ba5653b298e084faea153473a2eeefe2d0acd150
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-07-29 21:47:34 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-07-29 21:47:34 +0000

    emulators/wine-devel: Avoid "NtRaiseException Unhandled exception"

    Users have been reporting a number of cases of the following error:
      002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0
    x6ffffff8b2b7
      0024:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0

    Address this by means of a patch borrowed from emulators/wine-proton.

    PR:              279927, 280000

 emulators/wine-devel/Makefile                      |  1 +
 .../files/patch-include_wine_asm.h (new)           | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)
Comment 23 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-29 22:17:22 UTC
Closing this bug which has been a hodgepodge of different issues - and
shows that wine-devel really needs a maintainer...
Comment 24 commit-hook freebsd_committer freebsd_triage 2024-08-03 10:08:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=33856e566b1098a567e48acba1add66ccc3ee4e4

commit 33856e566b1098a567e48acba1add66ccc3ee4e4
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-03 10:06:17 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-03 10:06:38 +0000

    emulators/wine: Avoid "NtRaiseException Unhandled exception"

    This backports
      commit ba5653b298e084faea153473a2eeefe2d0acd150
      Author: Gerald Pfeifer <gerald@FreeBSD.org>
      Date:   Mon Jul 29 21:47:34 2024 +0000
    from emulators/wine-devel.

    Users have been reporting a number of cases of the following error:
      002c:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x6ffffff8b2b7
      0024:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0

    PR:             279927, 280000

 emulators/wine/Makefile                            |  2 +-
 .../wine/files/patch-include_wine_asm.h (new)      | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)