Skip to content

Comments

Builds on macOS#3

Draft
jminor wants to merge 1 commit intojarikomppa:mainfrom
jminor:macos
Draft

Builds on macOS#3
jminor wants to merge 1 commit intojarikomppa:mainfrom
jminor:macos

Conversation

@jminor
Copy link

@jminor jminor commented Oct 29, 2022

This PR allows Sassy to build and run on macOS, but sadly it crashes at runtime in the JIT-compiled eval_all() during audio callback.

I suspect this is the same issue mentioned in #1 on Linux.

Any clues about how to diagnose the problem?

Note that the macOS build settings in the Makefile are slightly odd given that I'm building on an M1 arm64 machine, but asking the compiler to build an x86_64 executable to run under Rosetta 2. In theory this should work, even with JIT code, as documented here: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment but if someone has an Intel Mac to test on, it would be good to verify that this is/isn't related to the crash.

@jminor
Copy link
Author

jminor commented Oct 29, 2022

Here's a screenshot of the macOS build running.
Screenshot 2022-10-28 at 11 29 13 PM

Note that formulas with arithmetic work 2*99+17+(15*9) but if you try to call any function time() or mention another cell a4 then it crashes inside the audio callback, inside eval_all

Screenshot 2022-10-28 at 11 10 57 PM

Curiously the debugger seems to have lost its place within eval_all which might imply some stack corruption?

Thread 7 Crashed:: SDLAudioP2
0   <translation info unavailable>	       0x100c084ec ???
1   sassy                         	       0x100449a62 eval_all() + 162
2   sassy                         	       0x100449a62 eval_all() + 162
3   sassy                         	       0x100449caf sdl2_audiomixer(void*, unsigned char*, int) + 415
4   libSDL2-2.0.0.dylib           	       0x10929884f SDL_RunAudio + 208
5   libSDL2-2.0.0.dylib           	       0x1092ee767 SDL_RunThread + 53
6   libSDL2-2.0.0.dylib           	       0x109356385 RunThread + 9
7   libsystem_pthread.dylib       	    0x7ff8124bb259 _pthread_start + 125
8   libsystem_pthread.dylib       	    0x7ff8124b6c7b thread_start + 15

@jminor jminor mentioned this pull request Oct 29, 2022
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

Successfully merging this pull request may close these issues.

1 participant