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

[APP BUG]: Pthread creation errors in Windows 11. #2099

Open
2 tasks done
asp28x opened this issue Jan 8, 2025 · 19 comments
Open
2 tasks done

[APP BUG]: Pthread creation errors in Windows 11. #2099

asp28x opened this issue Jan 8, 2025 · 19 comments
Labels
bug Something isn't working

Comments

@asp28x
Copy link

asp28x commented Jan 8, 2025

Checklist

  • I have searched for a similar issue in this repository and did not find one.
  • I am using an official build obtained from releases or updated one of those builds using its in-app updater.

Describe the Bug

When launching ANY game on QT 0.5.0+ application always crashes with the SAME critical "pthread.cpp"error and after while exits to OS. Note: Running version QT 0.4.0 with same games on the same desktop works without crashes.

Reproduction Steps

from 0.5.0 always the same output error:

[Debug] pthread.cpp:operator():292: Assertion Failed!
Failed to create thread with error -1073741790

shad_log.txt

pthread cpp_err

Expected Behavior

Please fix pthread CRITICAL error to run games without crashing and exiting to OS like in previous version QT 0.4.0

Specify OS Version

Win 11 24H2 26100.2605 1000.26100.36.0, X670E, R7 7800X3D, RTX 4070 Super, 32 GB 6400

@asp28x asp28x changed the title [APP BUG]: QT from 0.5.0+ when launching ANY game application always crashes with critical "pthread "error. QT 0.4.0 works OK. [APP BUG]: QT from 0.5.0+ launching ANY game app always crashes with critical "pthread "error. QT 0.4.0 launching same games = no issues. Jan 8, 2025
@Hermiten
Copy link
Collaborator

Hermiten commented Jan 8, 2025

Can this be cause by the kernel rewrite ?

@Trina232
Copy link

Trina232 commented Jan 9, 2025

Also having the same exact issue on any version besides 0.4.0 as well.

@StepanTaz
Copy link

StepanTaz commented Jan 11, 2025

Last working build for me is c019b54 and this error pops up in every build since 15ae7a0.

Likely culprit would be unity pt1 pr, i think?

Screenshot 2025-01-11 145632

Same hardware fwiw, 7800X3D and 4070 Super. Had this happen on both 23H2 and 24H2.

@TylerJaacks
Copy link

I have a AMD Ryzen 5950X, 64GB RAM, and a RTX 4090, and I am also having this issue and that this build does indeed work for me.

@polybiusproxy
Copy link
Collaborator

polybiusproxy commented Jan 19, 2025

The only documented solution (excluding reverting shadPS4 back to builds where #1659 was not merged) is to downgrade Windows. Recent versions broke the way we create threads.

@polybiusproxy polybiusproxy changed the title [APP BUG]: QT from 0.5.0+ launching ANY game app always crashes with critical "pthread "error. QT 0.4.0 launching same games = no issues. [APP BUG]: Pthread creation errors in Windows 11. Jan 19, 2025
@TylerJaacks
Copy link

The only documented solution (excluding reverting shadPS4 back to builds where #1659 was not merged) is to downgrade Windows. Recent versions broke the way we create threads.

Is there a planned code solution?

@polybiusproxy
Copy link
Collaborator

First I'd have to look into the cause of the error. All we know is that recent versions of Windows broke thread creation.
I can't reproduce the issue as I'm on an old Windows version and I'm not willing to upgrade due to personal reasons.

@TylerJaacks
Copy link

@polybiusproxy what would you need to test, I could do that?

@xamionex
Copy link

I'm not willing to upgrade due to personal reasons.

You probably shouldn't as win11 is just win10 with a coat of paint and more issues (imho)
You should just run a vm with win11 (I use vmware but if you don't want an account go with virtualbox)

@thecatontheceiling
Copy link

thecatontheceiling commented Jan 20, 2025

You can get VMWare rather easily without an account using their update endpoint

Here's the latest version for Windows for example:
https://softwareupdate.vmware.com/cds/vmw-desktop/ws/17.6.2/24409262/windows/core/VMware-workstation-17.6.2-24409262.exe.tar

You can view the entire directory tree here

@StevenMiller123
Copy link
Contributor

StevenMiller123 commented Jan 20, 2025

Regardless of your feelings on the matter, Windows 10 hits end of life later this year. As a result, any typical end user should upgrade to Windows 11 to make sure their device remains secure.
Of course, not meaning this to specifically target anyone on 10. If you've got a reason to stay and know what you're doing, then stay.

@polybiusproxy
Copy link
Collaborator

@polybiusproxy what would you need to test, I could do that?

You would have to reverse engineer and debug the kernel to check where things start going wrong.

@frxffr
Copy link

frxffr commented Jan 20, 2025

i can confirm i have the same exact issue, i'm on 23h2
may i ask what is the latest version who didn't break thread creation so i can downgrade?

tried downgrading to 22h2 but no luck, gonna try 21h2

@TylerJaacks
Copy link

if the user who mentioned that the #1659 is the culprit, that would make sense as there are various pthread changes in this merge. I'm going to try to compile this version and see what is happening.

@TylerJaacks
Copy link

So I was looking at this https://github.com/winsiderss/phnt/blob/master/ntpsapi.h and there are some changes with 24H2, but I don't think they would make a difference. So the result of this return NtCreateThread(&native_handle, THREAD_ALL_ACCESS, nullptr, GetCurrentProcess(), &clientId, &ctx, &teb, false); is 0xC0000022 which is an NTSTATUS of STATUS_ACCESS_DENIED, {Access Denied} A process has requested access to an object but has not been granted those access rights.

@TylerJaacks
Copy link

So I fixed, this issue, so it appears that it has to do with a Windows Security migitation that was probably triggered by using the raw Windows NtCreateThread syscall.

@TylerJaacks
Copy link

You will have to remove CFG mitigations on the binary.

@Trina232
Copy link

You will have to remove CFG mitigations on the binary.

Man, you're a lifesaver. After weeks of troubleshooting, I removed CFG mitigations for the shadps4.exe, specifically in Windows Defender, and it works like a charm.

@asp28x
Copy link
Author

asp28x commented Jan 21, 2025

I have installed Kaspersky, but CFG in Defender was still enabled as by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants