crash in IDirectInputDevice8_GetDeviceInfo

So I have my wired and wireless Xbox contollers connected. If I modify
testjoystick a little to not close joysticks after opening them and
add SDL_HapticOpenFromJoystick() after opening each stick, I get a
crash on the second call to HapticOpenFromJoystick().

To be specific, the crash is happening inside
SDL_SYS_JoystickSameHaptic() when it calls
IDirectInputDevice8_GetDeviceInfo(). The data passed to that function
looks good to me, so I’m not sure what’s up. Anyone know about this? I
didn’t find anything in the bug tracker.

Out of curiosity, the code paths followed by SDL_HapticOpen() and
SDL_HapticOpenFromJoystick() look very different. Is there a good
reason for that or is there some legacy code in there? I sort of
figured SDL_HapticOpenFromJoystick() would just be a convenience
function that looks up an index and immediately calls
SDL_HapticOpen().–
Terry Welsh
www.reallyslick.com

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that supports haptics, but this bug definitely seems to still be present when compiling from tip (2.0.1+). We recently launched a game using SDL2 and some users are experiencing this exact crash according to the crash dumps. I ended up just using a workaround for now.

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings :> Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that
supports haptics, but this bug definitely seems to still be present when
compiling from tip (2.0.1+). We recently launched a game using SDL2 and some
users are experiencing this exact crash according to the crash dumps. I
ended up just using a workaround for now.

Sik wrote:

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings <@Nicholas_Hastings>:

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that
supports haptics, but this bug definitely seems to still be present when
compiling from tip (2.0.1+). We recently launched a game using SDL2 and some
users are experiencing this exact crash according to the crash dumps. I
ended up just using a workaround for now.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Just not supporting rumble on anything but the first recognized controller plugged in that has haptic support.

I have this same crash using 2 Xbox controllers. My current workaround
is to use SDL_HapticOpen() instead of SDL_HapticOpenFromJoystick(). I
still haven’t dug into these functions to see why they are so
different.–
Terry Welsh
www.reallyslick.com

Message: 5
Date: Fri, 18 Oct 2013 17:41:28 +0000
From: “Nicholas Hastings”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] crash in IDirectInputDevice8_GetDeviceInfo
Message-ID: <1382118088.m2f.39955 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Sik wrote:

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings :

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that
supports haptics, but this bug definitely seems to still be present when
compiling from tip (2.0.1+). We recently launched a game using SDL2 and some
users are experiencing this exact crash according to the crash dumps. I
ended up just using a workaround for now.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Just not supporting rumble on anything but the first recognized controller plugged in that has haptic support.

We’re shooting for a 2.0.1 release very soon. Can you submit a bug report
to bugzilla with a simple test case?
http://bugzilla.libsdl.org/

Thanks!On Fri, Oct 18, 2013 at 12:18 PM, Terry Welsh wrote:

I have this same crash using 2 Xbox controllers. My current workaround
is to use SDL_HapticOpen() instead of SDL_HapticOpenFromJoystick(). I
still haven’t dug into these functions to see why they are so
different.

Terry Welsh
www.reallyslick.com

Message: 5
Date: Fri, 18 Oct 2013 17:41:28 +0000
From: “Nicholas Hastings”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] crash in IDirectInputDevice8_GetDeviceInfo
Message-ID: <1382118088.m2f.39955 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Sik wrote:

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings :

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single
device that

supports haptics, but this bug definitely seems to still be present
when

compiling from tip (2.0.1+). We recently launched a game using SDL2
and some

users are experiencing this exact crash according to the crash dumps.
I

ended up just using a workaround for now.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Just not supporting rumble on anything but the first recognized
controller plugged in that has haptic support.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

This already looks like it might be related or the cause:
https://bugzilla.libsdl.org/show_bug.cgi?id=2126

I’ll try to pare a small test case.

Sam Lantinga wrote:> We’re shooting for a 2.0.1 release very soon. ?Can you submit a bug report to bugzilla with a simple test case?

http://bugzilla.libsdl.org/ (http://bugzilla.libsdl.org/)

Thanks!

On Fri, Oct 18, 2013 at 12:18 PM, Terry Welsh <mogumbo at gmail.com (mogumbo at gmail.com)> wrote:

I have this same crash using 2 Xbox controllers. My current workaround
is to use SDL_HapticOpen() instead of SDL_HapticOpenFromJoystick(). I
still haven’t dug into these functions to see why they are so
different.

Terry Welsh
www.reallyslick.com (http://www.reallyslick.com)

Message: 5
Date: Fri, 18 Oct 2013 17:41:28 +0000
From: “Nicholas Hastings” <@Nicholas_Hastings (@Nicholas_Hastings)>
To: sdl at lists.libsdl.org (sdl at lists.libsdl.org)
Subject: Re: [SDL] crash in IDirectInputDevice8_GetDeviceInfo
Message-ID: <1382118088.m2f.39955 at forums.libsdl.org (1382118088.m2f.39955 at forums.libsdl.org)>
Content-Type: text/plain; charset=“iso-8859-1”

Sik wrote:

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings <@Nicholas_Hastings (@Nicholas_Hastings)>:

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that
supports haptics, but this bug definitely seems to still be present when
compiling from tip (2.0.1+). We recently launched a game using SDL2 and some
users are experiencing this exact crash according to the crash dumps. I
ended up just using a workaround for now.


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Just not supporting rumble on anything but the first recognized controller plugged in that has haptic support.


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

I’ve filed bug 2161 with the details and hopefully a repro case. (I don’t have the hardware to actually repro the crash).
https://bugzilla.libsdl.org/show_bug.cgi?id=2161

Nicholas Hastings wrote:> This already looks like it might be related or the cause:

https://bugzilla.libsdl.org/show_bug.cgi?id=2126

I’ll try to pare a small test case.

Sam Lantinga wrote:

We’re shooting for a 2.0.1 release very soon. ?Can you submit a bug report to bugzilla with a simple test case?
http://bugzilla.libsdl.org/ (http://bugzilla.libsdl.org/)

Thanks!

On Fri, Oct 18, 2013 at 12:18 PM, Terry Welsh <mogumbo at gmail.com (mogumbo at gmail.com)> wrote:

I have this same crash using 2 Xbox controllers. My current workaround
is to use SDL_HapticOpen() instead of SDL_HapticOpenFromJoystick(). I
still haven’t dug into these functions to see why they are so
different.

Terry Welsh
www.reallyslick.com (http://www.reallyslick.com)

Message: 5
Date: Fri, 18 Oct 2013 17:41:28 +0000
From: “Nicholas Hastings” <@Nicholas_Hastings (@Nicholas_Hastings)>
To: sdl at lists.libsdl.org (sdl at lists.libsdl.org)
Subject: Re: [SDL] crash in IDirectInputDevice8_GetDeviceInfo
Message-ID: <1382118088.m2f.39955 at forums.libsdl.org (1382118088.m2f.39955 at forums.libsdl.org)>
Content-Type: text/plain; charset=“iso-8859-1”

Sik wrote:

Silly question: what is the workaround you’re using?

2013/10/17, Nicholas Hastings <@Nicholas_Hastings (@Nicholas_Hastings)>:

Did anyone find a fix for this?

I can’t easily reproduce or debug it since I only have a single device that
supports haptics, but this bug definitely seems to still be present when
compiling from tip (2.0.1+). We recently launched a game using SDL2 and some
users are experiencing this exact crash according to the crash dumps. I
ended up just using a workaround for now.


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Just not supporting rumble on anything but the first recognized controller plugged in that has haptic support.


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Thanks, I’m planning to fix this over the weekend for 2.0.1, so any
thing you can send, I appreciate.

–ryan.On 10/18/13 4:36 PM, Nicholas Hastings wrote:

This already looks like it might be related or the cause:
https://bugzilla.libsdl.org/show_bug.cgi?id=2126

I’ll try to pare a small test case.