Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:42 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Wine Crash MMB4W Gamepad Input

Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 07:00pm 19 Feb 2024
Copy link to clipboard 
Print this post

matherp

I opened a bug report on Wine's Bugzilla regarding the crash when I tried to use a gamepad with MMB4W. Today, they posted an explanation of why the bug is happening and also a possible workaround. Is it something you can do on MMB4W?

This is the explanation:
  Quote  
WINEDEBUG=warn+heap,+dinput,+wbemprox,+tid trace

I can confirm the issue in wine-9.2-162-g90103fa07e5 with a virtual Xbox 360 controller attached when running MMBasic as described.

The crash doesn't consistently occur on every run, but it is reliably triggered if heap validation is enabled with WINEDEBUG=warn+heap.

When MMBasic is running, a thread periodically polls for gamepad devices by calling IDirectInput8::EnumDevices. For each device, it queries WMI for information from the Win32_PnPEntity concerning the enumerated device.

When the run command is executed in MMBasic, another thread is spawned which seems to execute the same duplicate logic as the initial polling thread with its own instances of the relevant DirectInput and WMI interfaces.

When the two threads query WMI concurrently, it's possible for the internal data structures in Wine's WMI implementation to be unsafely modified concurrently, as the current implementation doesn't seem to properly support queries issued from two independent IWbemServices instances. This results in the crash on HeapFree that is observed.

Practically speaking, I wonder if the duplicate thread spawn is something MMBasic really needs to do. It may not really be necessary for gamepad support, and avoiding the concurrent WMI querying would work around this bug in Wine.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 04:26am 23 Feb 2024
Copy link to clipboard 
Print this post

Today the issue was patched (https://bugs.winehq.org/attachment.cgi?id=76078&action=diff ).

I downloaded Wine's source code, applied the patch, and built a version from the patched source code. Knightmare ran perfectly with no Wine crashes.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 05:08am 24 Feb 2024
Copy link to clipboard 
Print this post

This was pretty quick... the patch is already merged into Wine's master branch. It will be available on Wine 9.3, as tagged in the commit.

https://github.com/wine-mirror/wine/commit/9015eebf87e3de8f9c541299e529c9667cc4847b
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 10:47pm 04 Mar 2024
Copy link to clipboard 
Print this post

Leo,

Do I need to remove an older version of wine (6.0.3) before installing 9.3?
If so, can you point me to any instructions on doing so please?

I can see on winehq all the necessary instructions for installing 9.3 so should be able to get through that part.

Thanks,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024