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

wslbridge (Ubuntu on Windows) The display compositor is frequently crashing. #5918

Open
mbretschn opened this issue Dec 9, 2019 · 15 comments
Labels
OS: windows prevent-stale mark an issue so it is ignored by stale[bot] stage: needs investigating Someone from Cypress needs to look at this topic: SIG errors Program error signals, ie SIGILL, SIGSEGV, SIGBUS, SIGABRT type: bug

Comments

@mbretschn
Copy link

Using cypress in a Ubuntu on Windows fails with an error:

It looks like this is your first time using Cypress: 3.7.0

 ✔  Verified Cypress! /home/johnsmith/.cache/Cypress/3.7.0/Cypress

Opening Cypress...
[23948:1209/141647.044586:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.
Unhandled rejection Error: The Test Runner unexpectedly exited via a close event with signal SIGILL

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.7.0
    at /mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/cypress/lib/errors.js:193:15
    at tryCatcher (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/mnt/c/Users/johnsmith/Desktop/Development/dermalog-document/node_modules/bluebird/js/release/promise.js:569:18)

Can someone help?

@parker-codes
Copy link

Running into the same issue.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jan 15, 2020

  • Could you run Cypress in debug mode mode and print the entire set of logs here?
  • How are you installing Cypress? Are you running in a docker container?
  • Are you running with a --browser flag or any other configuration?

There seems to be some indication that this may be solved by passing --disable-features=VizDisplayCompositor to Chrome (mentioned in this puppeteer issue puppeteer/puppeteer#3774 (comment))

Can you try setting this flag below in your plugins/index.js file and comment if this resolved the issue?

Edit: remove incorrect way to set Electron flag

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Jan 15, 2020
@parker-codes
Copy link

It still fails for me.

$ cypress run
[21091:0116/074706.628978:FATAL:gpu_data_manager_impl_private.cc(986)] The display compositor is frequently crashing. Goodbye.
The Test Runner unexpectedly exited via a exit event with signal SIGILL

I did run it on WSL2 on my personal machine and it worked (even without this plugin code), but my work machine is still on WSL1 until the required Windows update is out of beta.

@jennifer-shehane
Copy link
Member

Sorry, I did not document this correctly. This error is coming when launching through Electron, so the instructions for sending this app switch to Electron are here: https://on.cypress.io/browser-launch-api#Modify-Electron-app-switches

Can you set the following environment variable on your system, run cypress run again and comment on the result?

Windows

set ELECTRON_EXTRA_LAUNCH_ARGS=--disable-features=VizDisplayCompositor

Linux/OSX

export ELECTRON_EXTRA_LAUNCH_ARGS=--disable-features=VizDisplayCompositor

@richworx
Copy link

richworx commented Jan 28, 2020

I am having the same problem on WSL1 with cypress 3.8.2. I tried to use the environment variable workaround but it did not help.

I noticed that this issue is also documented at #5526 where they suggested potentially implementing a slightly different environment variable, so I tried several variants (listed below). None worked.

#Environment variables that don't work
export ELECTRON_EXTRA_LAUNCH_ARGS=--disable-features=VizDisplayCompositor
export EXTRA_ELECTRON_LAUNCH_ARGS=--disable-features=VizDisplayCompositor
export EXTRA_ELECTRON_ARGS=--disable-features=VizDisplayCompositor
export CYPRESS_ELECTRON_EXTRA_LAUNCH_ARGS=--disable-features=VizDisplayCompositor
export CYPRESS_EXTRA_ELECTRON_LAUNCH_ARGS=--disable-features=VizDisplayCompositor
export CYPRESS_EXTRA_ELECTRON_ARGS=--disable-features=VizDisplayCompositor

@jennifer-shehane are you sure that environment variable is actually used by cypress?

I will also mention that in the issue I linked above, another workaround was suggested that involves patching the file node_modules/cypress/lib/exec/spawn.js. Find the line that contains the text child = cp.spawn and add a line above it with the text electronArgs.push('--disable-features=VizDisplayCompositor');
When you finish, it should look like this (without the comments):

electronArgs.push('--disable-features=VizDisplayCompositor'); // add this line
var child = cp.spawn(executable, electronArgs, stdioOptions); // find this line

Several people mentioned this worked for them with older Cypress versions, but I have not been able to get it to work with Cypress 3.8.2.

EDIT:
I was able to avoid the "compositor" issue by changing the above to:

electronArgs.unshift('--disable-features=VizDisplayCompositor'); // add this line
var child = cp.spawn(executable, electronArgs, stdioOptions); // find this line

Apparently the switch has to be added at the beginning of the argument array because any switches at the end come after "--" which signals to electron that those are application switches, not electron switches. (This appears to be a recent addition, because older versions didn't have a problem with the first version of the code.)

Unfortunately cypress still crashed after I added the above patch, but this time it exited with a SIGSEGV soon after startup. It got to the point where it displays "Running: ". But there were no "compositor" issues at least.

@colingreene1
Copy link

I'm also experiencing the same issues listed by @richworx and tried everything suggested. I've defaulted back to not using WSL1 (can't update to WSL2 at the moment) for now just to get around the issue.

@danni-popova

This comment has been minimized.

@Hecsall
Copy link

Hecsall commented Mar 11, 2020

Recently I've been struggling with this issue with WSL 1, and I discovered a workaround.

Here the tests I tried (WSL 1, not 2):

  • npm install with WSL & cypress open with WSL --> ERROR
  • npm install with WSL & cypress open with cmd.exe --> ERROR
  • npm install with cmd.exe & cypress open with cmd.exe --> WORKING

So, if you run everything with the standard windows command prompt (cmd.exe), and not with WSL, everything works fine, but you will also have to run the npm install with the command prompt, because I think that running npm install with WSL downloads something that's specific for Linux and not for Windows.

Hope this helps someone!

@bpallares
Copy link

bpallares commented Mar 17, 2020

In addition to the above, I was able to run cypress from wsl by doing
> powershell.exe npx cypress open

@justinstander
Copy link

Still happens for me in Cypress 4.5.0, Win 10, WSL Ubuntu 16.04.

@justinmchase
Copy link

I was able to successfully install and run this on wsl and cypress latest, I ran cypress open and got:

Verifying Cypress can run /home/justin/.cache/Cypress/4.5.0/Cypress [started]

So that's good news, but of course nothing is popping up, how would it I guess. But I'm wondering if there is a way for cypress to just print out a port so I can run it in a browser instead of a custom tool?

@justinstander
Copy link

justinstander commented May 11, 2020 via email

@vince1995
Copy link

vince1995 commented Jun 10, 2020

In addition to the above, I was able to run cypress from wsl by doing
> powershell.exe npx cypress open

Not the way it should work but the easiest way it works. Thanks a lot! That should be written down in the troubleshooting as a workaround.


Edit: This solution works only on WSL1 well because it's only working inside the windows filesystem where WSL2 is extremely slow at the moment.

For WSL2 I've found this guide in an other issue: https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress

@pschlette
Copy link

Fwiw, while using WSL 1, I saw all the issues described by #5918 (comment) -- The display compositor is frequently crashing, then exiting with SIGSEGV after adding that Electron flag in spawn.js. Upgraded my distro to WSL 2 and Cypress works out of the box now.

@cypress-bot cypress-bot bot added stage: needs investigating Someone from Cypress needs to look at this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jul 7, 2020
@jennifer-shehane
Copy link
Member

Just wanted to make sure everyone was aware of this comment showing how to get setup with WSL. #444 (comment) I'm not sure if this is completely up to date.

@jennifer-shehane jennifer-shehane added the topic: SIG errors Program error signals, ie SIGILL, SIGSEGV, SIGBUS, SIGABRT label Nov 4, 2020
@nagash77 nagash77 added the prevent-stale mark an issue so it is ignored by stale[bot] label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: windows prevent-stale mark an issue so it is ignored by stale[bot] stage: needs investigating Someone from Cypress needs to look at this topic: SIG errors Program error signals, ie SIGILL, SIGSEGV, SIGBUS, SIGABRT type: bug
Projects
None yet
Development

No branches or pull requests