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

Fix the seh dispatch_exception unknown exception (c0000420) #9

Merged
merged 2 commits into from
Apr 8, 2023
Merged

Conversation

kyechou
Copy link

@kyechou kyechou commented Apr 8, 2023

Changes:

  • Add header include <linux/futex.h>. This fixes some missing header error for some distro (e.g., Arch-based).
  • LoL-seh-assertion-failure.patch is essentially this merge request, but without the additional filler bytes for Overwatch 2.
  • LoL-critical-error.patch is said to eliminate the "critical error" pop-up window, but I haven't tested it with other patches yet.

I'm currently testing the LoL-seh-assertion-failure.patch without the LoL-critical-error.patch and if it still works I'll remove the latter patch. I'm doing it on my laptop so it may take a while. Please don't merge just yet.

@kyechou
Copy link
Author

kyechou commented Apr 8, 2023

So I tested LoL-seh-assertion-failure.patch without LoL-critical-error.patch. There's no seh exception but there's the critical error pop-up (and the game still crashed). So both patches are necessary. The PR is good now. Please review, test, or modify as needed.

I'll test it again for a clean build, but the game should work. It will be good if others can verify as well.

@GloriousEggroll GloriousEggroll merged commit 6b66efd into GloriousEggroll:7.0-GE-LoL Apr 8, 2023
@kyechou
Copy link
Author

kyechou commented Apr 8, 2023

Status update:
If we run the game with WINEDEBUG=fixme-all,trace+seh,trace+vulkan,trace+window, we can enter and play a match, which was tested through practice tool and verified by multiple people. But without the tracing flags, a new exception occurs:

err:virtual:virtual_setup_exception stack overflow 2000 bytes in thread 0ab0 addr 0x1700349b0 stack

Note that the address 0x1700349b0 is the same reported from different people. We assume there might be data race between the wine threads causing the stack overflow exception.

@kyechou
Copy link
Author

kyechou commented Apr 8, 2023

Additional tests are needed to see if having the tracing flags also work around the problem without the new patches (7.0.5 release). We now know the patches are necessary for some people's setup.

Either way, eventually someone (or Riot) would need to investigate the cause of that stack overflow.

@yuiiio
Copy link

yuiiio commented Apr 8, 2023

only WINEDEBUG=trace+seh makes start games, for me
but after few minutes crash and shows dialog.
that means the traces likely slow something down.

@FerMPY
Copy link

FerMPY commented Apr 8, 2023

I will have to test it with a actual game to se if works but so far I do can run leagueoflegends.exe.
It does freeze lutris if I want to use the Show logs option.

@yuiiio
Copy link

yuiiio commented Apr 9, 2023

https://aur.archlinux.org/packages/wine-lol-staging
working lol now without WINEDEBUG,
wine-staging plus these patch.
0005-LoL-client-slow-start-fix.patch
0007-ntdll-stub-NtSetInformationThread-ThreadPriority.patch
0008-ntdll-nopguard-call_vectored_handlers.patch

0004-LoL-broken-client-update-fix.patch <== not needed for me.
edit:
also need 0004-LoL-broken-client-update-fix.patch

hm but still have stuck, freeze game :(

@drshapeless
Copy link

https://aur.archlinux.org/packages/wine-lol-staging working lol now without WINEDEBUG, wine-staging plus these patch. 0005-LoL-client-slow-start-fix.patch 0007-ntdll-stub-NtSetInformationThread-ThreadPriority.patch 0008-ntdll-nopguard-call_vectored_handlers.patch

0004-LoL-broken-client-update-fix.patch <== not needed for me.

hm but still have stuck, freeze game :(

I tried to use this version of wine in Lutris. The client won't even start. Here's the log.

wine client error:39c: write: Bad file descriptor
wine client error:494: write: Bad file descriptor

@kyechou
Copy link
Author

kyechou commented Apr 9, 2023

Thanks @yuiiio! I'm currently testing it out. Were you able to fix the freeze by any chance?

@yuiiio
Copy link

yuiiio commented Apr 9, 2023

no. I'm get
0920:err:virtual:virtual_setup_exception stack overflow 1808 bytes addr 0x17005a8c6 stack 0x208f0 (0x20000-0x21000-0x120000)

@kyechou
Copy link
Author

kyechou commented Apr 9, 2023

Hmm the game also froze for me. Yeah with the same error message. It's interesting that the addr 0x17005a8c6 are the same.

wine client error:67c: write: Bad file descriptor
wine client error:534: write: Bad file descriptor
wine client error:7b8: write: Bad file descriptor
0190:err:seh:dispatch_exception unknown exception (code=c0000420) raised
0190:err:seh:dispatch_exception unknown exception (code=c0000420) raised
0190:err:virtual:virtual_setup_exception stack overflow 1808 bytes addr 0x17005a8c6 stack 0x208f0 (0x20000-0x21000-0x120000)
wine client error:16c: write: Bad file descriptor
wine client error:200: write: Bad file descriptor
wine client error:3cc: write: Bad file descriptor
wine: Unhandled page fault on execute access to F7E1FE34 at address F7E1FE34 (thread 061c), starting debugger...
061c:err:virtual:virtual_setup_exception stack overflow 68 bytes addr 0x7bc5913d stack 0x1e320fbc (0x1e320000-0x1e321000-0x1e420000)
061c:err:virtual:virtual_setup_exception nested exception on signal stack addr (nil) stack 0xc97f2dc

@kyechou
Copy link
Author

kyechou commented Apr 9, 2023

@yuiiio Please check out this log: https://pastebin.com/WShaFsZY

I added some additional err printing to the wine code (patched 8.5), and the stack overflow was caused by a large amount of c0000005 exceptions happening at many locations but especially at 0x170060037.

From https://learn.microsoft.com/en-us/previous-versions/troubleshoot/visualstudio/foxpro/c0000005-error-troubleshoot it says:

A C0000005 error is memory error. Specifically, a C0000005 error is an access violation error caused by a buffer overrun.

So I think the root cause is happening in either the application code or some dll code. We just have to figure out where 0x170060037 is.

@kyechou
Copy link
Author

kyechou commented Apr 9, 2023

Updated log: https://pastebin.com/65kwU7sn
Explanation:

  • exception code c0000005 is access violation. In this case that is a virtual page fault in wine triggered by SIGSEGV in linux.
  • info_0 in the log is the virtual page fault type. 0 is read fault. 1 is write fault. and 8 is execute fault.
  • stack_ptr is the aligned rsp at the time.

I've narrowed down the cause to this:

  • Stack overflow is caused by a strange unhandled virtual page fault.
  • Most page faults in the log seem benign, except for the one occurring at 0x1700608de. The exact address may differ depending on the game exe versions. Note that this address may be different from the one reported by the stack overflow error message.
  • The page fault wasn't handled properly and so the segv_handler kept getting trigger, eventually overrun the stack space.

@yuiiio
Copy link

yuiiio commented Apr 11, 2023

from last night,
not more crashs with moonshadow5656's patch.
It might have been game's bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants