Bug 152931 - Assertion when launching LO (gen rendering only)
Summary: Assertion when launching LO (gen rendering only)
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2023-01-08 17:18 UTC by Julien Nabet
Modified: 2023-01-10 20:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (14.36 KB, text/plain)
2023-01-08 17:20 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2023-01-08 17:18:47 UTC
Description:
On pc Debian x86-64 with master sources updated today, I have a crash when lauching LO.

Steps to Reproduce:
1. Launch terminal/console
2. export SAL_USE_VCLPLUGIN=gen
3. soffice

Actual Results:
Crash

Expected Results:
No crash


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5c4fa7ddb0b12d30304bbc6119a0aa1d3d65b55d
CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 1 Julien Nabet 2023-01-08 17:20:32 UTC
Created attachment 184528 [details]
bt with debug symbols
Comment 2 Julien Nabet 2023-01-08 17:22:22 UTC
Noel: thought you might be interested in this one since it seems to be a regression from:
89b1d41e0d2cd
use std::optional for SALCOLOR_NONE
    
instead of re-using an actual real color value, because it will totally
not work when I convert vcl to use alpha instead of transparency
Comment 3 Julien Nabet 2023-01-08 19:26:26 UTC
of course, we can use this patch:
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 4b3b128b7442..522162fe1b11 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -152,7 +152,8 @@ X11SalGraphicsImpl::~X11SalGraphicsImpl()
 
 void X11SalGraphicsImpl::Init()
 {
-    mnPenPixel = mrParent.GetPixel( *moPenColor );
+    if (moPenColor.has_value())
+        mnPenPixel = mrParent.GetPixel( *moPenColor );
     mnBrushPixel = mrParent.GetPixel( *moBrushColor );
 }

but would prefer having some feedback because it might just a bandaid.
Comment 4 Julien Nabet 2023-01-09 07:01:50 UTC
Patch from Caolán here: https://gerrit.libreoffice.org/c/core/+/145180
Comment 5 Stéphane Guillou (stragu) 2023-01-09 07:40:47 UTC
Can't reproduce on Ubuntu 20.04 with a build that doesn't include the patch:


    Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
    Build ID: 8ae84bb5566e12df64236a116b9d1889d6f5f052
    CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: x11
    Locale: en-AU (en_AU.UTF-8); UI: en-US
    Calc: threaded

Am I missing something?
Comment 6 Julien Nabet 2023-01-09 07:45:29 UTC
(In reply to Stéphane Guillou (stragu) from comment #5)
> Can't reproduce on Ubuntu 20.04 with a build that doesn't include the patch:
> 
> 
>     Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
>     Build ID: 8ae84bb5566e12df64236a116b9d1889d6f5f052
>     CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: x11
>     Locale: en-AU (en_AU.UTF-8); UI: en-US
>     Calc: threaded
> 
> Am I missing something?

Since it’s an assertion, you must have a debug build, is it your case?
Comment 7 Commit Notification 2023-01-09 08:55:54 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/72a08a55791a1c17c0ec15b2ab5c7294c23e2831

tdf#152931 deref of moPenColor std::optional on launching writer

It will be available in 7.6.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 8 Julien Nabet 2023-01-10 20:44:21 UTC
I confirm it works, thank you Caolán!