Bug 50896 - Writer crash when applying an AutoFormat to a table
Summary: Writer crash when applying an AutoFormat to a table
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium major
Assignee: David Tardon
URL:
Whiteboard: target:3.7.0 target:3.6.0.0.beta2
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-06-08 14:39 UTC by Muhammad Haggag
Modified: 2019-06-16 18:28 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
gdb log with full backtrace. (51.32 KB, text/x-log)
2012-06-08 14:39 UTC, Muhammad Haggag
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Muhammad Haggag 2012-06-08 14:39:39 UTC
Created attachment 62819 [details]
gdb log with full backtrace.

Steps to reproduce:
1. Launch writer
2. Ctrl+F12 to insert a table. Accept the default table settings.
3. Table Properties->AutoFormat
4. Choose the "3D" autoformat, press OK

Result: Writer crashes. gdb log attached with full backtrace.

It's crashing because we're calling push_back on a boost ptr_vector with a null pointer. The crash occurs in sw/source/core/undo/untbl.cxx line 1320, and I tracked it back to the commit 2552420c by Noel Grandin (http://cgit.freedesktop.org/libreoffice/core/commit/?id=2552420cdc7588e1b0da06fd6810dba855e9d43c). The commit replaced SV_DECL_PTRARR goo with boost::ptr_vector.

It might be that SV_DECL_PTRARR accepted null pointers while boost::ptr_vector does not, or it might be that a regression happened causing the pointer to be null now when it wasn't before.
Comment 1 pz1 2012-06-09 00:33:11 UTC
Bug confirmed here in version 3.6.0alpha1+ (Build ID: 793f240) on my Windows XOP machine
Comment 2 Noel Grandin 2012-06-11 05:31:58 UTC
For 3.6, the best thing to do is to revert my change.

For master, I'll spin a patch that uses std::vector.
Comment 3 David Tardon 2012-06-11 06:16:24 UTC
sorry, Noel, I have already done that...
Comment 4 Not Assigned 2012-06-11 06:21:53 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

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

fdo#50896 SfxItemSets can contain emtpy element
Comment 5 Not Assigned 2012-06-18 02:03:22 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9334a18fdffeb2a2255b1cf82c2ebc511421f24c&g=libreoffice-3-6

fdo#50896 SfxItemSets can contain emtpy element


It will be available in LibreOffice 3.6.