servo/servo

Servo on Windows in VirtualBox gets 'NoAvailablePixelFormat'

larsbergstrom opened this issue · 18 comments

When run within a default VirtualBox installation of Windows, Servo run from Mach errors with "Error 127". When run as target/debug/servo.exe tests/html/about-mozilla.html, you get:

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', ../src/libcore\result.rs:688

@Jayflux, Can you please provide a stack backtrace, acquired by doing RUST_BACKTRACE=1 target/debug/servo.exe tests/html/about-mozilla.html?

Guest Machine

$ RUST_BACKTRACE=1 target/debug/servo.exe tests/html/about-mozilla.html
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', ../src/libcore\result.rs:688
stack backtrace:
   0:          0x36db40b - <unknown>
   1:          0x36e3917 - <unknown>
   2:          0x36a4d68 - <unknown>
   3:          0x36a564b - <unknown>
   4:          0x36d7b42 - <unknown>
   5:          0x36f6cc8 - <unknown>
   6:           0x546dd4 - <unknown>
   7:           0x541b3c - <unknown>
   8:           0x54112f - <unknown>
   9:           0x44a403 - <unknown>
  10:          0x36e3018 - <unknown>
  11:          0x36ce39f - <unknown>
  12:          0x36e2f1d - <unknown>
  13:           0x54057a - <unknown>
  14:           0x4013b4 - <unknown>
  15:           0x4014e7 - <unknown>
  16:     0x7ffe7c682d91 - <unknown>

Host Machine

$ RUST_BACKTRACE=1 target/debug/servo.exe tests/html/about-mozilla.html
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../sr                                                                 c/libcore\option.rs:330
stack backtrace:
   0:          0x36db3eb - <unknown>
   1:          0x36e38f7 - <unknown>
   2:          0x36a4d48 - <unknown>
   3:          0x36a562b - <unknown>
   4:          0x36d7b22 - <unknown>
   5:          0x36f6ca8 - <unknown>
   6:          0x36f7350 - <unknown>
   7:           0x5476d5 - <unknown>
   8:           0x59b04f - <unknown>
   9:           0x5a13c5 - <unknown>
  10:           0x44a75a - <unknown>
  11:          0x36e2ff8 - <unknown>
  12:          0x36ce37f - <unknown>
  13:          0x36e2efd - <unknown>
  14:           0x54057a - <unknown>
  15:           0x4013b4 - <unknown>
  16:           0x4014e7 - <unknown>
  17:     0x7ffbf6e92d91 - <unknown>

@larsbergstrom
https://pastebin.mozilla.org/8858274
is that correct, it just hangs and does nothing, do i need to pass in the html file too?

@Jayflux That's correct! you would need to do "run tests/html/about-mozilla.html" to start it, and hopefully would get a good backtrace.

Otherwise, you can do info line *0x36e38f7 to get the function names for those addresses.

Could you please paste:

info line *0x36db40b
info line *0x36e3917
info line *0x36a4d68
info line *0x36a564b
info line *0x36d7b42
info line *0x36f6cc8
info line *0x546dd4
info line *0x541b3c
info line *0x54112f
info line *0x44a403
info line *0x36e3018
info line *0x36ce39f
info line *0x36e2f1d
info line *0x54057a
info line *0x4013b4
info line *0x4014e7
info line *0x7ffe7c682d91

And then:

info line *0x36db3eb
info line *0x36e38f7
info line *0x36a4d48
info line *0x36a562b
info line *0x36d7b22
info line *0x36f6ca8
info line *0x36f7350
info line *0x5476d5
info line *0x59b04f
info line *0x5a13c5
info line *0x44a75a
info line *0x36e2ff8
info line *0x36ce37f
info line *0x36e2efd
info line *0x54057a
info line *0x4013b4
info line *0x4014e7
info line *0x7ffbf6e92d91

into that gdb prompt and paste the results in a comment here?

IEUser@IE11WIN10 MINGW64 ~/servo
$ ./mach run --debug
Reading symbols from C:/msys64/home/IEUser/servo/target/debug/servo...done.
(gdb) info line *0x36db40b
info line *0x36e3917
info line *0x36a4d68
info line *0x36a564b
info line *0x36d7b42
info line *0x36f6cc8
info line *0x546dd4
info line *0x541b3c
info line *0x54112f
info line *0x44a403
info line *0x36e3018
info line *0x36ce39f
info line *0x36e2f1d
info line *0x54057a
info line *0x4013b4
info line *0x4014e7
info line *0x7ffe7c682d91No line number information available for address
  0x36db40b <_ZN3sys9backtrace5write20hbd1f54716e594c89rguE+1355>
(gdb) No line number information available for address
  0x36e3917 <_ZN9panicking15default_handler20h80d31aa6db5f2c759RyE+1319>
(gdb) No line number information available for address
  0x36a4d68 <_ZN10sys_common6unwind18begin_unwind_inner20hd7742231a7d4ae0fO3sE+48>
(gdb) No line number information available for address
  0x36a564b <_ZN10sys_common6unwind16begin_unwind_fmt20hbb1200a0e47e6bf5U2sE+18>
(gdb) No line number information available for address
  0x36d7b42 <rust_begin_unwind+66>
(gdb) No line number information available for address
  0x36f6cc8 <_ZN9panicking9panic_fmt20h354aa8e6a3bf9b9fLnKE+56>
(gdb) Line 29 of "../src/libcore/macros.rs"
   starts at address 0x546da7 <glutin_app::result::Result<T, E>::unwrap+439>
   and ends at 0x546de0 <glutin_app::result::Result<T, E>::unwrap+496>.
(gdb) Line 103 of "C:\msys64\home\IEUser\servo\ports\glutin/window.rs"
   starts at address 0x541b18 <glutin_app::window::Window::new+968>
   and ends at 0x541b3f <glutin_app::window::Window::new+1007>.
(gdb) Line 46 of "C:\msys64\home\IEUser\servo\ports\glutin/lib.rs"
   starts at address 0x5410dd <glutin_app::create_window+141>
   and ends at 0x541134 <glutin_app::create_window+228>.
(gdb) Line 82 of "main.rs" starts at address 0x44a3f4 <servo::main+1108>
   and ends at 0x44a41c <servo::main+1148>.
(gdb) No line number information available for address
  0x36e3018 <_ZN10sys_common6unwind3try6try_fn21h10839179988703125308E+24>
(gdb) No line number information available for address
  0x36ce39f <_ZN10sys_common6unwind3try9inner_try20hfe2f4b1ffded5692m0sE+95>
(gdb) No line number information available for address
  0x36e2f1d <_ZN2rt10lang_start20haaeb2b77f0ace4f3DKyE+285>
(gdb) Line 131 of "main.rs"
   starts at address 0x540540 <servo::maybe_unregister_glutin_resize_handler+16>
   and ends at 0x540590 <servo::BrowserWrapper.app::NestedEventLoopListener::hadle_event_from_nested_event_loop>.
(gdb) No line number information available for address
  0x4013b4 <__tmainCRTStartup+564>
(gdb) No line number information available for address 0x4014e7 <mainCRTStartup23>
(gdb)

and

ser@IE11WIN10 MINGW64 ~/servo
$ ./mach run --debug
Reading symbols from C:/msys64/home/IEUser/servo/target/debug/servo...done.
(gdb) info line *0x36db3eb
info line *0x36e38f7
info line *0x36a4d48
info line *0x36a562b
info line *0x36d7b22
info line *0x36f6ca8
info line *0x36f7350
info line *0x5476d5
info line *0x59b04f
info line *0x5a13c5
info line *0x44a75a
info line *0x36e2ff8
info line *0x36ce37f
info line *0x36e2efd
info line *0x54057a
info line *0x4013b4
info line *0x4014e7
info line *0x7ffbf6e92d91No line number information available for address
  0x36db3eb <_ZN3sys9backtrace5write20hbd1f54716e594c89rguE+1323>
(gdb) No line number information available for address
  0x36e38f7 <_ZN9panicking15default_handler20h80d31aa6db5f2c759RyE+1287>
(gdb) No line number information available for address
  0x36a4d48 <_ZN10sys_common6unwind18begin_unwind_inner20hd7742231a7d4ae0fO3sE+616>
(gdb) No line number information available for address
  0x36a562b <_ZN10sys_common6unwind16begin_unwind_fmt20hbb1200a0e47e6bf5U2sE+155>
(gdb) No line number information available for address
  0x36d7b22 <rust_begin_unwind+34>
(gdb) No line number information available for address
  0x36f6ca8 <_ZN9panicking9panic_fmt20h354aa8e6a3bf9b9fLnKE+24>
(gdb) No line number information available for address
  0x36f7350 <_ZN9panicking5panic20ha5356f3752db3392imKE+64>
(gdb) Line 21 of "../src/libcore/macros.rs"
   starts at address 0x5476ca <glutin_app::option::Option<T>::unwrap+186>
   and ends at 0x547709 <glutin_app::option::Option<T>::unwrap+249>.
(gdb) Line 290 of "C:\msys64\home\IEUser\servo\ports\glutin/window.rs"
   starts at address 0x59b013 <glutin_app::window::Window::handle_next_event+51> and ends at 0x59b050 <glutin_app::window::Window::handle_next_event+112>.
(gdb) Line 352 of "C:\msys64\home\IEUser\servo\ports\glutin/window.rs"
   starts at address 0x5a13ba <glutin_app::window::Window::wait_events+794>
   and ends at 0x5a13e4 <glutin_app::window::Window::wait_events+836>.
(gdb) Line 100 of "main.rs" starts at address 0x44a747 <servo::main+1959>
   and ends at 0x44a77a <servo::main+2010>.
(gdb) No line number information available for address
  0x36e2ff8 <_ZN2rt10lang_start20haaeb2b77f0ace4f3DKyE+504>
(gdb) No line number information available for address
  0x36ce37f <_ZN10sys_common6unwind3try9inner_try20hfe2f4b1ffded5692m0sE+63>
(gdb) No line number information available for address
  0x36e2efd <_ZN2rt10lang_start20haaeb2b77f0ace4f3DKyE+253>
(gdb) Line 131 of "main.rs"
   starts at address 0x540540 <servo::maybe_unregister_glutin_resize_handler+160>
   and ends at 0x540590 <servo::BrowserWrapper.app::NestedEventLoopListener::handle_event_from_nested_event_loop>.
(gdb) No line number information available for address
  0x4013b4 <__tmainCRTStartup+564>
(gdb) No line number information available for address 0x4014e7 <mainCRTStartup+23>
(gdb) 

There you go @larsbergstrom

Oh, wow, thanks! That helps a ton. The first failure is here:
https://github.com/servo/servo/blob/master/ports/glutin/window.rs#L103

I suspect that is tied to the inability to correctly load up a Window within a VM host. We probably need to fiddle with our framebuffer selection to work there.

And the second one is:
https://github.com/servo/servo/blob/master/ports/glutin/window.rs#L290

This second one I believe that @vvuk and I saw earlier (failure to find a next event in handle_next_event), and was tied to how the event loop is integrated. Though I don't know why that one would happen sometimes on your host machine but not others. You mentioned you did get about-mozilla.html to load on this machine in IRC, right? Or was that on a different machine?

vvuk commented

If we need to use software rendering we can probably build Mesa.
Alternatively, if d3d9 (or 11) is available, we can use ANGLE.

  • Vlad

@larsbergstrom @vvuk
On my host machine
RUST_BACKTRACE=1 target/debug/servo.exe tests/html/about-mozilla.html
works, loads up the window and shows the book of mozilla.
However, when i run via ./mach i get

Jason@DESKTOP-P2J3G0V MINGW64 ~/servo
$ ./mach run tests/html/about-mozilla.html
Servo exited with return value 127

When running without the rust backtrace Env i get....

$ target/debug/servo.exe tests/html/about-mozilla.html
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:330

This is a bit hard to debug without a backtrace, whats the difference between the 2?

jdm commented

./mach modifies the PATH which could affect the libraries that get loaded. See ./mach env for the differences in the environment.

Hrm, I seem to remember something about rustc packaging a bunch of mingw libraries and ./mach env putting those first in the path. I bet that we're picking up random rustc versions instead of the ones that we linked again. Maybe we should do like rust and copy them all next to the servo binary? That would also make it much easier to run Servo outside of a very carefully-constructed mingw environment.

Anything i can do to help? You want me to paste my ./mach env output?

Ok
to stop this ticket going off track, ive moved the Host Windows machine issues to a separate ticket: #9541
so we can keep the conversation here on whats going on with the VM

Same error occurs when attempting to run servo through RDP (from a mac anyways)

$ RUST_BACKTRACE=1 target/release/servo.exe tests/html/about-mozilla.html
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', ../src/libcore\result.rs:746
stack backtrace:
   0:          0x1f63f8c - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.43855
   1:          0x1f6366e - panicking::default_handler::h99f8a2df60b11279YxA
   2:          0x1f243ef - sys_common::unwind::begin_unwind_inner::haf54b05ed001a1a9Ymu
   3:          0x1f24c4b - sys_common::unwind::begin_unwind_fmt::h1f85b6f498a941164lu
   4:          0x1f58f32 - rust_begin_unwind
   5:          0x1f78498 - panicking::panic_fmt::ha1957470eb97b74c7mM
   6:           0xf0ad80 - result::unwrap_failed::h11459173461501751416
   7:           0xf07e79 - window::Window::new::h67128086a7819a81Cxa
   8:           0xf06c36 - create_window::h576e7710d67e391bhab
   9:           0x408c23 - main::hb2ad826330afabd3Naa
  10:          0x1f62d5d - sys_common::unwind::try::h3366783488237370535
  11:          0x1f62c25 - rt::lang_start::h5a3b4872083ac3e44pA
  12:           0x4013b4 - _tmainCRTStartup
  13:           0x4014e7 - mainCRTStartup
  14:     0x7ff91fa48101 - GLOBAL__sub_I__ZN15GrGLConicEffectC2ERK22GrBackendEffectFactoryRK12GrDrawEffect
vvuk commented

A VM host (or RDP) is unlikely to provide OpenGL, or the necessary level of OpenGL under Windows. You can confirm this by downloading something like OpenGL Extensions Viewer from http://www.realtech-vr.com/glview/ and looking at what info it gives for OpenGL renderers.

If the VM provides D3D9+ support, we can build ANGLE and have it provide EGL/GLESv2. If we need pure software rendering, depending on the Windows version, ANGLE + WARP might still work, or we can possibly build a software-only Mesa impl and use its DLL.

@vvuk I should note that I worked in a VM because Servo didn't work on Windows.
Now that it does work on the Windows Platform, having it work within a VM is no longer as much a priority for me personally.

Jason

Just FWIW, I just hit this issue too. I wanted to poke around the layout capabilities of servo for html tables, and decided to create a VM to install servo dependencies without compromising my environment. Since it is now working on Windows too, I decided to go with that for the sake of trying it out. That didn't work out as expected due to this error though :-)

I should note I was using Windows 10 Anniversary Update (previews) as both host and guest here, inside Hyper-V Virtual Machines.

vvuk commented

HyperV should provide DX support, which means we should be able to use EGL and ANGLE. But it would take a bit of plumbing hacking to make it work, though it would be very interesting to have it working.

Got a problem.

C:\Users\tigercosmos\Desktop\servo>mach run tests/html/about-mozilla.html
Failed to create window.: NoAvailablePixelFormat (thread main, at src\libcore\result.rs:860)
stack backtrace:
   0:     0x7ff7a3e2ee70 - backtrace::backtrace::trace<closure>
                        at C:\Users\tigercosmos\Desktop\servo\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.2\src\backtrace\mod.rs:41
   1:     0x7ff7a3e28ea4 - backtrace::capture::Backtrace::new
                        at C:\Users\tigercosmos\Desktop\servo\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.2\src\capture.rs:64
   2:     0x7ff79f091168 - servo::main::{{closure}}
                        at C:\Users\tigercosmos\Desktop\servo\ports\servo\main.rs:130
   3:     0x7ff7a564d5d4 - std::panicking::rust_panic_with_hook
                        at C:\projects\rust\src\libstd\panicking.rs:611
   4:     0x7ff7a564d449 - std::panicking::begin_panic<alloc::string::String>
                        at C:\projects\rust\src\libstd\panicking.rs:571
   5:     0x7ff7a564d322 - std::panicking::begin_panic_fmt
                        at C:\projects\rust\src\libstd\panicking.rs:521
   6:     0x7ff7a564d290 - std::panicking::rust_begin_panic
                        at C:\projects\rust\src\libstd\panicking.rs:497
   7:     0x7ff7a565737f - core::panicking::panic_fmt
                        at C:\projects\rust\src\libcore\panicking.rs:71
   8:     0x7ff79f11a7a8 - core::result::unwrap_failed<glutin::CreationError>
                        at C:\projects\rust\src\libcore\macros.rs:41
   9:     0x7ff79f10f859 - core::result::Result<glutin::Window, glutin::CreationError>::expect<glutin::Window,glutin::CreationError>
                        at C:\projects\rust\src\libcore\result.rs:762
  10:     0x7ff79f134896 - glutin_app::window::Window::new
                        at C:\Users\tigercosmos\Desktop\servo\ports\glutin\window.rs:271
  11:     0x7ff79f1863d3 - glutin_app::create_window
                        at C:\Users\tigercosmos\Desktop\servo\ports\glutin\lib.rs:50
  12:     0x7ff79f08fbbc - servo::main
                        at C:\Users\tigercosmos\Desktop\servo\ports\servo\main.rs:147
  13:     0x7ff7a564ead2 - panic_unwind::__rust_maybe_catch_panic
                        at C:\projects\rust\src\libpanic_unwind\lib.rs:98
  14:     0x7ff7a564dd52 - std::rt::lang_start
                        at C:\projects\rust\src\libstd\rt.rs:54
  15:     0x7ff79f091b3c - main
  16:     0x7ff7a5f53109 - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
  17:     0x7ffe7c1b8364 - BaseThreadInitThunk
Servo exited with return value 101