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

connecting controller results in segmentation fault on Linux with sdl2-compat installed #1129

Closed
1 task done
meristo opened this issue Jan 29, 2025 · 10 comments
Closed
1 task done
Labels
bug Something isn't working SDL issue Issue with SDL library, which should be reported to SDL devs

Comments

@meristo
Copy link

meristo commented Jan 29, 2025

Is there an existing issue for this?

  • I searched the existing issues and did not find anything similar.

Current Behavior

On Arch Linux, sdl2 has been replaced with sdl2-compat, an SDL2 compatibility layer that uses SDL3 behind the scenes. With this installed, connecting any controller results in antimicrox encountering a segmentation fault (address boundary error). Downgrading back to the old sdl2 allows antimicrox to launch and run without issues.

Expected Behavior

Antimicrox should recognize the new controller and continue to run and function normally.

Steps To Reproduce

  1. Have sdl3 and sdl2-compat installed.
  2. Run antimicrox
  3. Connect any controller (tested with both xbox and DS4, wired and wireless)
  4. antimicrox immediately exits with segmentation fault

Environment

Program Version 3.5.1
Program Compiled on Jan 29 2025 at 04:08:49
Built Against SDL 2.30.50
Running With SDL 2.30.50
Using Qt 5.15.16
Using Event Handler: uinput
Compositor type: wayland
Host OS: arch Version: unknown Architecture: x86_64

Anything else?

Debug log attached, please let me know if there's any other info I can provide that will be useful.

antimicrox3.log

@meristo meristo added the bug Something isn't working label Jan 29, 2025
@GB609
Copy link

GB609 commented Jan 29, 2025

I'm having the same issue with AntiMicroX 3.5.0-1 from extra repo

@pktiuk
Copy link
Member

pktiuk commented Jan 29, 2025

Hello @meristo @GB609,

AFAIK sdl2-compat should be a drop-in replacement (If I miss something, please tell me), so apps using it instead of SDL2 should not crash almost by definition.
Are you sure, this issue should not be reported to the developers of this library instead?

@pktiuk pktiuk added the SDL issue Issue with SDL library, which should be reported to SDL devs label Jan 29, 2025
@GB609
Copy link

GB609 commented Jan 29, 2025

@pktiuk Thanks for the response.
Being a drop-in replacement just means the API in the library is identical, not that the underlying implementation is also the same. If that other backend has issues not expected in the apps using it, it will lead to crashes.
Anyway, you are right. That is something that should be invisible and completely transparent to antimicrox.

I've checked the repository of sdl2-compat itself just now.

There is one issue open that seems related in same way or another: libsdl-org/sdl2-compat#255.

However, they claim it's not sdl2-compat itself, but the actual sdl3 backend in use that has issues. Regardless, this appears to be related to sdl2-compat.

(edit: typo)

@pktiuk
Copy link
Member

pktiuk commented Jan 29, 2025

So in this case I will wait until it will be fixed there.
And in the meantime, I will start porting AntiMicroX to SDL3 #1106

@mandle420
Copy link

same issue. running arch with 7950x and 7800xt. hotas is already connected. starts when hotas disconnected, but segfaults when connected.
~]$ antimicrox
❌ERROR Received SIGSEGV (segmentation fault)
❗WARN Stack trace:
❗WARN antimicrox(+0xa41a5) [0x62b730de01a5]
❗WARN /usr/lib/libc.so.6(+0x3d1d0) [0x73ad6824c1d0]
❗WARN /usr/lib/libSDL2-2.0.so.0(+0x150bb) [0x73ad6950c0bb]
❗WARN /usr/lib/libSDL2-2.0.so.0(+0x15a63) [0x73ad6950ca63]
❗WARN antimicrox(+0x1d7933) [0x62b730f13933]
❗WARN /usr/lib/libQt5Core.so.5(+0x2e31de) [0x73ad68ae31de]
❗WARN /usr/lib/libQt5Core.so.5(_ZN7QThread7startedENS_14QPrivateSignalE+0x3e) [0x73ad688ee42e]
❗WARN /usr/lib/libQt5Core.so.5(+0xf2942) [0x73ad688f2942]
❗WARN /usr/lib/libc.so.6(+0x942ce) [0x73ad682a32ce]
❗WARN /usr/lib/libc.so.6(+0x11929c) [0x73ad6832829c]
Segmentation fault (core dumped)

@mandle420
Copy link

AppImage works fine

@pktiuk pktiuk marked this as a duplicate of #1131 Jan 31, 2025
@brosasaki
Copy link

I am having a similar segfault on Guix, which does not use an sdl3->2 compatibility layer #1131.

@skryvel
Copy link

skryvel commented Feb 1, 2025

Became libsdl-org/sdl2-compat#286 with a pull request if anyone wants to test it. AntiMicroX seems happy with the changeset. At least in a simple test it worked again as expected.

@meristo
Copy link
Author

meristo commented Feb 3, 2025

Became libsdl-org/sdl2-compat#286 with a pull request if anyone wants to test it. AntiMicroX seems happy with the changeset. At least in a simple test it worked again as expected.

Your fix is in 2.30.52, which is already in the Arch repos. It's working beautifully, no more segfault. Great work.

Closing this as resolved.

@meristo meristo closed this as completed Feb 3, 2025
@pktiuk
Copy link
Member

pktiuk commented Feb 3, 2025

That's great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDL issue Issue with SDL library, which should be reported to SDL devs
Projects
None yet
Development

No branches or pull requests

6 participants