Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Crash in GADevice::initDeviceManufacturer() and initDeviceModel() #119

Open
sviannay opened this issue Jul 15, 2022 · 5 comments
Open

Crash in GADevice::initDeviceManufacturer() and initDeviceModel() #119

sviannay opened this issue Jul 15, 2022 · 5 comments

Comments

@sviannay
Copy link

sviannay commented Jul 15, 2022

I experienced a crash in my application on GADevice::initDeviceManufacturer(), but could also happen potentially in initDeviceModel().
If classObjectEnumerator->Next() failed, the classObject->Release(); statement will be executed with unpredictable classObject value (as it was not initialized) and then throw an exception 0xC0000005 (Read access error) in following lines:

What I would suggest could be something like (for initDeviceModel for example):

                            IWbemClassObject *classObject = nullptr; // <-- Initialize to nullptr
                            ULONG uReturn = 0;
                            hResult = classObjectEnumerator->Next(WBEM_INFINITE, 1, &classObject, &uReturn);
                            if (!hasFailed()) { // <-- Add failure detection
                                if (uReturn != 0) {
                                    model = getValue(classObject, (LPCWSTR)L"Model");
                                }
            
                                if (classObject) { // <- Add null protection check
                                    classObject->Release();
                                }
                            }

In the meantime, I'm investigating why it failed to retrieve 'Manufacturer' property, by asking to end-user for which crash occured to execute following powershell commands:

Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Manufacturer
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Model
@kalmard0
Copy link

I believe I found a very similar crash around this location as well:
classObjectEnumerator->Release(); is called even if ExecQuery() fails (and thus hasFailed() is true). According to the documentation at https://learn.microsoft.com/en-us/windows/win32/api/wbemcli/nf-wbemcli-iwbemservices-execquery, classObjectEnumerator is only set to a valid value if ExecQuery() has succeeded.

@Daerst
Copy link

Daerst commented Feb 15, 2024

We've been running a playtest for our Unreal game with a few thousand players and got multiple reports of the game crashing as soon as analytics are initialized (there's a button for consent). Most of the people who reported this seemed to run on some sort of NVIDIA GTX 1650/1660 GPU, but we also have people in the team running just fine on a GTX 1660 Ti, and we have also received similar reports from e.g. a GTX 1080 Ti.

Here's the callstack of where the crash happened:
image

The bad thing is, we tried wrapping this in a try/catch (which didn't help), we ticked "Disable Device Info" in the plugin's settings (which didn't help), and ultimately will have to disable analytics entirely/switch providers if this issue can't be worked around :/

@FarmerJ03
Copy link

We are looking at the exact same issue with the latest version for unreal engine 5.
There has been no progress here at all? Should we just switch from GameAnalytics?

@Daerst
Copy link

Daerst commented Jun 10, 2024

We are looking at the exact same issue with the latest version for unreal engine 5. There has been no progress here at all? Should we just switch from GameAnalytics?

Thanks for reporting that it's still happening with the latest version. Saves me the trouble of having it crash again during our upcoming playtest for which I'll disable GameAnalytics and then sadly have to migrate to a different solution next thing.

@DrUninstall
Copy link

DrUninstall commented Aug 6, 2024

Also considering migrating away from GameAnalytics because of this issue (UE 4.26).

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

No branches or pull requests

5 participants