servo/cocoa-rs

Crash!

Closed this issue · 7 comments

My dead-simple application which depends on rust-cocoa crashes when I merge c4b1941. You can reproduce the error with simnalamburt/fate@ba2615e

glium-practice[19076:161627] +[NSOpenGLContext initWithFormat_shareContext:]: unrecognized selector sent to class 0x7fff7682a850

Go here to see the core dump. Sadly, I failed to print stacktrace.

Any chance you can submit a modification of your dead-simple app as a unit test?

@metajack I think below would be the smallest error reproduction but let me test it first Codes below are smallest error reproduction at this point. Core dump

extern crate glutin;

fn main() {
    let _ = glutin::Window::new();
}
test[19785:168063] +[NSOpenGLContext initWithFormat_shareContext:]: unrecognized selector sent to class 0x7fff7682a850
[1]    19953 illegal hardware instruction  ./test

cc me

Argh it's all my fault again!

The offending line is:

msg_send()(class("NSOpenGLContext"), selector("initWithFormat_shareContext:"), format, shareContext)

Should be selector("initWithFormat:shareContext:").

Duh.

Added a PR.