How to detect file format errors when running headless. Just hangs. [closed]

asked 2016-12-02 12:02:03 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I am using libreoffice in headless mode to load an RTF file and apply a macro to it. If the RTF file is corrupt then the command just hangs forever with no output. Starting in non-headless mode shows me the error "File format error found at 101,10461(row,col)".

I've tried using the --backtrace switch and installing the gdb file but the resulting log doesn't tell me anything about the file format error. Plus the libreoffice-gdb package is 600MB. A huge price to pay for a simple error message!

The only solution I currently have is to time out the process and then kill it. This is not a good solution since some valid RTF files I have in some languages take a long time to parse anyway. So I would have to wait a very long time to establish that the reason it is hanging is some unknown error.

Is there any way to detect file format errors when in headless mode?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-09-16 10:12:52.234530