| Summary: | Default for SDL_SIMDAlignment causes crashes on some 64-bit systems | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Simon Howard <fraggle+libsdl> |
| Component: | main | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.10 | Keywords: | target-2.0.12 |
| Hardware: | Other | ||
| OS: | OpenBSD | ||
| Attachments: | Patch to fix bug. | ||
Your patch is now https://hg.libsdl.org/SDL/rev/568f67c04841, thanks! --ryan. |
Created attachment 3989 [details] 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.