SFML community forums

Help => Window => Topic started by: miki151 on May 06, 2016, 07:47:12 am

Title: JoystickImpl::isConnected crash
Post by: miki151 on May 06, 2016, 07:47:12 am
This is from a minidump from a remote machine. I can send in the minidump and symbols, if needed.

Crashing line:
        cache.connected = joyGetPosEx(JOYSTICKID1 + index, &joyInfo) == JOYERR_NOERROR;

index is 0

Stack trace:
    dinput.dll!CDIDev_Acquire()   Unknown
    WINMMBASE.dll!joyGetPosEx()   Unknown
   sfml-window-2.dll!sf::priv::JoystickImpl::isConnected(unsigned int index=0) Line 191   C++
    sfml-window-2.dll!sf::priv::JoystickManager::update() Line 88   C++
    sfml-window-2.dll!sf::priv::WindowImpl::processJoystickEvents() Line 164   C++
    sfml-window-2.dll!sf::priv::WindowImpl::popEvent(sf::Event & event={...}, bool block) Line 119   C++
    sfml-window-2.dll!sf::Window::pollEvent(sf::Event & event={...}) Line 186   C++
Title: Re: JoystickImpl::isConnected crash
Post by: miki151 on May 06, 2016, 12:05:54 pm
Sorry, I forgot to add that I'm using SFML 2.3.2.
Title: Re: JoystickImpl::isConnected crash
Post by: binary1248 on May 07, 2016, 11:55:25 pm
How many joysticks/controllers were there connected to the machine?
Title: Re: JoystickImpl::isConnected crash
Post by: miki151 on May 08, 2016, 06:26:17 am
I have no idea, it's an automatic crash report.

What's the best way to compile SFML without joystick support?
Title: Re: JoystickImpl::isConnected crash
Post by: binary1248 on May 08, 2016, 10:14:54 am
At the moment, there is no way.
Title: Re: JoystickImpl::isConnected crash
Post by: Mr_Blame on May 08, 2016, 12:54:41 pm
The only one thing that you can do is:remove joustick event polling code from SFML source and  compile it manualy. :P
Title: Re: JoystickImpl::isConnected crash
Post by: miki151 on May 08, 2016, 01:51:54 pm
That was what I thought, if this bug pops out again. Can I safely remove the call to processJoystickEvents()?
Title: Re: JoystickImpl::isConnected crash
Post by: Mr_Blame on May 08, 2016, 02:52:06 pm
the SFML license(http://www.sfml-dev.org/license.php) allows that. If you wouldn't claim, that you wrote SMFL yourself ;).
Title: Re: JoystickImpl::isConnected crash
Post by: sorum40 on June 12, 2016, 11:02:14 pm
I have similar issues, crashes when disconecting the gamepad (xbox360 one).
Looks to be a heap corruption.

I am using the latest stable build of SFML on a Windows 8.1 machine.

The most informative callstack is bellow:

    ntdll.dll!RtlpLowFragHeapAllocFromContext()   Unknown
    ntdll.dll!RtlAllocateHeap()   Unknown
    cfgmgr32.dll!StringIndirectionDuplicateString()   Unknown
    cfgmgr32.dll!SpInfLoadInfFile()   Unknown
    cfgmgr32.dll!LoadIndirectInfString()   Unknown
    cfgmgr32.dll!StringIndirectionResolveIndirection()   Unknown
    cfgmgr32.dll!StringIndirectionGetString()   Unknown
    cfgmgr32.dll!GetRegistryProperty()   Unknown
    cfgmgr32.dll!Local_CM_Get_DevNode_Registry_Property()   Unknown
    cfgmgr32.dll!CM_Get_DevNode_Registry_PropertyW()   Unknown
    dinput.dll!_DIHid_GetDevInfo@12()   Unknown
    dinput.dll!_DIHid_BuildHidListEntry@8()   Unknown
    dinput.dll!_DIHid_BuildHidList@4()   Unknown
    dinput.dll!_hResIdJoypInstanceGUID_WDM@8()   Unknown
    dinput.dll!_JoyReg_GetConfig@16()   Unknown
    dinput.dll!_CJoyCfg_GetConfig@16()   Unknown
    winmmbase.dll!_joyOpen@8()   Unknown
    winmmbase.dll!_joyGetPosEx@8()   Unknown
    Test.exe!sf::priv::JoystickImpl::isConnected(unsigned int)   Unknown
    Test.exe!sf::priv::JoystickManager::update(void)   Unknown
    Test.exe!sf::priv::WindowImpl::processJoystickEvents(void)   Unknown
    Test.exe!sf::priv::WindowImpl::popEvent(class sf::Event &,bool)   Unknown
    Test.exe!sf::Window::pollEvent(class sf::Event &)   Unknown
   Test.exe!PD_Screen::Update() Line 96   C++
    Test.exe!GameManager::Update() Line 330   C++
    Test.exe!GameManager::Run() Line 228   C++
    Test.exe!Run() Line 37   C++
    Test.exe!main() Line 48   C++
    [External Code]