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

AppKit not being called from main thread #425

Closed
mystise opened this issue Feb 1, 2015 · 20 comments
Closed

AppKit not being called from main thread #425

mystise opened this issue Feb 1, 2015 · 20 comments
Labels

Comments

@mystise
Copy link

mystise commented Feb 1, 2015

I'm not sure how to handle this in a cross platform manner, but calling any AppKit method on a background thread is disallowed and undefined behavior (And Glium uses exclusively that)

This is a possible cause of the Glium examples beach-balling on Mac.

Note: I'm posting this to both Glium and Glutin's pages, as I'm not sure where it's best to solve this.

rust-windowing/glutin#245

@tomaka
Copy link
Member

tomaka commented Feb 1, 2015

I guess I can put the window in an Arc shared between the display and the context, so that poll_events directly calls the underlying function instead of being polled from another thread.

@tomaka
Copy link
Member

tomaka commented Feb 1, 2015

That won't fix the tests however.

@tomaka
Copy link
Member

tomaka commented Feb 2, 2015

Could you try if it works now?

@mystise
Copy link
Author

mystise commented Feb 2, 2015

It no longer beachballs, but now it crashes with the extremely unhelpful error message of: "An unknown error occurred

To learn more, run the command again with --verbose"

When run with --verbose: "Process didn't exit successfully: target/metallurgical_rust (status=11)"

And this crash log: http://pastebin.com/kf2P41By

This seems to happen when I move the mouse, if I leave the mouse alone it just sits there without beach balling. Clicking or typing do not crash it, only moving the mouse.

@tomaka
Copy link
Member

tomaka commented Feb 2, 2015

Could you try running one of glutin's examples to see if it comes from glutin?

@mystise
Copy link
Author

mystise commented Feb 2, 2015

Running the window example from Glutin has the same error, keyboard and clicks work fine, while mouse movement crashes with this crash report: http://pastebin.com/VjV4gWzd

@tomaka
Copy link
Member

tomaka commented Feb 2, 2015

Thanks!

I opened rust-windowing/glutin#248

@tomaka tomaka closed this as completed Feb 2, 2015
@tomaka
Copy link
Member

tomaka commented Feb 2, 2015

Hmm, I think that glutin's example work for some people on OS/X, so could anyone else check if it works?
(@palango @camjackson @TyOverby ?)

@tomaka tomaka reopened this Feb 2, 2015
@InfiniteDarkness
Copy link

The glutin examples have the same problem on my machine.

@TyOverby
Copy link
Collaborator

TyOverby commented Feb 2, 2015

Yeah, the examples are breaking on my machine too.

https://gist.github.com/TyOverby/f456fd6f19c7e6257bda

@InfiniteDarkness
Copy link

I think this is an issue with glutin, not glium. I wouldn't be surprised if the issue with glium is fixed now, and that one of the more recent edits to the OS X code broke something, and that the bug in glium prevented the code that crashes it now from running.

@tomaka
Copy link
Member

tomaka commented Feb 2, 2015

@InfiniteDarkness That's also what I think, but I'd like to be sure that it's fixed before closing this issue.

@camjackson
Copy link
Contributor

In case you needed any more confirmations, glutin's window example beachballs and a crashes for me now too. Crash dump

@tomaka
Copy link
Member

tomaka commented Feb 3, 2015

Glutin's issue should be fixed now (but don't update rustc because things broke with the latest nightly).

@camjackson
Copy link
Contributor

Can confirm that the glutin examples seem to run fine for me. I'd already updated rustc though, so I haven't been able to test glium.

@InfiniteDarkness
Copy link

Glium doesn't crash anymore, and the beachball of death is gone now. We still don't have any events, though.

@tomaka
Copy link
Member

tomaka commented Feb 11, 2015

Could you try again now that rust-windowing/glutin#70 is merged?

@InfiniteDarkness
Copy link

I'm getting most events now, but glutin::Event::Closed (the one I actually care about) is still broken.

@tomaka
Copy link
Member

tomaka commented Feb 11, 2015

At least it's getting better :)

It's probably a bug only in glutin now. Thanks!

@tomaka tomaka closed this as completed Feb 11, 2015
@tomaka
Copy link
Member

tomaka commented Feb 11, 2015

Follow-up: rust-windowing/glutin#257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants