Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

SDL does not call usbh_core_deinit() on exit #45

@LoveMHz

Description

@LoveMHz

In its current implementation, SDL does not call usbh_core_deinit() on exit.

When software exits, or when an XBE is launched, the system performs a soft reset, but the kernel has no mechanisms, to my knowledge, that would reset the USB hardware (all retail software attempts to uninitialize previously initialized hardware on exit).

This leaves a brief amount of time where, from soft-reset to the next application re-initializing the USB stack, that memory corruption can occur due to the USB hardware now pointing to an invalid region of memory.

I understand that as implemented, it's implied that it's up to the application to call usbh_core_deinit(). Ref

I'm opening this issue because I can not find any proof that software is currently doing this, and I believe it is an anti-pattern to the design and implementation goals of SDL.

I believe we need to handle this better, and I'm open to discussing what would be the better implementation. Right now, I'm investigating any possible side effects that may arise from this type of change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions