Bug 100275 - Crash on index update in mailmerged document
Summary: Crash on index update in mailmerged document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.3.0 target:5.2.0.1 target:5.1.5
Keywords: regression
: 44959 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-08 17:10 UTC by vincent.lefoulon
Modified: 2016-10-25 18:54 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
The .odt file which crashes (9.25 KB, application/vnd.oasis.opendocument.text)
2016-06-08 17:10 UTC, vincent.lefoulon
Details
The database (7.07 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-06-09 14:18 UTC, vincent.lefoulon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vincent.lefoulon 2016-06-08 17:10:25 UTC
Created attachment 125553 [details]
The .odt file which crashes

Hi,

LibreOffice crashes when I follow these steps:

* Create a .odt file
* Add a data source : Edit > Exchange Database
* Browse a .ods file and define a sheet as database
* Insert a variable from this database : F4 > drag & drop a column's first row
* Insert a table of contents with Heading in its additional styles
* Insert a heading 1
* Insert a second heading 1
* Update the table
* Print the document as a form letter : Ctrl + P > Yes
* Output : file
* Save as .pdf
* See LO crash

LO does not crash when there is one heading only.

This bug does not appear with LO 4.4.7.2.

Thanks
Comment 1 Julien Nabet 2016-06-08 21:10:50 UTC
On pc Debian x86-64 with master sources updated today or with Debian package 5.1.3, I don't reproduce this.

On which env are you?
Could you give a try to last stable LO version (5.1.3)?
Comment 2 Alex Thurgood 2016-06-09 08:56:43 UTC
No repro with 

Version: 5.1.3.2
Build ID: 644e4637d1d8544fd9f56425bd6cec110e49301b
CPU Threads: 2; OS Version: Mac OS X 10.11.5; UI Render: default; 
Locale: fr-FR (fr.UTF-8)

WFM

@Vincent : please specify your OS version/bit type, and reset your user profile.

Also please try with a current version of LibreOffice and report back.
Comment 3 vincent.lefoulon 2016-06-09 14:18:29 UTC
Created attachment 125572 [details]
The database
Comment 4 vincent.lefoulon 2016-06-09 14:21:00 UTC
I'm under ArchLinux x86_64. I downloaded LO 5.1.3-1 (https://www.archlinux.org/packages/?arch=any&arch=i686&arch=x86_64&q=libreoffice-fresh) and the bug still appears.

Friends of mine under Windows 10 also meet the problem.

I uploaded the database to be linked to the .odt file.

Thank you
Comment 5 Alex Thurgood 2016-06-09 15:30:12 UTC
Confirming with test files provided by Vincent

Version: 5.1.3.2
Build ID: 644e4637d1d8544fd9f56425bd6cec110e49301b
CPU Threads: 2; OS Version: Mac OS X 10.11.5; UI Render: default; 
Locale: fr-FR (fr.UTF-8)
Comment 6 Alex Thurgood 2016-06-09 15:32:22 UTC
i couldn't reproduce this when I used my own files for testing, so perhaps something particular with your files ?
Comment 7 vincent.lefoulon 2016-06-09 15:37:50 UTC
My friends can reproduce the bug with their files. Maybe with more details, you can too:

* Create a .ods file
* In A1, put "Var"
* In A2, put any value
* Create a .odt file
* Define the sheet you've juste created as a database
* Insert the field "Var"
* Insert a table of contents with Heading 1 (for instance) in level 1 in additional styles
* Insert a Heading 1
* Insert a second Heading 1
* Update the table of contents : right click on it > Update index/table
* Print the file as a letter, in a PDF file : Ctrl + P > "Yes"
Comment 8 Caolán McNamara 2016-06-10 13:55:09 UTC
*** Bug 44959 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2016-06-10 14:00:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c1a1d1c66aff497702abc20df5832fa348f1008

Resolves: tdf#100275 makeMark may return null under some circumstances

It will be available in 5.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2016-06-10 14:02:06 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=61a98b7bb14986f6c7c218effacabbe4b925f6b6&h=libreoffice-5-2

Resolves: tdf#100275 makeMark may return null under some circumstances

It will be available in 5.2.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Caolán McNamara 2016-06-10 14:04:35 UTC
That makes it not crash anyway, maybe mstahl has an idea if it should have returned null or not in the first place
Comment 12 Commit Notification 2016-06-11 10:08:53 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=63c693a09f9fc816c8d392d82855fab6f561392c&h=libreoffice-5-1

Resolves: tdf#100275 makeMark may return null under some circumstances

It will be available in 5.1.5.

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

Affected users are encouraged to test the fix and report feedback.
Comment 13 Alex Thurgood 2016-06-14 07:34:47 UTC
Verified in 

Version: 5.3.0.0.alpha0+
Build ID: ab7e112bcf2ecd09ea129ef81177df8036110cb6
Threads CPU : 2; Version de l'OS :Mac OS X 10.11.5; UI Render : par défaut; 
Locale : fr-FR (fr.UTF-8)
Comment 14 Michael Stahl (allotropia) 2016-06-15 08:11:50 UTC
regression from:

commit 689962feae2054f965a7378c3408b0ccfad2bbd5
Author:     Jan-Marek Glogowski <glogow@fbihome.de>
AuthorDate: Thu Dec 3 23:18:16 2015 +0100
Commit:     Björn Michaelsen <bjoern.michaelsen@canonical.com>
CommitDate: Wed Dec 9 18:46:55 2015 +0000

    tdf#92623 Handle StartOfContent node for copying bookmarks
    
    For SwDoc::AppendDoc we use the StartOfContent node as the
    starting copy node to prevent merging of the first node in
    CopyRange and to get a 2nd node needed for CopyRange in case
    of single content node documents.
    
    This correctly counts StartOfContent as a non-copy node when
    adapting the bookmark ranges for copying.


the commit in comment #9 only avoids crashing, it does not fix
the bookmarks (and redlines) being copied to the wrong nodes.

fixed on master.
Comment 15 Commit Notification 2016-06-15 08:12:25 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bc387975b11d87868884ec770a2a42a4f7092b5f

tdf#100275 sw: fix target node of bookmark copy

It will be available in 5.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2016-06-15 19:40:46 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c702a4b3a1ef14702b47c7d7c1c7129c7c97bfb&h=libreoffice-5-2

tdf#100275 sw: fix target node of bookmark copy

It will be available in 5.2.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2016-06-16 09:04:01 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f1951c97001ea95bc22fef66ede1f771231c33d3&h=libreoffice-5-1

tdf#100275 sw: fix target node of bookmark copy

It will be available in 5.1.5.

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

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