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

Getting make_current error 3008 on Ubuntu 18.04 when closing window #1141

Closed
fasihrana opened this issue Apr 8, 2019 · 10 comments
Closed

Getting make_current error 3008 on Ubuntu 18.04 when closing window #1141

fasihrana opened this issue Apr 8, 2019 · 10 comments
Milestone

Comments

@fasihrana
Copy link

fasihrana commented Apr 8, 2019

I'm getting the following error when closing a window on Ubuntu. I'm not getting this error on Windows and the code works perfectly.

You can find the code I'm executing at fasihrana/skryn/tree/ubuntu_egl_3008_error.

All you have to do is
cargo run --example mainexample

Edit: When you run the example mainexample, make sure you click the the button "Press Here", to create a new window and close this new window.

Note: There are some requirements for compiling harfbuzz crate.

Drop window ID WindowId(X(WindowId(41943056))), thread ID: ThreadId(0)
thread 'WRRenderBackend#0' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libcore/result.rs:997:5
stack backtrace:
   0:     0x55bb83ca1e43 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hf8722b0178fb1b63
Window ID dropped WindowId(X(WindowId(41943056))),, thread ID: ThreadId(0)
making window current WindowId(X(WindowId(41943045))), thread ID ThreadId(0)
thread 'main' panicked at 'make_current: eglMakeCurrent failed (eglGetError returned 0x3008)', /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/api/egl/mod.rs:426:24
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x55bb83c9d658 - std::sys_common::backtrace::_print::hc40139e5f1d656ee
                               at src/libstd/sys_common/backtrace.rs:70
   2:     0x55bb83ca0872 - std::panicking::default_hook::{{closure}}::h993d43465919c16a
                               at src/libstd/sys_common/backtrace.rs:58
                               at src/libstd/panicking.rs:200
   3:     0x55bb83ca05e4 - std::panicking::default_hook::h73d2c2ec3d9ba5a4
                               at src/libstd/panicking.rs:215
   4:     0x55bb83ca0f80 - std::panicking::rust_panic_with_hook::h744417edfe714d72
                               at src/libstd/panicking.rs:478
   5:     0x55bb83ca0b01 - std::panicking::continue_panic_fmt::h3557b3c3fa21b47b
                               at src/libstd/panicking.rs:385
   6:     0x55bb83ca09e5 - rust_begin_unwind
                               at src/libstd/panicking.rs:312
   7:     0x55bb83cb8eac - core::panicking::panic_fmt::h74ee8034b317ceed
                               at src/libcore/panicking.rs:85
   8:     0x55bb832c2b90 - core::result::unwrap_failed::h4f39ca4fd06f8302
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libcore/macros.rs:16
   9:     0x55bb832a8c5a - <core::result::Result<T, E>>::unwrap::h35fa3765b7064c40
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libcore/result.rs:798
  10:     0x55bb82e567d4 - webrender::render_backend::RenderBackend::update_document::hf1bfd6c2608d4d33
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/webrender-0.58.0/src/render_backend.rs:1388
  11:     0x55bb82e50c38 - webrender::render_backend::RenderBackend::run::he6d0d7a733c90a75
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/webrender-0.58.0/src/render_backend.rs:865
  12:     0x55bb82fe6f23 - webrender::renderer::Renderer::new::{{closure}}::hf30883c259a5506b
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/webrender-0.58.0/src/renderer.rs:1953
  13:     0x55bb831e5b14 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1adfd6bce659758f
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/sys_common/backtrace.rs:135
  14:     0x55bb82fada23 - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::hdc2887bb722bb84e
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/thread/mod.rs:469
  15:     0x55bb82e594d3 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h66b1a1844de581d5
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/panic.rs:309
  16:     0x55bb82eb81a9 - std::panicking::try::do_call::h1a9a0b275809d804
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/panicking.rs:297
  17:     0x55bb83ca53f9 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:92
  18:     0x55bb82eb71df - std::panicking::try::h21755799ec75560a
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/panicking.rs:276
  19:     0x55bb82e5ecd5 - std::panic::catch_unwind::hbcaa324931922c2e
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/panic.rs:388
  20:     0x55bb82fad08f - std::thread::Builder::spawn_unchecked::{{closure}}::h0b1f11d2c66f4370
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/thread/mod.rs:468
  21:     0x55bb82fc6618 - <F as alloc::boxed::FnBox<A>>::call_box::h4a9ec11aad2ca9fa
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/liballoc/boxed.rs:734
  22:     0x55bb83ca4b8d - std::sys::unix::thread::Thread::new::thread_start::h6fb76bcf544b6181
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/liballoc/boxed.rs:744
                               at src/libstd/sys_common/thread.rs:14
                               at src/libstd/sys/unix/thread.rs:81
  23:     0x7f4d83f086da - start_thread
  24:     0x7f4d83a1988e - __clone
  25:                0x0 - <unknown>
stack backtrace:
   0:     0x55bb83ca1e43 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hf8722b0178fb1b63
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x55bb83c9d658 - std::sys_common::backtrace::_print::hc40139e5f1d656ee
                               at src/libstd/sys_common/backtrace.rs:70
   2:     0x55bb83ca0872 - std::panicking::default_hook::{{closure}}::h993d43465919c16a
                               at src/libstd/sys_common/backtrace.rs:58
                               at src/libstd/panicking.rs:200
   3:     0x55bb83ca05e4 - std::panicking::default_hook::h73d2c2ec3d9ba5a4
                               at src/libstd/panicking.rs:215
   4:     0x55bb83ca0f80 - std::panicking::rust_panic_with_hook::h744417edfe714d72
                               at src/libstd/panicking.rs:478
   5:     0x55bb83ca0b01 - std::panicking::continue_panic_fmt::h3557b3c3fa21b47b
                               at src/libstd/panicking.rs:385
   6:     0x55bb83ca0a4e - std::panicking::begin_panic_fmt::h376894437226fc7c
                               at src/libstd/panicking.rs:340
   7:     0x55bb837c12e0 - glutin::api::egl::Context::make_current::hd3d5c3c5bc83cdfc
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/api/egl/mod.rs:426
   8:     0x55bb837d1881 - glutin::platform::platform::x11::Context::make_current::hc2e773dcef6204fb
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/platform/linux/x11.rs:373
   9:     0x55bb837e3364 - glutin::platform::platform::Context::make_current::h9455fcadc3aabeba
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/platform/linux/mod.rs:164
  10:     0x55bb837d724a - <glutin::context::Context as glutin::ContextTrait>::make_current::hc1868a544d5703a0
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/context.rs:30
  11:     0x55bb837d75cb - <glutin::windowed::WindowedContext as glutin::ContextTrait>::make_current::h25ca6cd444cb5338
                               at /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.20.0/src/windowed.rs:109
  12:     0x55bb82c58a49 - skryn::gui::window::Window::tick::h733a74bbc17ac65c
                               at src/gui/window.rs:574
  13:     0x55bb82c5a44a - skryn::gui::window::Manager::start::hd75c6ee4063fded7
                               at src/gui/window.rs:727
  14:     0x55bb82bf38c4 - mainexample::main::h3939d2278f5e78d8
                               at examples/mainexample.rs:367
  15:     0x55bb82bf88ef - std::rt::lang_start::{{closure}}::h9adc444a69992c10
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/rt.rs:64
  16:     0x55bb83ca0982 - std::panicking::try::do_call::h7a0381557c6c2cee
                               at src/libstd/rt.rs:49
                               at src/libstd/panicking.rs:297
  17:     0x55bb83ca53f9 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:92
  18:     0x55bb83ca1595 - std::rt::lang_start_internal::he0d8d06abc6f912f
                               at src/libstd/panicking.rs:276
                               at src/libstd/panic.rs:388
                               at src/libstd/rt.rs:48
  19:     0x55bb82bf88c8 - std::rt::lang_start::h1530c9565c32fa80
                               at /rustc/2aa4c46cfdd726e97360c2734835aa3515e8c858/src/libstd/rt.rs:64
  20:     0x55bb82bf39a9 - main
  21:     0x7f4d83919b96 - __libc_start_main
  22:     0x55bb82be44d9 - _start
  23:                0x0 - <unknown>

Process finished with exit code 101
@goddessfreya
Copy link
Contributor

This was fixed in the RC via adding a DisplayLost variant to the things make_current can return. A cheap hack, that was, but since you're also experiencing this issue, I'll look into it. Until then, you can upgrade to glutin v0.21.0-rc1 to resolve this issue.

@goddessfreya
Copy link
Contributor

Can't repo via your example:

tick complete for window ID : Some(WindowId(Wayland(WindowId(94453353581968))))
Drop window ID WindowId(Wayland(WindowId(94453353581968))), thread ID: ThreadId(1)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: StringError("cannot send on closed channel") }', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: rust_begin_unwind
             at src/libstd/panicking.rs:308
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::result::unwrap_failed
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libcore/macros.rs:18
   9: core::result::Result<T,E>::unwrap
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libcore/result.rs:798
  10: webrender_api::api::RenderApi::shut_down
             at /home/gentz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/webrender_api-0.58.0/src/api.rs:1098
  11: skryn::gui::window::Internals::deinit
             at src/gui/window.rs:378
  12: <skryn::gui::window::Window as core::ops::drop::Drop>::drop
             at src/gui/window.rs:676
  13: core::ptr::real_drop_in_place
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libcore/ptr.rs:193
  14: core::mem::drop
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libcore/mem.rs:777
  15: skryn::gui::window::Manager::start
             at src/gui/window.rs:742
  16: mainexample::main
             at examples/mainexample.rs:367
  17: std::rt::lang_start::{{closure}}
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libstd/rt.rs:64
  18: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:293
  19: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  20: std::rt::lang_start_internal
             at src/libstd/panicking.rs:272
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  21: std::rt::lang_start
             at /rustc/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/libstd/rt.rs:64
  22: main
  23: __libc_start_main
             at ../csu/libc-start.c:308
  24: _start
             at ../sysdeps/x86_64/start.S:120

Nor can I recall how I reproduced it before. I'll stay on the look out for it.

@goddessfreya goddessfreya added this to the 0.22 milestone Apr 8, 2019
@fasihrana
Copy link
Author

fasihrana commented Apr 9, 2019

Will try with 0.21.0-rc1 and report back.

Out of curiosity, are you trying with 0.21.0-rc1 or 0.20.0?

I’m wondering if this is to do with a multithreading? I don’t have sufficient knowledge of glutin to know for sure but this is pretty consistently reproduced.

When you run the example mainexample, make sure you click the the button "Press Here", to create a new window and close this new window. Also added this to the description.

@goddessfreya
Copy link
Contributor

goddessfreya commented Apr 9, 2019

Did some git bisect foo, this was fixed by... well, just go read my rant in the source code: 52d6e0f

Anyways, I'm undoing this change for 0.21.0-rc2, because it is unnecessary:

  • Breaking: Added DisplayLost variant to ContextError.

(I was able to repo it in weston, after going back to 0.20.0)
Enjoy, @fasihrana

@goddessfreya
Copy link
Contributor

Closing issue, if it is still broken, feel free to reopen.

@fasihrana
Copy link
Author

Definitely fixed! Will just wait for the publish of 0.21.0 to crates.io.

Thanks for looking into this!

@goddessfreya
Copy link
Contributor

goddessfreya commented Apr 9, 2019

0.21.0-rc1 has already been published (been out since this morning). You must update it in your cargo.toml manually because it is an RC.

@fasihrana
Copy link
Author

Hmmm, Getting the following error when compiling with 0.21.0-rc1 from crates.io

error[E0599]: no method named `get_wayland_display` found for type `&winit::EventsLoop` in the current scope
  --> /home/frana/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/glutin-0.21.0-rc1/src/platform/linux/wayland.rs:53:30
   |
53 |         let display_ptr = el.get_wayland_display().unwrap() as *const _;
   |                              ^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

@goddessfreya
Copy link
Contributor

Update winit.

@goddessfreya
Copy link
Contributor

@fasihrana If you got any other problems, feel free to join us at the chat: https://github.com/tomaka/glutin#contact-us

Heads up, RC2 will soon be out: #1142

@goddessfreya goddessfreya modified the milestones: 0.22, 0.21 Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants