Bug 42771

Summary: Crash over invalid ODF
Product: LibreOffice Reporter: Dag Wieers <dag>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: dag, michael.stahl, sasha.libreoffice
Priority: medium    
Version: 3.5.0 RC1   
Hardware: All   
OS: All   
Whiteboard: target:3.4.6 target:3.5.1 target:3.6.0beta0 odf
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 37361    
Attachments: Test
backtrace of crash in 3.6.0 beta 2 on Fedora 64 bit

Description Dag Wieers 2011-11-10 00:38:10 UTC
The below invalid ODF crashes Writer. There is a missing </text:note-citation> in the example. If you add that, it works fine.

------
<?xml version="1.0" encoding="UTF-8"?>

<office:document
 xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
 xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
 office:version="1.2"
 office:mimetype="application/vnd.oasis.opendocument.text">
<office:body>
<office:text>
<text:p>This is a simple footnote<text:note text:note-class="footnote"><text:note-citation><text:label>1</text:label><text:note-body><text:p text:style-name="footnote">A footnote is a note in the footer</text:p></text:note-body></text:note> test.</text:p>
</office:text>
</office:body>
</office:document>
------
Comment 1 Florian Reisinger 2012-01-21 06:32:06 UTC
With LibO 3,5rc1 it opens as a plane-text file
Win7 x64
Comment 2 Dag Wieers 2012-01-22 16:41:47 UTC
It still fails for me with 3.5rc1:

[dag@moria asciidoc-odf]$ /opt/libreoffice3.5/program/swriter examples/crash.fodt 
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

The fact that it opens as a text file probably is another bug of its own. as it seems to have failed to use the correct ODF filter.
Comment 3 sasha.libreoffice 2012-02-07 05:34:15 UTC
@ Dag Wieers
Please, attach document as standalone file
Comment 4 Dag Wieers 2012-02-07 05:58:48 UTC
Created attachment 56707 [details]
Test
Comment 5 Dag Wieers 2012-02-07 05:59:33 UTC
Sasha, instead of writing that comment, you could have done it yourself. It litteraly takes 15 seconds to paste it in a file and attach it...
Comment 6 sasha.libreoffice 2012-02-07 06:05:00 UTC
reproduced in LibO 3.5.0 beta 2 on Fedora 64 bit

> instead of writing that comment, you could have done it yourself
I done it, but how to force office open it as odf document instead of text?
Comment 7 sasha.libreoffice 2012-02-07 06:09:11 UTC
Created attachment 56708 [details]
backtrace of crash in 3.6.0 beta 2 on Fedora 64 bit
Comment 8 Dag Wieers 2012-02-07 06:11:09 UTC
There is a problem with the official RPMs where the mime-types for Flat ODF files are missing from the installation. This has been reported more than a year ago, but still hasn't been addressed, even in the 3.5.0 RC3 release :-( Uncertain this will be fixed in 3.5.0, sigh...

I think I made the associations on my RHEL system manually so that it opens it correctly as Flat ODF. The official extension for Flat ODT is .fodt, for Flat ODS is .fods, etc...

Thanks for confirming !
Comment 9 Jan Holesovsky 2012-02-10 08:59:25 UTC
The missing mime types are a separate problem, please create a separate bug for that, if it is not fixed yet.

This crash is fixed now in master, hopefully it will be cherry-picked to libreoffice-3-5 soon.

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9951de4a10386a85dc1bfa465304cd0005414b8e
Comment 10 Dag Wieers 2012-02-10 16:16:58 UTC
Hi Jan,

Thanks for fixing this. Will this be fixed in 3.4 and 3.5 as well ?
Comment 11 Caolán McNamara 2012-02-13 05:33:40 UTC
pushed to 3-4 as well now
Comment 12 sasha.libreoffice 2012-02-13 05:35:01 UTC
Thanks