Bug 158739 - Crash (assert): Inserting Formula and hovering over insert text leads to assert in Skia/Vulkan graphics (Win11)
Summary: Crash (assert): Inserting Formula and hovering over insert text leads to asse...
Status: RESOLVED DUPLICATE of bug 158942
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:24.2.0.0.beta2 t...
Keywords:
Depends on:
Blocks: Skia
  Show dependency treegraph
 
Reported: 2023-12-17 02:10 UTC by Matt K
Modified: 2024-01-02 14:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt K 2023-12-17 02:10:13 UTC
Description:
Inserting Formula and hovering over insert text in Writer leads to assert in Skia/Vulkan graphics on a debug-util build.

Steps to Reproduce:
1.Open Writer and go to Insert->Field->More Fields...->(Variables tab)
2.Select "Insert Formula" under type
3.Double click "Additional formats..." under Format, then click OK in the new pop-up
4. Select "General" under Format
5. Click Insert, then click close
6. Move mouse to hover over the "0" that was inserted

Actual Results:
An assert triggers at SkiaSalGraphicsImpl::flushSurfaceToWindowContext at the line for "assert(isGPU());".  Call stack is:

	vcllo.dll!SkiaSalGraphicsImpl::flushSurfaceToWindowContext() Line 418	C++
 	vcllo.dll!SkiaSalGraphicsImpl::performFlush() Line 405	C++
 	vclplug_winlo.dll!WinSkiaSalGraphicsImpl::Flush() Line 75	C++
 	vclplug_winlo.dll!WinSalGraphics::Flush() Line 805	C++
 	vclplug_winlo.dll!WinSalFrame::Flush() Line 2215	C++
 	vcllo.dll!SalFrame::Flush(const tools::Rectangle & __formal) Line 105	C++
 	vcllo.dll!vcl::WindowOutputDevice::Flush() Line 2968	C++
 	vcllo.dll!vcl::Window::PaintImmediately() Line 1348	C++
 	vcllo.dll!vcl::Window::PaintImmediately() Line 1276	C++
 	vcllo.dll!HelpTextWindow::ImplShow() Line 375	C++


Expected Results:
No assert fires


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c498e2acd64688df9aa32bbcc820d8513a5373ea
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Does not occur if I change Skia to raster.
Comment 1 Telesto 2023-12-17 02:21:15 UTC
No crash with Skia/Vulkan
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5ff701226b00963312cb2a78e77966d012b79c82
CPU threads: 8; OS: macOS 13.4.1; UI render: Skia/Metal; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 2 Matt K 2023-12-17 02:24:44 UTC
(In reply to Telesto from comment #1)
> No crash with Skia/Vulkan
>
> CPU threads: 8; OS: macOS 13.4.1; UI render: Skia/Metal; VCL: osx

Is Skia/Metal the same or different from Skia/Vulkan?
Comment 3 V Stuart Foote 2023-12-17 05:32:19 UTC
can't reproduce with STR in comment 0 with Win10 and Skia/Vulkan rendering.

OP is on a Win11 os/DE

Since it does not occur for OP with Skia / raster software rendering likely a Vulkan library issue

Please enable Skia / Vulkan and post the skia.log (from the Tools -> Options -> View panel).

Skia/Metal is GPU accelerated vector graphics as implemented on Apple macOS, Skia/Vulkan is technically cross platform but in LibreOffice the Linux builds have it suppressed so it doesn't get enough testing. Likewise testing for Win11 as few devs/QA folks run Win11 natively or as VM.

Best advice is to use Skia/Raster (software rendering).

=-testing-=
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 297a6673175308168669870882c016b496652a76
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

RenderMethod: vulkan
Vendor: 0x8086
Device: 0x8a52
API: 1.2.151
Driver: 0.402.661
DeviceType: integrated
DeviceName: Intel(R) Iris(R) Plus Graphics
Denylisted: no
Comment 4 Telesto 2023-12-17 09:16:04 UTC
(In reply to Matt K from comment #2)
> Is Skia/Metal the same or different from Skia/Vulkan?

Skia Metal is the macOS implementation of GPU acceleration. I have no clue about the exact amount of shared code with Skia/Vulkan, but I assume it to be similar
Comment 5 Telesto 2023-12-17 09:22:45 UTC
(In reply to Matt K from comment #0)
Oops. I forgot, you're using a (home) build version with debug enabled. Comment 1 is off irrelevance in that case. It wont hit an assert

Stuart, did you use a debug enabled build?
Comment 6 V Stuart Foote 2023-12-17 13:30:43 UTC
(In reply to Telesto from comment #5)
> 
> Stuart, did you use a debug enabled build?

Oh, right. No I didn't just the TB77 nightly, so the assert *could* be intentional. Maybe Julien has a Windows build handy on a Vulkan enabled Win10 or Win11 system.

But still kind of suspect it is going to be a Win11 issue with the Vulkan implementation.

For OP, still need your skia.log with Vulkan enabled for LO.
Comment 7 Matt K 2023-12-17 16:12:55 UTC
Here is my skia.log:

RenderMethod: vulkan
Vendor: 0x10de
Device: 0x28e1
API: 1.3.260
Driver: 546.132.0
DeviceType: discrete
DeviceName: NVIDIA GeForce RTX 4050 Laptop GPU
Denylisted: no
Comment 8 V Stuart Foote 2023-12-17 17:06:14 UTC
Hmm, why on this Win11 laptop system is the isGPU() failing? Given the system reports it is using Vulkan. 

We've seen issues where the nVidia Optimus iGPU/dGPU  gets confused (and calls intel graphics rather than nVidia). Something similar?

For OP any combination of the nVidia control panel to set the iGPU (Intel or AMD) as preferred for LibreOffice.

Also, would disable the LO OpenCL support (Tools -> Options -> OpenCL if enabled), just to isolate the GPU usage.
Comment 9 Matt K 2023-12-17 17:40:10 UTC
(In reply to V Stuart Foote from comment #8)
> Hmm, why on this Win11 laptop system is the isGPU() failing? Given the
> system reports it is using Vulkan. 
> 
> We've seen issues where the nVidia Optimus iGPU/dGPU  gets confused (and
> calls intel graphics rather than nVidia). Something similar?
> 
> For OP any combination of the nVidia control panel to set the iGPU (Intel or
> AMD) as preferred for LibreOffice.
> 
> Also, would disable the LO OpenCL support (Tools -> Options -> OpenCL if
> enabled), just to isolate the GPU usage.

My integrated graphics is AMD.  I tried setting it as default for LibreOffice and globally, and even changed Windows default graphics settings to not enable "Hardware-accelerated GPU scheduling".  I also turned off OpenCL.  Still repros, and skia.log is the same (after reboot and restart of LO).
Comment 10 Julien Nabet 2023-12-19 20:11:07 UTC
(In reply to Matt K from comment #7)
> Here is my skia.log:
> 
> RenderMethod: vulkan
> Vendor: 0x10de
> Device: 0x28e1
> API: 1.3.260
> Driver: 546.132.0
> DeviceType: discrete
> DeviceName: NVIDIA GeForce RTX 4050 Laptop GPU
> Denylisted: no

patch which blacklists this model as a workaround on gerrit here:
https://gerrit.libreoffice.org/c/core/+/161032
Comment 11 m_a_riosv 2023-12-20 00:31:32 UTC
Perhaps update the graphics drivers from the vendors could help.
Comment 12 Commit Notification 2023-12-20 13:52:02 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bc00fb6de3ffd3949a3cdb524f49dac7e32258a9

Related tdf#158739: blacklist Nvidia RTX 4050 for Skia hardware rendering

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2023-12-21 15:05:42 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/3a4a906844b57c3bb133e9b7ed52bf1ed49edd84

Related tdf#158739: blacklist Nvidia RTX 4050 for Skia hardware rendering

It will be available in 24.2.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 V Stuart Foote 2023-12-31 20:07:31 UTC
@Julien, probably OK to revert the deny list.

*** This bug has been marked as a duplicate of bug 158942 ***
Comment 15 Julien Nabet 2024-01-01 11:31:55 UTC
(In reply to V Stuart Foote from comment #14)
> @Julien, probably OK to revert the deny list.
> 
> *** This bug has been marked as a duplicate of bug 158942 ***
You're right!
Revert patch here:
https://gerrit.libreoffice.org/c/core/+/161515

I'm gonna take a look to bt concerning the other Skia related bugs  (unless you've already done it?)
Comment 16 Julien Nabet 2024-01-01 11:40:23 UTC
(In reply to Julien Nabet from comment #15)
> ...
> I'm gonna take a look to bt concerning the other Skia related bugs  (unless
> you've already done it?)

I began to take a look but none had crash info :-(
IMHO, we should ask a bt in addition to Skia log. I know it's not easy to ask more info to reporters but in this kind of case, I don't know what would be the alternative and obviously "unblacklisting" some devices at random wouldn't be appropriate.
Comment 17 Commit Notification 2024-01-01 12:21:33 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a3f21172fdb7fed6eb61be9199980421bad71101

Revert "Related tdf#158739: blacklist Nvidia RTX 4050 for Skia hardware"

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 m_a_riosv 2024-01-01 21:01:47 UTC
One thing I always try and sometimes ask reporters to do is to update the graphics drivers from the vendor. It has solved problems for me, with OpenCL and Skia, especially at the beginning of their implementation.
For example, for a long time, I had the OpenCL dll updates installed in a different path, so LO always worked with an old version in the correct path. A headache for a long time.
Comment 19 Julien Nabet 2024-01-01 21:08:05 UTC
(In reply to m.a.riosv from comment #18)
> One thing I always try and sometimes ask reporters to do is to update the
> graphics drivers from the vendor. It has solved problems for me, with OpenCL
> and Skia, especially at the beginning of their implementation.
> ...
Yes, that's why it's the first step described in https://wiki.documentfoundation.org/QA/FirstSteps#Graphics-related_issues_(_Skia_)
Comment 20 m_a_riosv 2024-01-01 21:15:38 UTC
But it's not the same operating system updates, as the AMD INTEL NVIDIA etc. vendor. And at least on Windows, I think people rely on system updates.
Comment 21 Matt K 2024-01-01 22:51:24 UTC
Confirming that the steps in comment 0 no longer fire an assert after Mike's patch and Julien's patch to revert the blacklisting.
Comment 22 Commit Notification 2024-01-02 14:44:06 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/9558616fdac9e58282c5d07d8345410b5479dc2b

Revert "Related tdf#158739: blacklist Nvidia RTX 4050 for Skia hardware"

It will be available in 24.2.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.