chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.38k stars 467 forks source link

"Print" and "Print to PDF" crash in debug build mode, failed in release build mode. #3772

Closed cmf41013 closed 1 month ago

cmf41013 commented 3 months ago

Describe the bug A clear and concise description of what the bug is. Print Preview crash in debug build cefclient.exe, and failed in release build cefclient.exe.

To Reproduce Steps to reproduce the behavior:

  1. build win32 version cefclient.exe with CEF_USE_SANDBOX macro define , startup the application, open any one web, click "Print" item in the top "Tests" menu.

  2. crash if cefclient.exe is build in debug mode, or show "Print preview failed" if it's build in release mode.

  3. build win32 version cefclient.exe with CEF_USE_SANDBOX macro define, startup the application, Click "Print to PDF" item in the top "Tests" menu.

  4. crash if cefclient.exe is build in debug mode, or save none file when it complete if it's build in release mode.

Expected behavior A clear and concise description of what you expected to happen and what happened instead.

Screenshots If applicable, add screenshots to help explain your problem. image

image click "print" crash in debug mode by visual studio debuging.

image click "Print to PDF" crash in debug mode by visual studio debuging.

Versions (please complete the following information):

Additional context if building cefclient.exe without CEF_USE_SANDBOX macro define, "Print" and "Print to PDF" can both execute well .

Does the problem reproduce with Google Chrome at the same version? no.

Add any other context about the problem here. would cef m126 version will fix the errors?

magreenblatt commented 3 months ago

maybe it appears in most of m127 and m128 versions, such as 127.3.5+g114ea2a+chromium-127.0.6533.120_windows32 and 128.4.5+gc1d356f+chromium-128.0.6613.18_windows32.

Did you test these versions?

cmf41013 commented 3 months ago
  • 126.2.18+g3647d39+chromium-126.0.6478.183 / Chromium 126.0.6478.183

I tested 126.2.18+g3647d39+chromium-126.0.6478.183 / Chromium 126.0.6478.183, 127.3.5+g114ea2a+chromium-127.0.6533.120_windows32, 128.4.5+gc1d356f+chromium-128.0.6613.18_windows32, and many others whose versions I have forgot .

cmf41013 commented 3 months ago

maybe it appears in most of m127 and m128 versions, such as 127.3.5+g114ea2a+chromium-127.0.6533.120_windows32 and 128.4.5+gc1d356f+chromium-128.0.6613.18_windows32.

Did you test these versions?

Yes. I tested 126.2.18+g3647d39+chromium-126.0.6478.183 / Chromium 126.0.6478.183, 127.3.5+g114ea2a+chromium-127.0.6533.120_windows32, 128.4.5+gc1d356f+chromium-128.0.6613.18_windows32, and many others whose versions I have forgot .

cmf41013 commented 2 months ago

@magreenblatt This bug still exists in the latest version 08/30/2024 - 128.4.5+gc1d356f+chromium-128.0.6613.18 / Chromium 128.0.6613.18, I have tested the cef_binary_128.4.5+gc1d356f+chromium-128.0.6613.18_windows32_client.tar.bz2.

magreenblatt commented 2 months ago

@cmf41013 Contributions are welcome. If you're in a hurry I suggest you debug the issue yourself.

magreenblatt commented 1 month ago

Print and Print to PDF work for me using cef_binary_128.4.12+g1d7a1f9+chromium-128.0.6613.138_windows64_client (both Chrome style and Alloy style). You need to add the --disable-features=PrintCompositorLPAC command-line flag (see issue #3725).

handerss-spotfire commented 1 month ago

Unfortunately disabling PrintCompositorLPAC does not fix offscreen printing to PDF which still hangs https://github.com/chromiumembedded/cef/issues/3768#issuecomment-2379700930.

cmf41013 commented 4 weeks ago

Print and Print to PDF work for me using cef_binary_128.4.12+g1d7a1f9+chromium-128.0.6613.138_windows64_client (both Chrome style and Alloy style). You need to add the --disable-features=PrintCompositorLPAC command-line flag (see issue #3725).

Thanks, It works