Bug Hunting Session
Bug 71429 - Writer crashes/hangs when removing a Header with 'Same content on first page' unchecked
Summary: Writer crashes/hangs when removing a Header with 'Same content on first page'...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta1
Hardware: Other All
: high critical
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: BSA target:4.3.0 target:4.2.0.2 targe...
Keywords: haveBacktrace, regression
: 60685 71514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-09 13:56 UTC by Volkan
Modified: 2015-02-05 13:36 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Crashing file (7.51 KB, application/vnd.oasis.opendocument.text)
2013-11-10 05:55 UTC, Volkan
Details
bt (10.64 KB, text/plain)
2013-11-12 21:58 UTC, Julien Nabet
Details
gdbtrace (19.55 KB, text/x-log)
2013-11-22 22:17 UTC, Vera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volkan 2013-11-09 13:56:37 UTC
Problem description: 

Writer crasher each time when removing a Header.

Steps to reproduce:
1. Click on Header and create one with some dummy text
2. Create a new page
3. Edit the header properties by unchecking "Same content on first page"
4. Remove the header from first page

Current behavior:

It crashes without any message.

Expected behavior:

It should only remove the header on first page.
              
Operating System: Ubuntu
Version: 4.1.2.3 release
Comment 1 tommy27 2013-11-10 05:47:34 UTC
hi Volkan.
please attach a test file where you experience the crash.
then try upgrading to 4.1.3 and tell us if you still the crash.
Comment 2 Volkan 2013-11-10 05:55:44 UTC
Created attachment 88956 [details]
Crashing file
Comment 3 Volkan 2013-11-10 05:55:53 UTC
Hi,

Please find attached file. Just remove the header in the first page and it crashes.
Comment 4 Volkan 2013-11-10 05:57:58 UTC
Now tried again but it does not crash if you simply remove the header.

You should choose "Format Header" by clicking on the down-arrow on header then press "Apply" then close the dialog and remove the header.
Comment 5 tommy27 2013-11-10 08:17:29 UTC
the attached text document has a header with no text. is it intended or did you attach an empty file?
Comment 6 Volkan 2013-11-10 17:05:31 UTC
Yes it is intended file...
Comment 7 tommy27 2013-11-11 06:01:11 UTC
Ok, so please write me again exact steps to reproduce the crash with your test file.
Comment 8 Volkan 2013-11-11 11:33:57 UTC
Tried with 4.1.3, but the same.

Here are the steps:

1) Click on the down arrow in Header and choose "Format Header..."

2) Uncheck "Same content on first page"

3) Apply and Click OK

4) Click on the down arrow in Header again and choose "Delete Header"
Comment 9 Maxim Monastirsky 2013-11-11 11:41:25 UTC
Reproducible under Fedora 19 (64-bit) with 4.1.3.2. LO hangs, not crashes.

How to reproduce:
1) Open a new Writer document.
2) Click on the header and create one with some dummy text.
3) Add a new page (insert page break).
4) Click on the second page header, and choose 'Format Header...'.
5) Go to 'Header' tab and uncheck 'Same content on first page'.
6) Click 'Apply'.
7) Click 'OK' to close the dialog.
8) Click on the first page header and choose 'Delete Header'.
9) Confirm by clicking 'Yes'.

The backtrace is:

0x00007fffd337c6e0 in BigPtrArray::Index2Block (this=this@entry=0x10e3060, pos=pos@entry=8) at /usr/src/debug/libreoffice-4.1.3.2/sw/source/core/bastyp/bparr.cxx:161
161	        if( p->nStart <= pos && p->nEnd >= pos )
#0  0x00007fffd337c6e0 in BigPtrArray::Index2Block (this=this@entry=0x10e3060, pos=pos@entry=8) at /usr/src/debug/libreoffice-4.1.3.2/sw/source/core/bastyp/bparr.cxx:161
#1  0x00007fffd337c841 in BigPtrArray::operator[] (this=this@entry=0x10e3060, idx=idx@entry=8) at /usr/src/debug/libreoffice-4.1.3.2/sw/source/core/bastyp/bparr.cxx:122
#2  0x00007fffd34b3028 in operator[] (n=8, this=0x10e3060) at /usr/src/debug/libreoffice-4.1.3.2/sw/inc/ndarr.hxx:143
#3  SwNodes::RemoveNode (this=0x10e3060, this@entry=<error reading variable: Cannot access memory at address 0x7fffffffc588>, nDelPos=4, nSz=4, bDel=<optimized out>) at /usr/src/debug/libreoffice-4.1.3.2/sw/source/core/docnode/nodes.cxx:2341
Comment 10 tommy27 2013-11-11 12:29:15 UTC
(In reply to comment #8)
> Tried with 4.1.3, but the same.
> 
> Here are the steps:
> 
> 1) Click on the down arrow in Header and choose "Format Header..."
> 
> 2) Uncheck "Same content on first page"
> 
> 3) Apply and Click OK
> 
> 4) Click on the down arrow in Header again and choose "Delete Header"

Ok. reproduced with 4.1.2.3 under Win7 64bit.
LibO crashes.

@Maxim
did you try following Volkan's steps using his test file?
Comment 11 Maxim Monastirsky 2013-11-11 12:34:30 UTC
(In reply to comment #10)
> @Maxim
> did you try following Volkan's steps using his test file?
Yes. Same results.
Comment 12 tommy27 2013-11-11 19:23:44 UTC
tested with multiple LibO versions under Win7 64bit

4.1.3 --> crash
4.1.2 --> crash
4.1.0 --> hangs
4.0.5 --> crash
4.0.4 --> hangs
3.6.7 --> no crash ("Same content on first page" option not available).

so issue has probably been introduced during 4.0.x development.
I add regression keyword and put Writer expert in CC-list
Comment 13 Maxim Monastirsky 2013-11-12 06:19:10 UTC
Bug 71514 looks related.
Comment 14 Julien Nabet 2013-11-12 21:58:14 UTC
Created attachment 89107 [details]
bt

On pc Debian x86-64 with master sources updated today and by following instructions given comment 8, I reproduced the crash.

I attached console logs + bt.
Comment 15 Maxim Monastirsky 2013-11-20 12:32:05 UTC
*** Bug 71514 has been marked as a duplicate of this bug. ***
Comment 16 Vera 2013-11-22 22:17:03 UTC
Created attachment 89656 [details]
gdbtrace

3.12.0-3-generic

4.2.0~alpha1-0ubuntu1~trusty1~ppa2
Comment 17 Michael Stahl (CIB) 2013-12-18 19:54:49 UTC
crashes in 4.0.0.0 beta1 already
Comment 18 Commit Notification 2013-12-20 23:07:27 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

fdo#71429: sw: fix crashes when changing header first sharing



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 19 Michael Stahl (CIB) 2013-12-20 23:18:37 UTC
fixed on master
Comment 20 Commit Notification 2013-12-21 16:04:35 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

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

fdo#71429: sw: fix crashes when changing header first sharing


It will be available in LibreOffice 4.2.

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 21 Commit Notification 2013-12-21 16:22:00 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

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

fdo#71429: sw: fix crashes when changing header first sharing


It will be available in LibreOffice 4.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 22 Volkan 2013-12-23 19:04:47 UTC
Works for me.

But assuming we created headers then unchecked "Same on first page". Should removing header from second page remove also the first page header?
Comment 23 sophie 2014-01-10 08:34:18 UTC
Verified with Version: 4.2.0.2
Build ID: 601a398b803303d1a40a3299729531824fe0db56 - Closing - Sophie
Comment 24 Caolán McNamara 2015-02-05 13:36:12 UTC
*** Bug 60685 has been marked as a duplicate of this bug. ***