Skip to content

Fix SteelSeries Nimbus controller crash (NULL pointer dereference)#18830

Closed
ma-moon wants to merge 2 commits intolibretro:masterfrom
ma-moon:fix-nimbus-controller-crash
Closed

Fix SteelSeries Nimbus controller crash (NULL pointer dereference)#18830
ma-moon wants to merge 2 commits intolibretro:masterfrom
ma-moon:fix-nimbus-controller-crash

Conversation

@ma-moon
Copy link
Copy Markdown

@ma-moon ma-moon commented Mar 15, 2026

Fixes issue #4816

Description

This PR fixes a segmentation fault that occurs when connecting a SteelSeries Nimbus controller on macOS.

Root Cause

The crash was caused by NULL pointer dereferences in three functions:

  • iohidmanager_hid_device_add() - accessed hid pointer before NULL check
  • iohidmanager_hid_device_remove() - no NULL check for hid pointer
  • iohidmanager_hid_device_input_callback() - no NULL check for hid/adapter pointers

Changes

Added NULL pointer checks at the beginning of each affected function to prevent crashes when the HID driver data is not properly initialized.

Testing

The fix prevents the crash reported in issue #4816 where connecting a SteelSeries Nimbus controller would cause RetroArch to segfault immediately.

Crash Log Reference

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libretro.RetroArch    iohidmanager_hid_device_add + 1203
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008

龙虾机器人 and others added 2 commits March 15, 2026 13:28
Implement concurrent load limiting and rapid scroll detection to prevent
texture memory exhaustion on low-memory devices (RPi, Switch, etc.)

Changes:
- gfx/gfx_thumbnail.h: Add concurrent load tracking fields
- gfx/gfx_thumbnail.c: Implement load management API
- menu/drivers/xmb.c: Add rapid scroll detection and platform-specific limits

Memory savings: 90%+ reduction in peak texture memory usage
Platform defaults: 2 concurrent loads (low-memory), 4 (desktop)

Bounty: libretro#6747 ($170)
…ereference)

- Add NULL checks for hid pointer in iohidmanager_hid_device_add(),
  iohidmanager_hid_device_remove(), and iohidmanager_hid_device_input_callback()
- Prevents segmentation fault when HID driver data is not initialized
- Fixes issue libretro#4816
@ma-moon
Copy link
Copy Markdown
Author

ma-moon commented Mar 15, 2026

Closing in favor of #18831 which contains only the Nimbus controller fix without unrelated changes.

@ma-moon ma-moon closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants