Bug 1222178

Summary: Kontact And KMail Not Responding On Plasma After 20240328 Snapshot
Product: [openSUSE] openSUSE Tumbleweed Reporter: Gerald Chen <gerald_chen>
Component: KDE ApplicationsAssignee: E-Mail List <opensuse-kde-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: kevsn91, rodney.baker
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Gerald Chen 2024-03-30 04:04:23 UTC
After I had updated to the 20240328 snapshot, Kontact and KMail would not respond when opened on my KDE Plasma system with a NVIDIA RTX 3060 Laptop GPU. The application windows could not be resized and would soon turn to pale white. The close button would not work, either. After a period of not responding, a termination confirmation would pop up.

KOrganizer and KAddressBook worked, though.

This issue did not happen on my other Plasma machine with a Intel iGPU.

This issue remains after I cleared KMail config files and cache.

Akonadi works fine, for I can still fetch new mails and get notifications.
Comment 1 Kevin Preßer 2024-03-31 10:15:55 UTC
I can also confirm this, using a NVIDIA RTX 4070 Laptop GPU.

Even on a fresh Tumbleweed install, KMail and Kontact freeze upon starting immediately. 

What I observed though is, that this is only happening for me inside a Wayland session. On X11, both programs are working fine.

Also: on the X11 Session I'm receiving an authorization request from Akonadi for kwallet, on Wayland, nothing happens.
Comment 2 Gerald Chen 2024-03-31 14:37:51 UTC
I should have mentioned that I'm indeed using wayland on both machines. I would suspect this issue to be Qt 6 and Nvidia related, for several Qt 6 packages got updated in 20240328 snapshot.
Comment 3 Rodney Baker 2024-04-06 03:11:32 UTC
Confirmed here also - running KMail under X11 works, as long as it has not been started under Wayland first. 

If I start KMail in a Plasma Wayland session, it hangs indefinitely. Logging out and then logging into a Plasma X11 session and starting KMail results in a segfault and crash. 

Running KMail from Konsole results in:

[13801:14241:0405/231901.115472:ERROR:vaapi_wrapper.cc(1319)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[13801:14241:0405/231901.115495:ERROR:vaapi_wrapper.cc(1267)] FillProfileInfo_Locked failed for va_profile VAProfileH264Main and entrypoint VAEntrypointVLD
[13801:14241:0405/231901.115504:ERROR:vaapi_wrapper.cc(1319)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[13801:14241:0405/231901.115510:ERROR:vaapi_wrapper.cc(1267)] FillProfileInfo_Locked failed for va_profile VAProfileH264High and entrypoint VAEntrypointVLD

Followed by a dialog stating, "The Email program has encountered a fatal error and will now close. The error was: Timeout trying to get lock."

Running vainfo under X11:

~ $ vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.20.0
libva error: vaGetDriverNames() failed with unknown libva error
libva info: User environment variable requested driver 'vdpau'
libva info: Trying to open /usr/lib64/dri/vdpau_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

Running vainfo under Wayland:

~ $ vainfo
Trying display: wayland
libva info: VA-API version 1.20.0
libva info: User environment variable requested driver 'vdpau'
libva info: Trying to open /usr/lib64/dri/vdpau_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva error: /usr/lib64/dri/vdpau_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Running KMail under Wayland as "kmail --platform xcb" gives: 

[13801:14241:0405/231901.115472:ERROR:vaapi_wrapper.cc(1319)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[13801:14241:0405/231901.115495:ERROR:vaapi_wrapper.cc(1267)] FillProfileInfo_Locked failed for va_profile VAProfileH264Main and entrypoint VAEntrypointVLD
[13801:14241:0405/231901.115504:ERROR:vaapi_wrapper.cc(1319)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[13801:14241:0405/231901.115510:ERROR:vaapi_wrapper.cc(1267)] FillProfileInfo_Locked failed for va_profile VAProfileH264High and entrypoint VAEntrypointVLD
src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000
Comment 4 Christophe Marin 2024-04-08 10:22:26 UTC
Can you try with `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu kmail` or `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu kontact`
Comment 5 Gerald Chen 2024-04-08 18:14:05 UTC
(In reply to Christophe Marin from comment #4)
> Can you try with `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu kmail` or
> `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu kontact`

Running `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu" kmail` indeed worked. KMail got responsive again.
Comment 6 Christophe Marin 2024-04-08 19:27:38 UTC
Ok, I guess that's https://bugreports.qt.io/browse/QTBUG-124174 then
Comment 7 Rodney Baker 2024-04-09 08:01:50 UTC
Running `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu" kmail` solves the non-responsive startup but does not resolve the "Timeout trying to get lock" issue noted in comment #3 below. I guess that's a different bug then? I do have a full gdb backtrace and valgrind log for that one - should I raise a separate issue here or report upstream?
Comment 8 Rodney Baker 2024-04-09 08:03:53 UTC
I should mention that I've had kmail work sometimes under Wayland with the parameter --platform xcb as long as KMail is the FIRST application started after the desktop session loads. If any other application has been loaded first, it crashes every time.
Comment 9 Gerald Chen 2024-04-10 17:06:32 UTC
Good news is that my problem got fixed in 20240409 snapshot, which brought Qt 6.7 update. Now KMail can be normally opened and used without `QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu"` variable.
Comment 10 Gerald Chen 2024-04-12 01:23:13 UTC
Does anyone in this discussion still got the problem? I would like to mark it as FIXED if not. It turned out to be solved by a Qt update.
Comment 11 Rodney Baker 2024-04-12 08:14:51 UTC
Works for me now too.