-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
segmentationi fault on Mac M2 #11568
Comments
Is the SDL2 version up to date in brew? There were known issues with joysticks crashing in earlier versions. |
it's .258 but doesn't show from which commit. I'm building from source right now, let's see |
I've build from git. I get the same results: first try on usb->usbc adapter
2nd try on mac original usb -> usbc converter
back on the first adapter
Is there something special to add when building? I just ran make (after installing sdl) |
here's the logs |
The question is whether the SDL2 framework is up-to-date. What exact version of SDL2 do you have installed? |
Yes. "brew list sdl2" will show the installed version. On my system, I get "/usr/local/Cellar/sdl2/2.28.3/bin/sdl2-config", meaning I have 2.28.3, the latest. |
I also get the same from brew. I didn't know I had it from brew, so before building I've download and installed the latest one from the sdl2 website into /Library/Frameworks/. That's also 2.28.3. |
`matt@10-0-0-38 mame % otool -L mame | grep SDL @rpath/SDL2.framework/Versions/A/SDL2 (compatibility version 2801.0.0, current version 2801.3.0)` |
Ok. Can you run MAME with -verbose and paste the part of the output where it's setting up the joysticks? We've had repeated issues with cheap junk that sends invalid things according to HID specs and needs to be filtered out. Real Sony/MS/Nintendo pads work fine, of course. Also if you could get a backtrace that would be great. You do that like this:
|
I'll try this. I'm not home until tomorrow night, but in the meantime I've tried with a xbox controller, and that worked. |
|
I gave it another run with tetris grandmaster
|
just a note: running |
The first stack trace looks a lot like memory corruption. The actual bug likely did the damage long before the point where it crashed. The second one I have no idea what would cause it to crash there (could be memory corruption as well). |
There is an issue on arm with char defaulting to unsigned on android and the pi (not sure on macos ). It causes issues in many places such as brapboys not booting and random places and certain inputs not working working in some games. Try adding ARCHOPTS="-fsigned-char" to the compile command line and see if that helps. Im not saying this is the issue on the mac but its is on android and pi. I dont use mac but its worth a test. https://developer.arm.com/documentation/den0013/d/Porting/Miscellaneous-C-porting-issues/unsigned-char-and-signed-char?lang=en |
That didn't work |
Sorry for wasting you time with that, its certainly causes issues an a few things on android and the pi. |
no worries! |
anyways: I've tried with logitech Precision joypads and also get seg faults.
|
Just to resume: I've tried different versions of mame (.249, .258, .258) both from sdlmame website or by compiling them.
Is anything else I can test? |
Hi, I've recently encountered what looks like the same bug running MAME 274 and SDL2 2.32.0 on my new Mac Mini M4 with a "speedlink competition pro" joystick plugged in. Interestingly the FS-UAE Amiga emulator, which also uses SDL, worked fine. Digging a little deeper I discovered that they bundle a very old version of the SDL framework with their application. Copying this approach I installed SDL2 version 2.0.20 and with this MAME works fine with my joystick :-) So rolling back to an old version of SDL seems like a work around (at least for my joystick). With 2.32.0 I was able to get a seg fault using the following simple test program. It crashed inside SDL_Init().
I will try and raise this with the SDL people when I get time. |
I've logged this issue libsdl-org/SDL#12255 |
MAME version
0.258
System information
MacBook Pro 64 GB
Apple M2 Max
Ventura 13.3
Metal 3
INI configuration details
Emulated system/software
No response
Incorrect behaviour
Mame crashes with a segmentation fault only if the joysticks are connected.
crashlogs.zip
With only 1 joysticks connected I was able to run mame, scroll to some games and as soon as I launched them they crashed.
I was able to play super mario bros (vs) and pacland (for like few seconds though). Then I also had a seg fault.
With two joysticks attached it doesn't even start (see above the terminal output).
With no joysticks attached it runs perfectly.
Expected behaviour
Mame doesn't crash and I play my games happily with my friends and we use joysticks!
Steps to reproduce
cd ~/mame
mame
--> seg fault if joysticks are connected
Additional details
I've installed mame 0.258 with brew.
The text was updated successfully, but these errors were encountered: