DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support. Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Weasel
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2016-10-10, 15:59

DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Weasel » 2024-02-05, 18:59

Wine doesn't support IDXGIKeyedMutex currently. So the function DoesTextureSharingWorkInternal in XUL's gfx/thebes/D3D11Checks.cpp crashes in wine because it doesn't check whether the QueryInterface for the IDXGIKeyedMutex succeeds or not, but it should. In other parts of the code base, it's almost always checked (unless implied prior to be available), I think here it should be checked too for FAILED or NULL sourceSharedMutex.

Without this it works fine btw.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Moonchild » 2024-02-05, 19:16

"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by athenian200 » 2024-02-05, 19:57

Yeah, if it's an easy fix, I think we should do it. Not to say that we go out of our way to support or test Wine since we have a native Linux version, but in this case it exposed an oversight in the code. Looks like MC agrees and already filed an issue.

I think more people will be trying to use NPAPI plugins in Wine on Linux in the future anyway (because the native Linux support for those is half-busted on modern distros), so the less problems they have, the better.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Weasel
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2016-10-10, 15:59

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Weasel » 2024-02-06, 21:26

Yeah, I agree. In general, things should definitely be fixed in Wine instead of being worked around in apps (not least because, when it does get fixed in Wine, the app might misbehave). But in this particular case the code is supposed to check for its availability (because it also varies with drivers on Windows), so I think it's justified to fix it on PM/XUL side.

Thanks for filing the issue!

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Moonchild » 2024-04-07, 16:58

Weasel wrote:
2024-02-06, 21:26
Thanks for filing the issue!
I don't really have a ready way to test this, which is why it's been sitting on my to-do list for a while.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Moonchild » 2024-04-11, 23:10

Well, I've had a patch sitting in branch 2470 on the UXP repo, made a build for testing and PMed the OP but haven't had a response so far. If anyone can help testing this in WINE, I'd appreciate it. (reproduce the issue and check if it's fixed)
The unstable build with the patch in can be found at ftp://publicbeta:get@ftp.palemoon.org/palemoon-33.1.0a1.win64.7z
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Toa-Nuva
Fanatic
Fanatic
Posts: 200
Joined: 2015-06-04, 18:12

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Toa-Nuva » 2024-04-12, 17:11

palemoon-33.0.2.win64 -> immediately crashed on startup ("The program palemoon.exe has encountered a serious problem and needs to close.")
palemoon-33.1.0a1.win64 -> started up fine, I didn't do any extensive testing but I loaded a few websites and did not run into any issues.
I ran both of them in fresh Wine prefixes. Wine 9.3 on Manjaro.

So the fix seems to be working fine.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Moonchild » 2024-04-12, 17:46

Thanks for that! I'll merge it in then and consider it fixed.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Weasel
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2016-10-10, 15:59

Re: DoesTextureSharingWorkInternal crashes on wine because no keyed mutex support.

Unread post by Weasel » 2024-04-23, 13:46

Yes, sorry, for some reason I got the notification in Spam, ugh.

I can confirm it is fixed now, thank you!