-
Notifications
You must be signed in to change notification settings - Fork 138
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
M1 Mac: Apparent segfault (exit code 139) #14
Comments
I feel like this must be in Foster's opengl rendering code somewhere. Will try to debug this but I don't have an M1 mac super accessible right now, so it may take a bit. |
Sure thing no worries. If there's debug flags I could compile with to get a more detailed output I'm happy to look or step through somehow. |
I am able to run after multiple attempts. The game crashes on the first restore though. One possible difference is that I have There is no crash with |
I've updated on git to 0aea6cb, and now it looks like I can't build it at all on account of it's expecting
|
Update: I can get it to build with *( |
I think this line would need to be amended to include and then the build action likely needs updating to also include osx-arm versions, right now it's only doing x64 as far as I know. All that said if you're still getting segfaults on latest when you build it yourself, something must still be broken despite recent fixes in Foster ... hmm. |
Tried on a fresh clone as well, here's the log in case that's helpful. |
For those that are still running into crashes, what worked for me was following a comment from another issue in this repo: Simply manually copying over the fmod dylib files
and then setting the flag as mentioned in the comment linked above: cp Source/Audio/FMOD/libs/osx/libfmod*.dylib bin/Release/net8.0/osx-arm64/ # can change to Debug if not running release build
# This actually fixed the crash, assuming a homebrew installation
export DOTNET_ROOT="/opt/homebrew/opt/dotnet/libexec" Worked for me, hopefully helps others. Have a great day! EDIT: This seemed to have just allowed me to run it, on the third run it actually segfaulted as documented by others. Leave the comment in case it actually helps in any way, happy to remove if not useful as well |
For |
Nice, I've done that! That sounds correct. |
Hot off the M1 presses with a clean checkout of 1ee558c, it's a SEGFAULT log! (It has a different exit code compared to OP, mind. I can make a new issue if this isn't ok) To repro:
The window opened for a few hundred milliseconds (attempted to go fullscreen) before producing the crash log. Happens with and without Managed to track down the offending vertex shader lines. The top two refer to |
Yeah I'm currently still at a loss for what is causing the segfault. The actual error seems to occur when it tries to swap buffers. On my end that code is very straightforward: void FosterFrameEnd_OpenGL()
{
FosterState* state = FosterGetState();
// bind 0 to the frame buffer as per SDL's suggestion for macOS:
// https://wiki.libsdl.org/SDL2/SDL_GL_SwapWindow#remarks
FosterBindFrameBuffer(NULL);
SDL_GL_SwapWindow(state->window);
} so something must be going wrong either in how stuff is setup, or there's some other potential issue I'm unaware of. |
Hello everyone! I'm trying to run the game on my Macbook Pro (2021, M1 Pro) and I'm getting the same segfault error when executing the game. I've played a little bit with the source code and found out two things. 1. Fixed Time Step public override void Render(Target target)
{
target.Clear(Color.White, 1, 0, ClearMask.All);
batch.Render(target);
batch.Clear();
} and still this only works consistently when the fixed step is off, even though in this case an error is logged reporting 2. Logging (segfault unrelated)
The error related code seems to be in the case of the Hope some of this will be useful in making the game playable on MacOS also! 😄 |
This is great, thanks for the details! The fixed timestep issue is interesting ... I'm not sure how that would be causing it but I'll investigate. The Logging error is because the C# GC is collecting a delegate used only by C, but I thought I had fixed that by holding onto the reference. Do you know if you were running on a the latest version? |
Some news 📰 1. Logging 2. segfault if (Time.FixedStep && Time.Frame > 0) Doing the first update using the "unfixed" strategy and then switching back to the fixed one seems to resolve the issue. Maybe the game is doing something when updating that if done multiple times on the first tick can cause the segfault error? namespace Celeste64;
public class Test : Scene
{
private readonly Batcher batch = new();
public Test()
{
Music = "event:/music/mus_title";
}
public override void Update()
{
if (Controls.Cancel.Pressed)
{
App.Exit();
}
}
public override void Render(Target target)
{
target.Clear(Color.White);
batch.Circle(new Vector2(100, 100), 30.0f, 100, Color.Black);
batch.Render(target);
batch.Clear();
}
} Even though this might not be a viabile or a reasonable solution, I hope this could help in investigating this error further 💻 |
I wonder if the issue occurs if it Renders before Update is ever called. I notice that basically your fix just forces Update to be called once at the start of the application before Render is. I still have no idea why that would make a difference, but this is a really useful insight! |
Maybe running a glFlush before calling |
To reproduce:
What I observe when I run the game with
dotnet run
is that the game opens, transitions to full screen, and then immediately closes. Every once in a while I've been able to get it to load the opening animation, but then it immediately closes again.My partner has tested on her Intel mac and it seems to work okay.
Thank you so much for this game, I'm super hyped to play it. I hope this report is helpful, and I'm happy to test anything you like.
Cheers!
jneen
The text was updated successfully, but these errors were encountered: