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

Default for SDL_SIMDAlignment causes crashes on some 64-bit systems #3429

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.10
Reported for operating system, platform: OpenBSD, Other

Comments on the original bug report:

On 2019-10-21 01:52:59 +0000, Simon Howard wrote:

Created attachment 3989
Patch to fix bug.

In SDL_cpuinfo.c the default value for SDL_SIMDAlignment is set to 4 unless system-specific CPU features are detected. This can cause SDL_SIMDAlloc() to crash on MIPS64 systems because memory is allocated on 4-byte boundaries, but MIPS64 requires 8-byte alignment (unaligned accesses cause a Bus Error).

Changing to sizeof(void *) should make for a safer default and fixes the crash. Diff attached.

On 2019-10-21 02:19:54 +0000, Ryan C. Gordon wrote:

Your patch is now https://hg.libsdl.org/SDL/rev/568f67c04841, thanks!

--ryan.

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

No branches or pull requests

1 participant