servo icon indicating copy to clipboard operation
servo copied to clipboard

Empty window on GNOME with Wayland

Open nawordar opened this issue 1 year ago • 13 comments

After compiling Servo with ./mach build --dev -p servo and running it with ./mach run --dev tests/html/about-mozilla.html, an empty window shows up with weird glitches inside. Interestingly, when I took a screenshot, it generated transparent pixels there. A transparent Servo window with only titlebar rendering properly

Servo does not display anything in the console.

I run Arch Linux with GNOME 43.2 on Wayland. I am using NVIDIA GeForce GTX 1660 SUPER with a proprietary driver.

nawordar avatar Mar 04 '23 18:03 nawordar

Hi @nawordar

I'm running Wayland as well and I'm not able to reproduce this on my system. I am however using KDE and Intel UHD.

Since this issue might be specific to your configuration, it will be great if you can test the following and share your findings if possible.

  1. Does forcing the use of X11 fix the issue? You can do export WINIT_UNIX_BACKEND=x11 before running servo to force the use of XWayland.
  2. Do you have access to KDE or other Wayland compositors like sway that you can test with to eliminate issues with GNOME?
  3. Are there any errors in the debug level logs - i.e RUST_LOG=debug ./mach run --dev tests/html/about-mozilla.html

mukilan avatar Mar 06 '23 12:03 mukilan

In case it is of any help, I tested using Arch Linux, GNOME 43.3 on Wayland and I actually have the same graphics card NVIDIA GeForce GTX 1660 SUPER with a proprietary driver.

I got a web page rendering in a window using the same build and run command.

Skärmbild från 2023-03-25 02-16-53

tirithen avatar Mar 25 '23 01:03 tirithen

@mukilan I didn't have access to this computer for a while, so I couldn't respond sooner.

Does forcing the use of X11 fix the issue? You can do export WINIT_UNIX_BACKEND=x11 before running servo to force the use of XWayland.

Yes, although it produces warning libEGL warning: egl: failed to create dri2 screen

Do you have access to KDE or other Wayland compositors like sway that you can test with to eliminate issues with GNOME?

Not yet, will update on that later

Are there any errors in the debug level logs - i.e RUST_LOG=debug ./mach run --dev tests/html/about-mozilla.html

No errors. I only get these warnings on both Wayland and X11:

[2023-04-06T19:05:38Z WARN  constellation::constellation] Visibility change for closed browsing context PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }.
[2023-04-06T19:05:40Z WARN  script::timers] Resuming an already resumed timer.

@tirithen Can you verify Servo doesn't open in XWayland? My favorite method is checking if xeyes works on that window.

nawordar avatar Apr 06 '23 19:04 nawordar

I'm experiencing the same problem when runs WINIT_UNIX_BACKEND=wayland ./mach run .. . I confirmed it both happens on KDE Wayland and Gnome Wayland. Servo runs OK with environment variable WINIT_UNIX_BACKEND=x11.

VitalyAnkh avatar May 07 '23 16:05 VitalyAnkh

@nawordar Thanks for sharing your findings!

@VitalyAnkh If possible could you also please share the debug level logs - i.e RUST_LOG=debug ./mach run --dev tests/html/about-mozilla.html and your graphics setup (graphic card, driver information etc).

mukilan avatar May 10 '23 14:05 mukilan

@mukilan Hi! I run servo with Nvidia 3060 Mobile, open kernel modules driver Nvidia driver 530.41.03, Arch Linux, kernel 6.3, Gnome 44 with Wayland. The output of running RUST_BACKTRACE=1 RUST_LOG=debug WINIT_UNIX_BACKEND=wayland ./mach run -d -- tests/html/about-mozilla.html is here: https://gist.github.com/VitalyAnkh/8ba9d49e0ef23c06b1afca2e6e71dd79. The log shows servo panicks other than showing an empty window. The last line "Servo was terminated by signal 2" is because of my pressing of "Ctrl-C".

The servo tested is compiled with the latest commit: https://github.com/servo/servo/commit/818ee77d9da95210e35034a85541b8c8e67d581e.

VitalyAnkh avatar May 11 '23 07:05 VitalyAnkh

renderer::deinit not called (thread main, at /home/vitalyr/.cargo/git/checkouts/webrender-479e138e1c1b9e8b/415b9ba/webrender/src/device/gl.rs:559)

   0: servo::backtrace::print
             at /home/vitalyr/projects/dev/rust-projects/servo/ports/winit/backtrace.rs:17:5
   1: servo::main::{{closure}}
             at /home/vitalyr/projects/dev/rust-projects/servo/ports/winit/main2.rs:133:21
   2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/alloc/src/boxed.rs:2002:9
      std::panicking::rust_panic_with_hook
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:692:13
   3: std::panicking::begin_panic::{{closure}}
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:608:9
   4: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/sys_common/backtrace.rs:137:18
   5: std::panicking::begin_panic
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:607:12
   6: <webrender::device::gl::Program as core::ops::drop::Drop>::drop
             at /home/vitalyr/.cargo/git/checkouts/webrender-479e138e1c1b9e8b/415b9ba/webrender/src/device/gl.rs:559:9
   7: core::ptr::drop_in_place<webrender::device::gl::Program>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
   8: core::ptr::drop_in_place<core::option::Option<webrender::device::gl::Program>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
   9: core::ptr::drop_in_place<webrender::shade::LazilyCompiledShader>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  10: core::ptr::drop_in_place<webrender::shade::BrushShader>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  11: core::ptr::drop_in_place<webrender::shade::Shaders>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  12: core::ptr::drop_in_place<core::cell::UnsafeCell<webrender::shade::Shaders>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  13: core::ptr::drop_in_place<core::cell::RefCell<webrender::shade::Shaders>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  14: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/alloc/src/rc.rs:1593:17
  15: core::ptr::drop_in_place<alloc::rc::Rc<core::cell::RefCell<webrender::shade::Shaders>>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  16: core::ptr::drop_in_place<webrender::renderer::Renderer>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  17: core::ptr::drop_in_place<compositing::compositor::IOCompositor<dyn servo::window_trait::WindowPortsMethods>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  18: core::ptr::drop_in_place<servo::Servo<dyn servo::window_trait::WindowPortsMethods>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  19: core::ptr::drop_in_place<core::option::Option<servo::Servo<dyn servo::window_trait::WindowPortsMethods>>>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  20: core::ptr::drop_in_place<servo::app::App>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  21: core::ptr::drop_in_place<servo::app::App::run::{{closure}}>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  22: core::ptr::drop_in_place<servo::events_loop::EventsLoop::run_forever<servo::app::App::run::{{closure}}>::{{closure}}>
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ptr/mod.rs:490:1
  23: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
             at /home/vitalyr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.3/src/platform_impl/linux/wayland/event_loop/mod.rs:569:5
  24: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run
             at /home/vitalyr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.3/src/platform_impl/linux/wayland/event_loop/mod.rs:223:25
  25: winit::platform_impl::platform::EventLoop<T>::run
             at /home/vitalyr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.3/src/platform_impl/linux/mod.rs:792:56
  26: winit::event_loop::EventLoop<T>::run
             at /home/vitalyr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.3/src/event_loop.rs:305:9
  27: servo::events_loop::EventsLoop::run_forever
             at /home/vitalyr/projects/dev/rust-projects/servo/ports/winit/events_loop.rs:93:17
  28: servo::app::App::run
             at /home/vitalyr/projects/dev/rust-projects/servo/ports/winit/app.rs:66:9
  29: servo::main
             at /home/vitalyr/projects/dev/rust-projects/servo/ports/winit/main2.rs:161:5
  30: core::ops::function::FnOnce::call_once
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ops/function.rs:250:5
  31: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/sys_common/backtrace.rs:121:18
  32: std::rt::lang_start::{{closure}}
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/rt.rs:166:18
  33: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/core/src/ops/function.rs:287:13
      std::panicking::try::do_call
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/rt.rs:148:20
  34: std::rt::lang_start
             at /rustc/dc1d9d50fba2f6a1ccab8748a0050cde38253f60/library/std/src/rt.rs:165:17
  35: main
  36: <unknown>
  37: __libc_start_main
  38: _start

jdm avatar May 13 '23 14:05 jdm

Maybe a version bump for webrender will solve this? https://github.com/servo/servo/pull/28605

The webrender used in servo seems very old.

VitalyAnkh avatar May 15 '23 07:05 VitalyAnkh

Update: It also happens on Hyprland, so the issue is not related to GNOME

nawordar avatar May 18 '23 17:05 nawordar

Do the latest builds of Servo have this same issue?

mrobinson avatar Jan 08 '24 09:01 mrobinson

I haven't tried compiling Servo since then and I cannot get Servo to build now because of #30587. I even tried building with Nix, but I got hundreds of undefined references when compiling servoshell.

nawordar avatar Jan 16 '24 19:01 nawordar

@nawordar, could you please open an issue about the Nix build errors?

@VitalyAnkh’s error looks like the same kind as in #30826:

wl_surface@30: error 2: Buffer size (10x727) must be an integer multiple of the buffer_scale (2).

For anyone else still having problems, can you check if the problems still occur with --no-minibrowser? When the minibrowser is enabled, we now use offscreen rendering (#30767), which is more complex.

delan avatar Jan 17 '24 03:01 delan

I have the same problem on Hyprland on Arch Linux. I suspect it may be about the Nvidia GPU, we can't use anything that is made for X originally with hardware accelaration these days, like electron apps, chrome based browsers they all flicker like wildfire. Wayland and Nvidia relationship is very problematic at the moment. Firefox runs fine but for the rest I'm waiting for the Nvidia 555 drivers.

I wonder if anyone on hyprland experience this issue with an AMD GPU.

First I tried the prebuilt nightly from the servo page outside github, just an hour ago. It didn't work then I built both release and dev versions after tackling the infamous error with the crown -vV (deleting rust, rustup, installing rustup from pacman and running ./mach bootstrap ...)

Alas, I only have a blank screen.

export WINIT_UNIX_BACKEND=x11 - Not working for me.

env WAYLAND_DISPLAY="" works but many things don't work and throws the egl failed to create dri2 screen error. Some sites render for the while I scroll or resize or interact, then it shows as if a CRT TV with Antenna with bad weather outside.

image

animanna avatar May 31 '24 16:05 animanna