puppeteer-sharp icon indicating copy to clipboard operation
puppeteer-sharp copied to clipboard

New headless chrome crashes when passing "--single-process"

Open danielgindi opened this issue 1 year ago • 4 comments

Description

When passing --single-process - the headless chrome crashes. It worked before the new headless version.

Complete minimal example reproducing the issue

Complete means the code snippet can be copied into a unit test method in a fresh C# project and run. Minimal means it is stripped from code not related to reproducing the issue.

E.g.


                                  var browser= await PuppeteerSharp.Puppeteer.LaunchAsync(new PuppeteerSharp.LaunchOptions
                                  {
                                      Args = new string[] {
                                          "--single-process", // Less processes -- Currently crashes chrome
                                      },
                                      Headless = true,
                                  });

.

Expected behavior:

chrome.exe should prevail.

Actual behavior:

chrome.exe crashes.

Versions

15.0.0, 15.1.0 .NET 7.0

Additional Information

When calling the new chrome.exe from cmd line with --single-process - it also crashes.

danielgindi avatar Mar 21 '24 09:03 danielgindi

I think that --single-process was more a chromium flag than a chrome one. You could try using HeadlessMode = HeadlessMode.Shell to use the legacy browser or use the SupportedBrowser.Chromium instead of Chrome.

kblok avatar Mar 21 '24 11:03 kblok

Oh so we have moved from Chromium to Chrome? I did not even notice. Will the new headless mode work with chromium too?

danielgindi avatar Mar 25 '24 07:03 danielgindi

Oh so we have moved from Chromium to Chrome? I did not even notice. Will the new headless mode work with chromium too?

Yes! Since v11. The new headless mode is prior to Chrome for testing in puppeteer. So I bet it works in chromium. That flag god renamed a few times, so that's why I'm not 100% sure.

kblok avatar Mar 25 '24 11:03 kblok

Since moving to Chrome I've experienced some instabilities. Occasionally a 100% cpu usage, and infinite logging of GPU errors. I had to pin the build number to stabilize it. Looks like Chromium is far more stable.

danielgindi avatar Aug 08 '24 05:08 danielgindi