When starting libreoffice from cli, a debug flag error is thrown

This is my problem. I try to start libreoffice from the Application menu, and on the taskbar at the bottom, it shows that libreoffice is starting.

But it never starts.

I then go to the terminal and type "libreoffice --writer" in it to open Writer.

This is what I get-

I've updated, reinstalled and uninstalled libreoffice multiple times and nada.

What is going on?!

BTW I am on ubuntu mate 16.04 LTS.

Meanwhile, I am using Libreoffice on Wine so I can work, even if it is with a Win 95 GUI

I have setup fetching the latest updates for LibreOffice in the SoftwareBoutique, currently running 5.2.3.2 on Ubuntu 16.04 and I cannot reproduce the issue.

The startup script of libreoffice does however respond to certain environmental variables and sets command line parameters based on those automatically. So it is possible there are some variables set e.g. in your .bashrc that cause mutually exclusive options for libreoffice to be selected (e.g. both RR and VALGRIND set causing --record and --valgrind to be appended to the options).

1 Like

Hi @gotlougit, @maximuscore is onto something. The error is created in /usr/lib/libreoffice/program/soffice script.

When manually attempting to get your error, it was apparent valgrind wasn’t installed by default so I installed it. That by itself doesn’t cause it but this does:

~$ libreoffice --writer --backtrace --strace
Error: The debug options --record, --backtrace, --strace, and --valgrind cannot be used together.
       Please, use them one by one.

But --backtrace and --strace by themselves does not. So something in your environment is adding BOTH of them and valgrind needs to be installed to get that error.

Just trying to get you in a direction. I see valgrind is a dependency of a lot of packages that could be causing this bug.

Hi guys. Thanks for the support.

Like @Bill_MI said, an alias may be causing libreoffice to display the error message. But, here's the thing. I checked to see how libreoffice is started from the Applications menu by editing the menu. The launcher/home screen is started with this command-

libreoffice %U

I wrote this command in bash and got the same error message-

To make sure that it wasn't stupid bash aliases messing everything up, I installed fish (something I wanted to try out for a long time, anyway)- for the first time on this machine, so there aren't any residual files remaining from the old install - and ran the same command.

It didn't work.

So, this is what we know-

  1. It's not the shell that is adding --backtrace and --strace together.
    So @maximuscore was wrong, unfortunately.

But I don't understand what is causing the error. So, I navigated to the /usr/lib/libreoffice/program/soffice and had a look at the script-

I think the "try to get some debug output" section is a little suspicious. But since I am not very experienced with UNIX shells and scripting, can someone tell me what is happening?

NOTE- I have NOT edited this script in any way. This is the soffice script in all its vanilla glory.

If you need the entire script, I'll be more than happy to post it.

If you start fish from within a bash session, all the variables are carried over.
Try this instead to get a clean fish session: su -l YOUR_USERNAME -s /usr/bin/fish .

Nope, @maximuscore, it did not work!

Can you maybe check (and post) the output of env from the shell just to see if any variables are set that could cause this?

It is still possible that those are set in a way that applies to every shell but not to the desktop.

How about it being some configuration file that loads up with those commands??

env in fish and bash-

Hmm… nothing suspicious in the variables. I’m running out of ideas a bit, sadly.

Don’t be sad. I can still use Libreoffice through Wine, but it would’ve been nice to use it natively and brag to my friends about #LinuxMasterRace :slight_smile:

Edit:

I am not giving up, though. Maybe it was a bug, and the next time I update my system the problem can be fixed.
Just maybe…

Did you explicitly install valgrind?

I was going to suggest uninstalling valgrind or just starting the process and see what depends on it that also wants to be removed. My intent is, you may then be looking at the package that is incompatible with LibreOffice and/or setup the environment causing this bug.

Or… if valgrind is not installed, it left behind something to trigger the soffice script and the package needs to be purged of config files.

No, when I ran sudo apt install valgrind, it gives me the option of installing it, not saying it is already installed so 0 packages installed.....

Ah! Try purge instead of install. The script must think valgrind is installed but remnants need to be removed.

:frowning:

Btw. if I install valgrind the problem does not happen - libreoffice still starts up normally from the shell.

What’s this say?
env | grep -i valgrind

I think that’s all it needs. Or am I behind your fish environment testing?