Created attachment 187897 [details] Callstack by Visual Studio I could reproduce the crash mentioned in https://gerrit.libreoffice.org/c/core/+/152673 for normal, not headless export. The callstack from Visual Studio is attached. The crash happen in oox/source/export/drawingml.cxx in if (aColorStops.size() != aAlphaStops.size() || nullptr == pGradient) { // this is an error - synchronizeColorStops above *has* to create that // state, see description there (!) // also an error - see comment in header - is to give neither pColorGradient // nor pTransparenceGradient assert(false && "oox::WriteGradientFill: non-synchronized gradients (!)"); return; }
Created attachment 187900 [details] reduced example The error is in synchronizeColorStops in gradienttools.cxx in lines 440 to 454. In both cases not only aNewAlpha (or aNewColor respectively), has to get the stop but aNewColor (or aNewAlpha respectively) too. The both aNew... need to grow simultaneously. The situation in the example is, that the offsets for the colors are 0 and 0.9, and for the transparency 0 and 1. The generated aNewColor and aNewAlpha both need the stops 0, 0.9 and 1. [Looking at the code, I'm not sure whether the combination of axial and linear is handled correctly. (In the following the Number is the offset and the characters are the values.) Imagine a axial color gradient with 0 A, 1 B together with a linear transparency gradient 0 X, 1 Y. Then the resulting stops should be 0 BX, 0.5 A middle_of_XY, 1 BY. But because you apply axial after synchronizing you get 0 BY, 0.5 AX, 1 BY. But I'm not sure and its after midnight so would need to look at it tomorrow again.]
Created attachment 187901 [details] axial color mixed with linear transparency Axial plus linear is indeed a problem. The attached file has a shape with both gradients with stops at offset 0 and 1 (so do not trigger the crash) and a screenshot of the shape. Save the file to pptx and open the pptx-file. You see the error immediately.
I have written bug 155827 for the axial-linear problem. It is independent from the crash here.
I'll work on it.
Regina Henschel committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f3f64c77585d0c3c01c0d960f4959e18e9668c30 tdf155825 result same size in synchronize gradients It will be available in 24.2.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.
Regina Henschel committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/6ce0ba0c94e137a7b3e0ddd0634c9b545eb2b9f0 tdf155825 result same size in synchronize gradients It will be available in 7.6.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.