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

Panic running guide example on OSX #73

Closed
jjl opened this issue Dec 6, 2018 · 6 comments
Closed

Panic running guide example on OSX #73

jjl opened this issue Dec 6, 2018 · 6 comments
Labels
bug Something isn't working platform:macos Issue appears on macOS

Comments

@jjl
Copy link

jjl commented Dec 6, 2018

Description

Crash attempting to compile the code from the guide

Version / OS

  • azul version: master
  • Operating system: Mac OS 10.13.6

Steps to Reproduce

Compile this code (from the guide):

extern crate azul;

use azul::prelude::*;

struct AppModel {
}
impl Layout for AppModel {
    fn layout(&self, _: WindowInfo<Self>) -> Dom<Self> {
        Dom::new(NodeType::Div)
    }
}

fn main() {
    let app = App::new(AppModel { }, AppConfig::default());
    let window = Window::new(WindowCreateOptions::default(), Css::native()).unwrap();
    app.run(window).unwrap();
}

Expected Behavior

Shows a window

Actual Behavior

[ERROR][azul::logging] An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

The error ocurred in: /Users/james/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/azul_glium-0.22.0/src/context/mod.rs at line 644 in thread main

Error information:
assertion failed: backend.is_current()

Backtrace:

Additional Information

Similar symptoms to #18, but that has a backtrace and appears in different code.

Happy to help debug, a mac is my main environment right now.

@fschutt
Copy link
Owner

fschutt commented Dec 6, 2018

Yeah, this is probably the same as in #50 (comment). The real problem is that there is no backtrace anymore, which happened after upgrading glium. A similar error happens on Wayland (I did disable backtraces in glium because historically they've not been very useful).

Not sure if this is also related to servo/webrender#3318, but I can't see any checks for the OpenGL context. The line that crashes is here: https://github.com/fschutt/glium/blob/cda2cc0229f430baa72b49a3e407c153221b3c8d/src/context/mod.rs#L645, however, since the lines (make_current() and is_current()) are directly after each other, this may be a caching issue with glium (happens too often, sadly).

Can you run it in release mode and see if there's any output?

@fschutt fschutt added bug Something isn't working platform:macos Issue appears on macOS labels Dec 6, 2018
@jjl
Copy link
Author

jjl commented Dec 6, 2018

In release mode, I get a blank window!

@nilsmartel
Copy link

@jjl the very same thing happened to me. It's and known and open bug. Take a look at #5 for more Information

@user345987
Copy link

I have exactly the same problem on macos.
If I change the dependency azul_glium to glium with the same version 0.22.0, it works on debug build. Is this a bug in azul_glium?

@7sDream
Copy link

7sDream commented Jan 2, 2019

@fschutt

Maybe I meet the same issue, but I can see the backtrace:

[ERROR][azul::logging] An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

The error ocurred in: /Users/7sdream/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/azul_glium-0.22.0/src/context/mod.rs at line 644 in thread main

Error information:
assertion failed: backend.is_current()

Backtrace:

azul::logging::set_up_panic_hooks::panic_fn @ logging.rs:87
core::ops::function::Fn::call @ function.rs:78
std::panicking::rust_panic_with_hook @ panicking.rs:480
std::panicking::begin_panic @ panicking.rs:410
<azul_glium::context::Context as azul_glium::ContextExt>::make_current @ mod.rs:644
azul_glium::context::Context::new @ mod.rs:221
azul_glium::backend::glutin::Display::new_inner @ mod.rs:113
azul_glium::backend::glutin::Display::with_debug @ mod.rs:92
<azul::window::Window<T>>::new @ window.rs:777
counter::main @ main.rs:13
std::rt::lang_start::{{closure}} @ rt.rs:74
std::panicking::try::do_call @ panicking.rs:310
 @ lib.rs:102
std::rt::lang_start_internal @ panicking.rs:289
std::rt::lang_start @ rt.rs:74

Version bc0b00c, Any help?


Update: Build and run in release mode successfully, no crash.

@fschutt
Copy link
Owner

fschutt commented Jan 26, 2019

Well, this has been "fixed" by simply removing that line. I don't know why this line was there, but I've gotten reports that it seems to work fine without it. So this was "fixed" in 60df3d6 - should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform:macos Issue appears on macOS
Projects
None yet
Development

No branches or pull requests

5 participants