Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0 Crashes on Launch #1327

Open
ChthonVII opened this issue Jan 27, 2025 · 17 comments
Open

v7.0 Crashes on Launch #1327

ChthonVII opened this issue Jan 27, 2025 · 17 comments
Labels
bug help wanted Request is possible, but not with the current API

Comments

@ChthonVII
Copy link

ChthonVII commented Jan 27, 2025

Pretty much the title. v7.0 is crashing on launch for me.

I've attached a dump (renamed to .txt so github will accept it).

7.0-20250127-005110-220-328.dmp.txt

Since it's a crash on launch, I'm afraid I have no more insights.

Please let me know if you want me to test some intermediate builds to search for the problematic commit.

Edit: Using a 3rd party program to inject, I can see "Not enough bytes for the section '.text'" in its console window. Probably related.

@DubbleClick
Copy link
Member

This appears to be on Linux?

@ChthonVII
Copy link
Author

Yes.

@DubbleClick DubbleClick added bug help wanted Request is possible, but not with the current API labels Jan 29, 2025
@DubbleClick
Copy link
Member

We added more debug info for the next release, but we don't know what causes the issue yet. Kinda hard to support Linux, when it's a Widows game.

@ChthonVII
Copy link
Author

How do I access this debug info?

Looking over the commit history, in light of the console output I can see with a 3rd party injector, the change to make gwca an independent dll seems a possible suspect.

@ChthonVII
Copy link
Author

I tried a different version of wine, and got a hang instead of a crash, with something useful in the console:

0134:fixme:dbghelp:elf_search_auxv can't find symbol in module
0134:fixme:dbghelp:MiniDumpWriteDump NIY MiniDumpWithDataSegs
0138:err:sync:RtlpWaitForCriticalSection section 7BD5C2E0 "dlls/ntdll/loader.c: loader_section" wait timed out in thread 0138, blocked by 0134, retrying (60 sec)

The final line repeats every 60 sec. indefinitely, indicating it's hopelessly threadlocked.

@DubbleClick
Copy link
Member

DubbleClick commented Jan 29, 2025

How do I access this debug info?

You would have to compile the dev branch yourself. The extra debug info will come from a crash dump when gwca initialises. The error isn't directly linked to gwca being an external dll, but likely that we now scan gw.exe in the filesystem to find our addresses, rather than gw.exe from memory. This means we can find addresses to hook, even if another dll has already hooked them.

@lxmadabc
Copy link

lxmadabc commented Jan 30, 2025

Hi, facing the same error on Linux after updating. Tried reinstalling toolbox but no luck. I hope the crashdump helps (for some weird reason I cannot upload the file here, so heres the link: https://limewire.com/d/d306c42f-7ab4-4d42-95a0-778c3021cf82#Cy9Tbh2vpTT829XqYCAehpr-g3cX3NrJHunE3rgQ7co or let me know if you'd like me to send it elsewhere) . I'm happy to provide more information, just let me know what you need.

System: Manjaro with KDE Plasma desktop, running wayland.

I run GWTB++ through lutris as this has been the easiest way to setup GW. After having installed it I wanted to use uMod and GWTB++. So I changed lutris config to open uMod instead of GW.exe and I run both GW.exe and GWTB++.exe though uMod. This has worked perfectly. A few updates ago it started crashing when starting GWTB++ after I had selected a char so I always launched from the char selection screen.
Now no matter where I try starting GWTB++, it always crashes.
Wine outputs the error: 1cc: Invalid file descriptor

Let me know if there is some way to help you fix this.

@DubbleClick
Copy link
Member

The best way to help would be to clone the dev branch, build yourself and debug the initialization. None of our developers use Linux to run Windows games.

@lxmadabc
Copy link

A question since I'm not a dev: Debugging the initialization of the build process? Or after the application has been built, during the initialization of the application? Would I need to change something during for the build processs to enable logging?

After trying to build it myself for a while now, this does not seem to be very straight forward, sadly. I could not get VS to run yet (and it seemingly does not like wine very much). I'll read into trying to build with mingw later (that's the only option I still see if VS wont work and I'm not sure if it is possible at all to use mingw instead of VS). I could create a VM, install VS and build there but at that point I could also install GW in a VM which kinda defeats the purpose... And I wouldn't see any issues which show during the build process since it would be basically on a windows system. Let me know if you have some ideas, just in case.

@DubbleClick
Copy link
Member

You cannot build with mingw, it has to be built with msvc. If that's not possible under wine and/or you can't attach the VS debugger to the running gw process before you inject toolbox, you can't do much.

Future releases will contain more and more debug info, until we eventually track it down.

@lxmadabc
Copy link

Okay, thank you very much for clarifying! I would have chased the completely wrong problem. I'll let you know if I make any progress on building under Linux. Maybe a later update will enable more detailed debugging or someone more experienced will be able to step in and troubleshoot.

@3vcloud
Copy link
Member

3vcloud commented Jan 31, 2025

Please send your crash dumps when you get them

@ChthonVII
Copy link
Author

@lxmadabc: To save yourself a lot of pain, do not bother trying to run MSVC in wine. Getting it to work is extremely complicated, and I'm not even sure it's possible at all with the current version.

The best option for compiling things that absolutely need MSVC on Linux is to use a VM. KVM + virt-manager works fine, MS provides free Win11 iso's, and Win11 can be used for compiling without activation (and therefore without paying).

(If you need a guide for setting that up, this one is about 90% correct. The big items that are missing are that (1) the VM won't start without sudo virsh net-start default to start the virtual network, and (2) virsh tries to set up some iptables firewall rules, which fails if you're using nftables instead. You need allow rules for forward to and from the virtual network interface, input from the virtual network interface, and masquerade the VM's IP in postrouting.)

I intend to sort out compiling the dev branch to help debugging this, but it's unlikely I will have sufficient free time in the near future. You will probably beat me to it.


@DubbleClick

The error isn't directly linked to gwca being an external dll, but likely that we now scan gw.exe in the filesystem to find our addresses, rather than gw.exe from memory. This means we can find addresses to hook, even if another dll has already hooked them.

Yeah, it sounds plausible that maybe wine isn't loading stuff at the addresses expected from scanning gw.exe in the filesystem. It might be fruitful to do both scans in parallel and compare the results.

@lxmadabc
Copy link

lxmadabc commented Feb 1, 2025

@ChthonVII Thanks for letting me know. A friend of mine offered a windows machine and I do have one standing around which hasn't been used in a year, so I could probably get it running myself.
However, I do not really understand the benefit of a version built by myself compared to the one already compiled, unless MSVC is running on the same system as GW and I can inject MSVC debugging as mentioned above. Am I missing something?

@3vcloud For some reason github won't let me upload on this machine. Tried on two browsers now. The link in my first reply is a the last crashdump uploaded to a filesharer and it's still up for a couple of days. I could also mail the file to you if you preferred that, or discord or something. Just let me know (or if I can help by testing something specific).

@DubbleClick
Copy link
Member

DubbleClick commented Feb 1, 2025

However, I do not really understand the benefit of a version built by myself compared to the one already compiled, unless MSVC is running on the same system as GW and I can inject MSVC debugging as mentioned above. Am I missing something?

No, you got that part right. The only point would be to be able to step through the code by attaching VS to GW. If that's not a possibility, you can skip compiling the dev branch.

If one of you lets me know how I can set up a linux vm through hyper-v that uses wine or lutris to play gw, I may be able to iteratively brute force debug it, though.

@lxmadabc
Copy link

lxmadabc commented Feb 1, 2025

If one of you lets me know how I can set up a linux vm through hyper-v that uses wine or lutris to play gw, I may be able to iteratively brute force debug it, though.

Thanks for willing to help, even though you don't really support linux! I tried sending you a mail but I can also try to explain how I installed GW here if you'd prefer that.

@ChthonVII
Copy link
Author

If one of you lets me know how I can set up a linux vm through hyper-v that uses wine or lutris to play gw, I may be able to iteratively brute force debug it, though.

I don't know squat about hyper-v. I'm also not sure GW will run at all without PCIE passthrough. However, assuming you know more about hyper-v than I do, I can at least get you through getting GW running on Linux in a few paragraphs.

Start by installing Debian Stable in your VM. (This is the "vanilla" of Linux.) Like I said, I don't know hyper-v. Here and here are a couple guides, and here is the iso of the installation DVD. Whatever defaults the installer wants should be fine. KDE or Gnome doesn't matter, but I like KDE more.

Once you've got your VM running, you need to give your user admin rights.
(I'm assuming you're totally unfamiliar with Linux here. Please skip ahead if you already know this.)
su
It will prompt for the admin password.
nano /etc/sudoers
This will open a file in a simple text editor.
Find the line root ALL=(ALL:ALL) ALL and put an identical line below it with your username substituted for "root."
ctrl+x to exit, and it will prompt you to save or not
end su session:
exit
Now your regular user can run commands as admin by prefixing them with sudo.

Now you need to add the ability to install 32-bit libraries, since GW is a 32-bit program.

sudo dpkg --add-architecture i386
sudo apt-get update

If you're passing through a GPU, it will need 32-bit drivers. (Install the 64-bit drivers first if you haven't already.) Just skip this if you're not passing through a GPU.
For AMD (open source drivers)(info):

sudo apt-get install libglx-mesa0:i386 mesa-vulkan-drivers:i386 libgl1-mesa-dri:i386

For nVidia (proprietary drivers)(info):

sudo apt-get install nvidia-driver-libs:i386

Add wine repository to package sources and install wine. (info)

sudo mkdir -pm755 /etc/apt/keyrings
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
sudo apt-get update
sudo apt-get install --install-recommends winehq-staging

Now to install GW.
Make a new 32-bit wine prefix:
WINEARCH=win32 WINEPREFIX=~/.wine-gw winecfg
Make a directory:
mkdir ~/.wine-gw/drive_c/temp
Download GW client from https://www.guildwars.com/en/download to ~/.wine-gw/drive_c/temp.
WINEPREFIX=~/.wine-gw wine start /d "C:\temp" "C:\temp\GwSetup.exe"

You should now be able to run GW with:
WINEPREFIX=~/.wine-gw wine start /d "C:\Program Files\Guild Wars" "C:\Program Files\Guild Wars\Gw.exe"
Or, alternatively, navigate to ~/.wine-gw/drive_c/Program Files/Guild Wars as the working directory, and then it's just
WINEPREFIX=~/.wine-gw wine Gw.exe

Toolbox is pretty much the same. Put to somewhere in the wine prefix and run it. For example:

WINEPREFIX=~/.wine-gw wine start /d "C:\Program Files\GWToolbox" "C:\Program Files\GWToolbox\GWToolbox.exe"

(Note that the wine prefix's "My Documents" folder is symlinked to your Linux user's Documents folder.)

(I've skipped over installing DirectSong, DSOAL, DXVK, gamescope, etc. since they're just unnecessary complications when all we want to do is debug. I've also avoided lutris entirely since it adds complexity while being rather opaque about what it's doing.)

You can't attach MSVC debugger in wine because MSVC doesn't work in wine. You can however attach winedbg or gdb, either of which should have similar functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Request is possible, but not with the current API
Projects
None yet
Development

No branches or pull requests

4 participants