Nominate our 2022 Qt Champions!

Crash in xinputgamepad on exit program

  • Calling QGamepadManager instance gives two warning messages

    auto* manager = QGamepadManager::instance();
    qt warn: Failed to load XInput library xinput1_3.dll (qxinputgamepadbackend.cpp:277, bool __cdecl QXInputGamepadBackend::start(void))
    qt warn: Failed to start gamepad backend (qgamepadmanager.cpp:66, __cdecl QGamepadManager::QGamepadManager(void))

    And on program exit there's a crash in xinputgamepad. No other gamepad related code is called.

    Is there any way to check if the returned QGamepadManager::instance is in a valid state?
    And is it possible to prevent this from crashing on machines where xinput1_3.dll is missing? (Apart from not calling instance...)

    Qt 5.8 64-bit

    dxdiag reports this:
    Operating System: Windows 7 Professional 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_ldr.170427-1518)
    Processor: Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz (4 CPUs), ~2.4GHz
    DirectX Version: DirectX 11

    Callstack on crash:

    xinputgamepadd!QGenericAtomicOps<QAtomicOpsBySize<4> >::fetchAndStoreAcquire<int,int>+0x1b
    ucrtbased!__crt_seh_guarded_call<int>::operator()<<lambda_d22e02de4d14401f49897516b29a2b7c>,<lambda_e971338317bfa523bb8920b43d823727> & __ptr64,<lambda_b0b8599c9027f5b14541fbbd6863d1f1> >+0x35
    ucrtbased!__acrt_lock_and_call<<lambda_e971338317bfa523bb8920b43d823727> >+0x5c

  • Is there any solution for this problem? It occurs only on a few computers, but i cant find the difference...

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check with something like Dependency Walker whether there's a .dll missing or different from the system where it's running properly ?

    Also, are you using a more recent version of Qt ?

    Is there any difference between the versions of DirectX on your systems ?

  • Moderators

    @Schwingi said in Crash in xinputgamepad on exit program:

    Is there any solution for this problem? It occurs only on a few computers, but i cant find the difference...

    did you compare the version and origin of the xinput.dll amongst the machines where it is working and where it is not?

    Also note that the QtGamepad module is still in Technology Preview state and not yet and still may contain bugs and thus not meant for production.

  • Hey,
    I actually use Qt 5.10, but the crash also occurs in 5.8 or 5.9.
    But on the computer where it crashes, there isn't a "xinput1_4.dll" in system32 directory.
    On the computer where it doesn't crash, the process explorer shows, that he use the "xinput1_4.dll".
    But also if i copy this dll in system32 or application directory on the computer where it doesn't work it crashs and the process explorer shows, that he also doesn't use this neither. The directx version is not relevant.
    So how can i be sure that this dll is used when this causes the crash. Thank you

Log in to reply