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

MacOS crash on SDL_PumpEvents #696

Open
1 of 2 tasks
cclark25 opened this issue Jun 15, 2024 · 5 comments
Open
1 of 2 tasks

MacOS crash on SDL_PumpEvents #696

cclark25 opened this issue Jun 15, 2024 · 5 comments
Labels
bug Something isn't working crash This issue results in a crash, higher priority

Comments

@cclark25
Copy link
Contributor

Description of the crash:

When launching the application on MacOS, there are sporadic crashes when a game control activates input.
Using a debugger, it appears that this is due to a segfault produced by various different calls to SDL_PumpEvents. The primary location where this is is happening appears to be libultraship/src/controller/deviceindex/ControllerDisconnectedWindow.cpp:17.

Can you reproduce? If so please list the steps:

  • No, I cannot reproduce this crash
  • Yes, here are the steps to reproduce the crash:
  1. Launch the application on MacOS.
  2. While launching, activate any controller endpoint.
  3. If the crash doesn't occur, try again. This sometimes doesn't happen until around the 10th attempt, and other times it happens nearly every time the app is launched.

Logs:

[2024-06-15 17:36:59.227] [/Users/user/GIT/2ship2harkinian/libultraship/src/resource/archive/ArchiveManager.cpp:152] [info] Reading archive: /Users/user/GIT/2ship2harkinian/./mm.o2r
[2024-06-15 17:36:59.467] [/Users/user/GIT/2ship2harkinian/libultraship/src/resource/archive/ArchiveManager.cpp:182] [info] Adding Archive /Users/user/GIT/2ship2harkinian/./mm.o2r to Archive Manager
[2024-06-15 17:36:59.518] [/Users/user/GIT/2ship2harkinian/libultraship/src/resource/archive/ArchiveManager.cpp:152] [info] Reading archive: /Users/user/GIT/2ship2harkinian/build-cmake/mm/2ship.o2r
[2024-06-15 17:36:59.519] [/Users/user/GIT/2ship2harkinian/libultraship/src/resource/archive/O2rArchive.cpp:28] [trace] Failed to find file version in zip archive  /Users/user/GIT/2ship2harkinian/build-cmake/mm/2ship.o2r.
[2024-06-15 17:36:59.519] [/Users/user/GIT/2ship2harkinian/libultraship/src/resource/archive/ArchiveManager.cpp:182] [info] Adding Archive /Users/user/GIT/2ship2harkinian/build-cmake/mm/2ship.o2r to Archive Manager
[17:37:00.071] [os.cpp:27] [error] Failed add SDL game controller mappings from "./gamecontrollerdb.txt" (Invalid RWops)
Segmentation fault: 11

System Information:

  • OS: MacOS 14.2
  • GFX Backend: happens on both Metal and OpenGL
  • Game Version: develop branch (commit e60ca15)
  • Rom Version: ROM MD5 2A0A8ACB61538235BC1094D297FB6556
@cclark25 cclark25 added bug Something isn't working crash This issue results in a crash, higher priority labels Jun 15, 2024
@cclark25
Copy link
Contributor Author

I tried to figure out how to resolve this, but I was unable to find anything.
The PumpEvent calls are producing segfaults even when I confirmed that they are called on the main thread, which is the same thread that is Init-ing the SDL subsystems.
I also confirmed that SDL_WasInit is reporting that the subsystems were initialized prior to the segfaults.
I also couldn't find anything online related to this issue either.

@cclark25
Copy link
Contributor Author

I just confirmed that this issue is not happening on the Linux build.
The chances seem strong that this is a weird condition specific to MacOS.

@cclark25
Copy link
Contributor Author

This could possibly be related to this issue on the SDL repo: libsdl-org/SDL#9042
It may be possible to resolve this by upgrading the SDL version of the app, which I am not sure how to do here.

@cclark25
Copy link
Contributor Author

This appears to only happen with my Logitech Wireless Gamepad F710.
I have connected my Switch Joycons as a controller and don't see the same issue.

@louist103
Copy link
Contributor

This could possibly be related to this issue on the SDL repo: libsdl-org/SDL#9042 It may be possible to resolve this by upgrading the SDL version of the app, which I am not sure how to do here.

Updating SDL would be Libultraship's responsibility. It might be worth it to this on SoH and if it happens there, open an issue on libultraship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash This issue results in a crash, higher priority
Projects
None yet
Development

No branches or pull requests

2 participants