Bug 126004 - Crash swlo!SwEditShell::ValidateAllParagraphSignatures
Summary: Crash swlo!SwEditShell::ValidateAllParagraphSignatures
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0 target:6.3.0.2
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2019-06-19 13:45 UTC by Telesto
Modified: 2019-07-15 11:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (gtk3) (6.78 KB, text/plain)
2019-06-19 20:16 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2019-06-19 13:45:38 UTC
Description:
swlo!SwEditShell::ValidateAllParagraphSignatures

Steps to Reproduce:
1. Open attachment 143131 [details] (from bug 118392)
2. Click Print Preview
3. Click Print (CTRL+P) -> Crash

Actual Results:
Crash

Expected Results:
No crash


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.0.0.alpha0+ (x86)
Build ID: ac14e5613597e7361ce6995dacb1bb5bd55b6b00
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-06-06_05:09:49
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: threaded
Comment 1 raal 2019-06-19 14:39:19 UTC
I can confirm with Version: 6.3.0.0.beta1+ (x86)
Build ID: 5cfac16dbd4af456a7fb6d52c8953c69a72ba2ba
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win;
Comment 2 Telesto 2019-06-19 14:51:14 UTC
No repro with
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL
Comment 3 raal 2019-06-19 15:08:52 UTC
This seems to have begun at the below commit.
Adding Cc: to Ashod Nakashian ; Could you possibly take a look at this one? Thanks
 30cd613ce80a70bb15bc8f67e983a1e68854c274 is the first bad commit
commit 30cd613ce80a70bb15bc8f67e983a1e68854c274
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu Jan 3 10:26:45 2019 -0800

    source 5d6102ce297f12a81e1d21b4ffc9df1d97d0b847

author	Ashod Nakashian <ashod.nakashian@collabora.co.uk>	2018-10-03 05:53:28 -0400
committer	Ashod Nakashian <ashnakash@gmail.com>	2019-01-03 19:12:07 +0100
commit 5d6102ce297f12a81e1d21b4ffc9df1d97d0b847 (patch)
tree ceccb733e926c69d9ef75fe078c6f28ba6a3e2b4
parent dd2972d4c323afddc1eca90c88fe6240f40685dd (diff)
sw: paragraph-sign: process signatures in one pass on loading
Comment 4 Julien Nabet 2019-06-19 20:16:32 UTC
Created attachment 152295 [details]
bt with debug symbols (gtk3)

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 5 Julien Nabet 2019-06-19 20:25:50 UTC
With this patch, it doesn't crash
diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx
index 266ee7386875..f13a25559f1f 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -200,7 +200,8 @@ IMPL_LINK_NOARG( DocumentTimerManager, DoIdleJobs, Timer*, void )
         m_rDoc.getIDocumentFieldsAccess().UpdateRefFields();  // References
 
         // Validate and update the paragraph signatures.
-        m_rDoc.GetEditShell()->ValidateAllParagraphSignatures(true);
+        if (m_rDoc.GetEditShell())
+            m_rDoc.GetEditShell()->ValidateAllParagraphSignatures(true);
 
         pTmpRoot->EndAllAction();
but as always, is it a real fix or am I just hiding the root cause.
Comment 6 Julien Nabet 2019-06-19 20:26:50 UTC
Also I noticed a lot of these 2 kinds of logs:
warn:legacy.osl:15258:15258:sw/source/core/txtnode/swfont.cxx:428: Unsupported direction
warn:sw.core:15258:15258:sw/source/core/txtnode/swfont.cxx:407: unsupported direction for VertLRBT

but that's another story
Comment 7 Xisco Faulí 2019-06-20 10:03:45 UTC
Also reproducible on linux
Comment 8 Xisco Faulí 2019-06-25 11:43:33 UTC
(In reply to Julien Nabet from comment #5)
> With this patch, it doesn't crash
> diff --git a/sw/source/core/doc/DocumentTimerManager.cxx
> b/sw/source/core/doc/DocumentTimerManager.cxx
> index 266ee7386875..f13a25559f1f 100644
> --- a/sw/source/core/doc/DocumentTimerManager.cxx
> +++ b/sw/source/core/doc/DocumentTimerManager.cxx
> @@ -200,7 +200,8 @@ IMPL_LINK_NOARG( DocumentTimerManager, DoIdleJobs,
> Timer*, void )
>          m_rDoc.getIDocumentFieldsAccess().UpdateRefFields();  // References
>  
>          // Validate and update the paragraph signatures.
> -        m_rDoc.GetEditShell()->ValidateAllParagraphSignatures(true);
> +        if (m_rDoc.GetEditShell())
> +            m_rDoc.GetEditShell()->ValidateAllParagraphSignatures(true);
>  
>          pTmpRoot->EndAllAction();
> but as always, is it a real fix or am I just hiding the root cause.

@Julien, Could you please submit a patch to gerrit so others can review it ?
Comment 9 Julien Nabet 2019-06-25 12:21:55 UTC
(In reply to Xisco Faulí from comment #8)
> ...
> 
> @Julien, Could you please submit a patch to gerrit so others can review it ?
No pb, I'll be able to do it after my daytime job.
Comment 10 Julien Nabet 2019-06-25 16:29:35 UTC
(In reply to Julien Nabet from comment #9)
> (In reply to Xisco Faulí from comment #8)
> > ...
> > 
> > @Julien, Could you please submit a patch to gerrit so others can review it ?
> No pb, I'll be able to do it after my daytime job.

Done here:
https://gerrit.libreoffice.org/#/c/74714/
Comment 11 Commit Notification 2019-07-13 01:22:06 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/12252f27d108402df02a298bbe1b6e8f290b34d7%5E%21

tdf#126004: test EditShell is ok before calling ValidateAllParagraphSignatures

It will be available in 6.4.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 12 Ashod Nakashian 2019-07-13 01:23:30 UTC
Looks good to me. Merged. Thanks Julien.
Comment 13 Commit Notification 2019-07-13 22:04:43 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/fa088732e195500d1e50318d7c88a46e73a307ea%5E%21

tdf#126004: test EditShell is ok before calling ValidateAllParagraphSignatures

It will be available in 6.3.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.
Comment 14 Xisco Faulí 2019-07-15 11:23:38 UTC
Verified in

Version: 6.4.0.0.alpha0+
Build ID: ed2107f0488887528d8e49135d3270705f389ed5
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Julien Nabet, Thanks for fixing this issue!