Bug 47436

Summary: FILEOPEN: Writer crashes when it opens an odt file produced by JasperReport
Product: LibreOffice Reporter: Jean-Baptiste Faure <jbfaure>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: high CC: arnaud.versini, cedric.bosdonnat.ooo, chagadaev
Version: 3.5.1 releaseKeywords: regression
Hardware: All   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=64150
Whiteboard: BSA target:3.6.0 target:3.5.4
i915 platform: i915 features:
Attachments: ODT bugdoc which kills LO
Valgrind report of the crash

Description Jean-Baptiste Faure 2012-03-17 05:41:14 UTC
Problem description: 

Steps to reproduce:
1. open attached odt file

Current behavior: LO 3.5 crashes

Expected behavior: LO 3.5 opens the file as it does in 3.4.5 version

Note 1: I am not sure if the odt file produced by JasperReport is a valid ODF but LO should'nt crash.

Note 2: if I open the file with LO 3.4.5 and save it under a new name, I can open this new file with LO 3.5 but it looks slightly different. The document seems to be a very complicated set of tables with many empty cells. In LO 3.5 it is impossible to hide table boundaries.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
Comment 1 Jean-Baptiste Faure 2012-03-17 06:26:24 UTC
Created attachment 58597 [details]
ODT bugdoc which kills LO
Comment 2 Jean-Baptiste Faure 2012-03-17 06:31:30 UTC
The bugdoc kills LO 3.5.2 rc0+ (Version ID : c39e96d-a73d29c-73cb0b8-f269e46-686380c) and the master too (LibreOffice 3.6.0alpha0+ 
Build ID: 08ba87c-49d3d39-e67b1bf-879ce36-638d9c).

Best regards. JBF
Comment 3 Jean-Baptiste Faure 2012-03-17 06:55:46 UTC
Version of JasperReports used to produce the bugdoc : 4.5.1
Comment 4 Arnaud Versini 2012-03-17 07:04:27 UTC
Created attachment 58605 [details]
Valgrind report of the crash
Comment 5 Jean-Baptiste Faure 2012-03-17 07:13:01 UTC
Hi Cédric,

Please, have a look at this crash. Perhaps the bugdoc is not a valid ODF file, but LO should'nt crash.

Best regards. JBF
Comment 6 Szabolcs Dézsi 2012-04-19 15:26:13 UTC
Hi!

editeng/source/items/frmitems.cxx:1954

1951:   for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
1952:   {
1953:       editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) );
1954:       pLine->SetStyle( eBorderStyle );
1956:   }

Here pLine is a NULL pointer, so calling its member function (SetStyle) causes SIGSEGV.

Putting 'if( pLine )' before line 1954 causes LO to load the document.
Table boundaries are impossible to hide like you said.

Szabolcs
Comment 7 Not Assigned 2012-04-20 01:39:28 UTC
Dezsi Szabolcs committed a patch related to this issue.
It has been pushed to "master":

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

fdo#47436: Fixed crash while opening odt file.
Comment 8 Jean-Baptiste Faure 2012-04-20 10:56:03 UTC
Works well in master (version 3.6.0alpha0+  (Build ID: 6a018de)). Thank you.

Is this fix backportable to LO 3.5 ?
Setting resolved as fixed anyway.

Best regards. JBF
Comment 9 Not Assigned 2012-04-23 00:10:23 UTC
Dezsi Szabolcs committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1ad284007d898c68665c91979be3bd326c290ba1&g=libreoffice-3-5

fdo#47436: Fixed crash while opening odt file.


It will be available in LibreOffice 3.5.4.
Comment 10 Julien Nabet 2012-04-28 13:01:39 UTC
*** Bug 49209 has been marked as a duplicate of this bug. ***
Comment 11 s-joyemusequna 2012-05-19 09:25:58 UTC
Verified with LOdev 3.6 (master - 18-May-2012 02h44 x86@6-fast; Build ID: 8b1d29b) under Windows Vista 64.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.