Bug 52125 - : libreoffice --headless should return 0 on successful conversion
Summary: : libreoffice --headless should return 0 on successful conversion
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-15 18:10 UTC by Ángel
Modified: 2013-12-17 10:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ángel 2012-07-15 18:10:01 UTC
Problem description: 

After updating from 3.5.4 to 3.5.5, libreoffice --headless is now exiting with a 139 code instead of 0 as it used to. Conversion itself is apparently right, and no error messages are generated.

Steps to reproduce:
libreoffice --headless -convert-to odt "somedocument" -outdir .

Expected behavior:
The document is converted to odt and libreoffice returns 0.

Current behavior:
The document is converted to odt and libreoffice returns 139.
Comment 1 Rainer Bielefeld Retired 2012-12-18 14:07:19 UTC
I will check this soon.

@Ángel:
Please add info concernin your OS!
Comment 2 Ángel 2012-12-18 15:55:25 UTC
Linux 64bits.

I just checked and it's still failing in libreoffice 3.6.4
Comment 3 Rainer Bielefeld Retired 2012-12-29 08:45:08 UTC
Hm, my test on VirtuallBox Ubuntu 12.04 With LibO 3.5.4.2 showed a sigsegv CRASH
Comment 4 Rainer Bielefeld Retired 2013-01-05 17:05:39 UTC
I can't help here
Comment 5 Matthias Wieser 2013-05-11 21:23:45 UTC
Running on debian 7.0

libreoffice --headless -convert-to odt table_text.docx -outdir .
convert /PATH/table_text.docx -> /PATH/table_text.odt using writer8
Overwriting: /PATH/table_text.odt 
matthias@hiaslop:~/PATH/$ echo $?
0

As far as I can see, the problem is resolved in the latest software.
Comment 6 retired 2013-05-13 08:58:21 UTC
Hi Matthias, thanks for testing and updating this ticket.

Please note that the specified version number is the version the bug first appeared so I set that back to 3.5.5.
Comment 7 Ángel 2013-06-21 20:32:07 UTC
Sadly, I can still reproduce it on 4.0.3.3

Matthias, what libreoffice version are you using?
From http://packages.debian.org/wheezy/libreoffice (1:3.5.4+dfsg2-0+deb7u2) 
I suspect that you will be running 3.5.4, which was the latest working version.
Comment 8 Owen Genat (retired) 2013-12-14 10:27:55 UTC
Unable to reproduce. Tested with this pair of commands:

$ soffice --headless --convert-to pdf file.odt && echo "$?"
$ soffice --headless --convert-to pdf no_file.odt && echo "$?"

... where file.odt exists and no-file.odt does not. Run under Ubuntu 10.04 x86_64 using:

- v3.3.0.4 OOO330m19 Build: 6
- v3.4.6.2 OOO340m1 Build: 602
- v3.5.7.2 Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b
- v3.6.7.2 Build ID: e183d5b
- v4.0.6.2 Build ID: 2e2573268451a50806fcd60ae2d9fe01dd0ce24
- v4.1.3.2 Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a

Exit code is always zero. Perhaps try invoking the program (soffice) directly rather than one of the symlinks?
Comment 9 Stephan Bergmann 2013-12-16 13:08:27 UTC
(In reply to comment #0)
> After updating from 3.5.4 to 3.5.5, libreoffice --headless is now exiting
> with a 139 code instead of 0 as it used to. Conversion itself is apparently
> right, and no error messages are generated.

Exit code 139 means that soffice.bin is crashing with SIGSEGV for some reason, likely during termination (as it already did the conversion fine).  We would need a backtrace of the crash to be able to tell more.
Comment 10 Ángel 2013-12-16 22:43:10 UTC
Owen, note that if you want also the value when libreoffice returns non-zero, you can't use &&, the right thing would be to use ";": soffice --headless --convert-to pdf file.odt ; echo $?
(but anyway, as you're seeing a 0 printed, it's not failing for you)

I wonder if it may be something in my system/configuration...

Stephan, you are right. The main program is not segfaulting (finishes «exit_group(139)») but looking in dmesg shows that soffice.bin indeed segfaulted (segfault at 48, error 4 in libsvllo.so)


It may be seen more easily by running /usr/lib/libreoffice/program/soffice.bin directly, good tip.

I don't know how good are these symbols (I don't think I have specific debug symbols, these are probably taken from the imports), but here's the backtrace given by gdb:

#0  0x00007ffff4e86ed0 in SvNumberFormatsSupplierObj::SetNumberFormatter(SvNumberFormatter*) () from /usr/lib/libreoffice/program/libsvllo.so
#1  0x00007fffddf1a1c8 in SwXTextDocument::InitNewDoc() () from /usr/lib/libreoffice/program/../program/libswlo.so
#2  0x00007fffddf2691d in SwXTextDocument::~SwXTextDocument() () from /usr/lib/libreoffice/program/../program/libswlo.so
#3  0x00007fffddf26c49 in SwXTextDocument::~SwXTextDocument() () from /usr/lib/libreoffice/program/../program/libswlo.so
#4  0x00007ffff759cde9 in __run_exit_handlers () from /usr/lib/libc.so.6
#5  0x00007ffff759ce35 in exit () from /usr/lib/libc.so.6
#6  0x00007ffff7586b0c in __libc_start_main () from /usr/lib/libc.so.6
Comment 11 Stephan Bergmann 2013-12-17 10:41:44 UTC
(In reply to comment #10)
> #0  0x00007ffff4e86ed0 in
> SvNumberFormatsSupplierObj::SetNumberFormatter(SvNumberFormatter*) () from
> /usr/lib/libreoffice/program/libsvllo.so
> #1  0x00007fffddf1a1c8 in SwXTextDocument::InitNewDoc() () from
> /usr/lib/libreoffice/program/../program/libswlo.so
> #2  0x00007fffddf2691d in SwXTextDocument::~SwXTextDocument() () from
> /usr/lib/libreoffice/program/../program/libswlo.so
> #3  0x00007fffddf26c49 in SwXTextDocument::~SwXTextDocument() () from
> /usr/lib/libreoffice/program/../program/libswlo.so
> #4  0x00007ffff759cde9 in __run_exit_handlers () from /usr/lib/libc.so.6
> #5  0x00007ffff759ce35 in exit () from /usr/lib/libc.so.6
> #6  0x00007ffff7586b0c in __libc_start_main () from /usr/lib/libc.so.6

That is <https://bugzilla.redhat.com/show_bug.cgi?id=1030009> "[abrt] SwXTextDocument in atexit: Process /usr/lib64/libreoffice/program/soffice.bin was killed by signal 11 (SIGSEGV)" that will be fixed in LO 4.1.4 (<http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-1-4&id=2d4d092090df57ba274e1c46fcc409a68cfe68ca> "rhbz#1030009 Remove global XModel ref").