Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to SDL_Init crashes process with AccessViolation when gamecube controller and mayflash adapter attached #387

Open
Chicken-Bones opened this issue May 24, 2022 · 4 comments
Labels

Comments

@Chicken-Bones
Copy link
Contributor

Game: tModLoader
OS: Windows 10 Home X64 (19044.1586)
Runtime: NetCore 6.0.3

Crashes both with VS attached and when launched from a system or portable dotnet install. Commit 81148b7

Official gamecube controller with https://www.mayflash.com/product/showproduct.php?id=27
No crash when using a generic third party adapter (looks like but might not exactly be https://www.amazon.com/Switch-Gamecube-Controller-Adapter-Nintendo/dp/B07Q459FBQ)

A breakpoint set on the line after SDL_Init never gets hit. Removing SDL_INIT_HAPTIC lets it get further, but it appears to make the process unstable and it crashes not much later.

Log from init with adapter which does work

[18:06:11] [Main Thread/INFO] [FNA]: Controller 0: Nintendo GameCube Controller, GUID: 79004618, Mapping: 03000000790000004618000000016800,*,a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Windows
[18:06:11] [Main Thread/INFO] [FNA]: Controller 1: Nintendo GameCube Controller, GUID: 79004618, Mapping: 03000000790000004618000000016800,*,a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Windows
[18:06:11] [Main Thread/INFO] [FNA]: Controller 2: Nintendo GameCube Controller, GUID: 79004618, Mapping: 03000000790000004618000000016800,*,a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Windows
[18:06:11] [Main Thread/INFO] [FNA]: Controller 3: Nintendo GameCube Controller, GUID: 79004618, Mapping: 03000000790000004618000000016800,*,a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,platform:Windows
@Chicken-Bones
Copy link
Contributor Author

Looking through the diff between our version and the latest, I should try with 921bdb5

@flibitijibibo
Copy link
Member

You're probably looking at something in SDL instead - the SDL VisualC folder includes some controller tests, try those and file a report here: https://github.com/libsdl-org/SDL/issues

@Chicken-Bones Chicken-Bones changed the title call to SDL_Init crashes process with AccessViolation when gamecube controller and mayflash adapter Call to SDL_Init crashes process with AccessViolation when gamecube controller and mayflash adapter attached May 24, 2022
@Chicken-Bones
Copy link
Contributor Author

Chicken-Bones commented May 25, 2022

Update, with 089197a it crashes at SDL.SDL_GameControllerOpen(dev);

Probably won't have time to try and run SDL tests unless I can get a binary from someone, so I'll just leave it here as a reference open issue for anyone in the future.

@flibitijibibo
Copy link
Member

Here is the sln you want: https://github.com/libsdl-org/SDL/tree/main/VisualC

It depends on nothing other than Win32 (it doesn't even require msvcrt), so if you have some kind of VS you'll be able to build everything in a few seconds (even with modern Visual Studio).

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

No branches or pull requests

2 participants