Bug 56455 - : Missing or bogus DISPLAY leaves stale process
Summary: : Missing or bogus DISPLAY leaves stale process
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.0.2 rc
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-27 09:57 UTC by Sandro Santilli
Modified: 2020-09-22 14:01 UTC (History)
5 users (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 Sandro Santilli 2012-10-27 09:57:14 UTC
Problem description: 

Steps to reproduce:
1. DISPLAY= libreoffice anyfile.ods # you get an error
2. libreoffice anyfile.ods # no error, but nothing starts
3. ps xa | grep libreoffice # you find stale process

Current behavior:

A process remains alive even if attempt to open the display failed, and presence of such process prevents any subsequent invocations of the executables from starting.

Expected behavior:

Error is fatal, cleans up and exits.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0
Comment 1 bfoman (inactive) 2013-03-04 13:39:27 UTC
Is this still an issue in the latest stable release of LibreOffice and Ubuntu?
Comment 2 Sandro Santilli 2013-03-04 15:00:18 UTC
The behavior is slightly different with 3.6.0.2 in that running with no DISPLAY set doesn't return control to the console but rather keeps the process in foreground thus making it easier to kill it (^C).

Still, if you send the process to the background next invocation of libreoffice "hooks" on the pre-existing process and silently fails starting up anything.

I think the correct behavior should be to error out and return to console if DISPLAY can't be connected to.
Comment 3 bfoman (inactive) 2013-03-04 15:15:01 UTC
(In reply to comment #2)
> The behavior is slightly different with 3.6.0.2

Well, as LibreOffice 3.6.x is nearing its EndOfLife (last 3.6.6 version will be released Week 15, Apr 8 - Apr 14, 2013, with code freeze Week 12, Mar 18 - Mar 24, 2013), it would be best to check latest 4.0.x version or master build (even better).
Comment 4 QA Administrators 2013-09-24 02:01:12 UTC Comment hidden (obsolete)
Comment 5 Sandro Santilli 2013-09-24 07:47:27 UTC
I just tried again, this time with LibreOffice 4.0.3.3 and the behavior is very similar, except that the first invocation doesn't go in the background, after the error, but rather sits there waiting for you to put the process on the background or kill it.

If you put the process in the background the rest of the steps will keep silently failing.

I think the expected behavior is still to make the error fatal so that the process cleansup and exits, rather than sitting there forever. What do you think ?
Comment 6 Joel Madero 2013-11-16 03:33:52 UTC
Can you let me know why you would run libreoffice with Display= ?
Comment 7 Sandro Santilli 2013-11-19 15:02:51 UTC
No reason to run with DISPLAY unset, is just an accident. Can happen (re-attaching a screen session created outside X from into an X environment), and when it happens it makes you unable to recover other than killing the stale process.
Comment 8 Robinson Tryon (qubit) 2014-02-03 14:49:28 UTC
Remove comma from whiteboard
Comment 9 Robinson Tryon (qubit) 2014-02-03 15:13:06 UTC
CONFIRMED on Ubuntu 12.04.3 + LO 4.2.0.4 (and LO 3.5.7, to see if this is a regression)

(In reply to comment #7)
> No reason to run with DISPLAY unset, is just an accident. Can happen
> (re-attaching a screen session created outside X from into an X
> environment), and when it happens it makes you unable to recover other than
> killing the stale process.

There are situations in which one wants to run a headless instance of LibreOffice -- e.g. when using it as a daemon for document conversion -- but it seems unlikely that one would want to run LibreOffice without passing-in parameters to directly convert a document, '--headless', or some other parameter(s) for making remote connection possible.

cc'ing Thorsten on this one -- we'll talk about it later
Comment 10 Thorsten Behrens (allotropia) 2014-02-09 21:23:12 UTC
(In reply to comment #9)
> CONFIRMED on Ubuntu 12.04.3 + LO 4.2.0.4 (and LO 3.5.7, to see if this is a
> regression)
> 
Sorry, only getting back to this now - I *cannot* reproduce, neither with the distro-provided, nor with a self-built LibreOffice:

This is what happens here:

$ DISPLAY= libreoffice dummy.ods
Failed to open display
/usr/lib64/libreoffice/program/soffice.bin X11 error: Can't open display: 
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

, then LibO exits properly, no processes left hanging or something (4.1.4 and 4.2 alpha).
Comment 11 Sandro Santilli 2014-02-09 21:47:13 UTC
Confirmed again with LibreOffice 4.1.3.2 410m0(Build:2)
provided by distro Ubuntu 13.10
Comment 12 Joel Madero 2014-02-09 21:51:13 UTC
@Thorsten - what additional information might be helpful to move this along?
Comment 13 Thorsten Behrens (allotropia) 2014-02-09 22:22:06 UTC
(In reply to comment #12)
> @Thorsten - what additional information might be helpful to move this along?

Dunno - so this is confirmed to happen with even an upstream LibreOffice, on pretty much any Ubuntu? And this is in some terminal window (no screen, tmux, anything), and the 'libreoffice' command just sits there? Or is there some output meanwhile? Or does it cleanly exit (not even an error code)?
Comment 14 Sandro Santilli 2014-02-10 08:59:16 UTC
Just tried outside of screen(1), same problem.
So now straight from GNOME Terminal 3.6.1

The only output is:
 Failed to open display

Control not returned to prompt, libreoffice just sits there, stopped:
 5640 pts/17   Sl     0:00 /usr/lib/libreoffice/program/oosplash /var/lib/gems/1.9.1/gems/roo-1.12.1/test/files/whitespace.ods
 5660 pts/17   Sl     0:00 /usr/lib/libreoffice/program/soffice.bin /var/lib/gems/1.9.1/gems/roo-1.12.1/test/files/whitespace.ods
Comment 15 Thorsten Behrens (allotropia) 2014-02-10 09:13:17 UTC
(In reply to comment #14)
> Control not returned to prompt, libreoffice just sits there, stopped:
>  5640 pts/17   Sl     0:00 /usr/lib/libreoffice/program/oosplash
> /var/lib/gems/1.9.1/gems/roo-1.12.1/test/files/whitespace.ods
>  5660 pts/17   Sl     0:00 /usr/lib/libreoffice/program/soffice.bin
> /var/lib/gems/1.9.1/gems/roo-1.12.1/test/files/whitespace.ods
>
Thanks, that helps a bit to narrow it down:
 - ubuntu-built LibreOffice
 - possibly the splash screen hanging
Comment 16 Thorsten Behrens (allotropia) 2014-02-10 09:15:30 UTC
(In reply to comment #14)
> Just tried outside of screen(1), same problem.
>
Now for completeness, can you try an upstream version of LibreOffice (libreoffice.org/download)?
Comment 17 Sandro Santilli 2014-02-10 15:29:03 UTC
It took some time building, but here it goes:

[strk:/usr/src/libreoffice/core(master)] DISPLAY= instdir/program/soffice /var/lib/gems/1.9.1/gems/roo-1.12.1/test/files/whitespace.ods
Failed to open display
^C                 
[strk:/usr/src/libreoffice/core(master)] 

This is master branch ec3c9a5f7fd04327697d50505ac56fcfbb71ca45
Comment 18 QA Administrators 2015-09-04 02:47:48 UTC Comment hidden (obsolete)
Comment 19 Sandro Santilli 2015-09-04 08:54:14 UTC
Still confirmed as of version 4.2.8.2
Comment 20 Joel Madero 2015-09-05 22:40:51 UTC
4.2.8.2 is pretty old still. Can you try with 5.0?
Comment 21 Sandro Santilli 2015-09-07 08:13:00 UTC
Not easily. Can you?
It's pretty simple to reproduce
Comment 22 QA Administrators 2016-09-20 10:28:41 UTC Comment hidden (obsolete)
Comment 23 QA Administrators 2020-08-28 04:03:41 UTC Comment hidden (obsolete)
Comment 24 Timur 2020-09-22 14:01:27 UTC
Very old and reported when there were problems starting LO, now we shouldn't have these problems. I close.