Bug 76742 - Startup failure: XDM authorization key matches an existing client
Summary: Startup failure: XDM authorization key matches an existing client
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: possibleRegression
Depends on:
Blocks:
 
Reported: 2014-03-28 15:25 UTC by lj618
Modified: 2016-09-19 16:47 UTC (History)
2 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 lj618 2014-03-28 15:25:09 UTC
LibreOffice-4.2.2 frequently but intermittently fails to start on Slackware Linux with the following error:

    XDM authorization key matches an existing client!
    /opt/libreoffice4.2/program/soffice.bin X11 error: Can't open display:

The startup failure happens about 65% of the time; the other 35% of the time it starts and runs correctly. The problem did not occur with LibreOffice-4.1.4 on the same system.

This happens when using XDM as the login manager, and only when XDM-AUTHORIZATION-1 authentication is enabled (as it is by default with xdm).  I can disable XDM-AUTHORIZATION-1 and enable only MIT-MAGIC-COOKIE-1 by placing the following into /etc/X11/xdm/xdm-config:
    DisplayManager*authName: MIT-MAGIC-COOKIE-1

Then the problem goes away, and LibreOffice-4.2.2 always starts correctly.

Possibly the same exact issue was reported with Firefox, about 10 years ago, as documented here: https://bugzilla.mozilla.org/show_bug.cgi?id=246313

My understanding is that the problem is caused by a race condition between child and parent processes opening a connection to the X server (hence the intermittent nature), and/or the weakness in XDM-AUTHORIZATION-1 generation of unique tokens.
Comment 1 Yury 2014-11-04 09:01:59 UTC
I confirm this for 4.2.6-secfix_Linux_x86-64 (August 30, 2014) and 4.3.3_Linux_x86-64 (November 4, 2014) AND XDM+WindowMaker (built from October git commits).

4.2.6 worked before without fails (so it stopped working recently), 4.3.3 was just installed.
Comment 2 Yury 2014-11-04 09:03:32 UTC
...3.6.7.2 for x86_64 works as usual.
Comment 3 Robinson Tryon (qubit) 2014-11-13 04:56:20 UTC
Interesting bug. I'll check w/the devs for further input.

Whiteboard: needAdvice
Comment 4 Robinson Tryon (qubit) 2014-11-13 16:03:19 UTC
(In reply to Yury from comment #1)
> I confirm this for 4.2.6-secfix_Linux_x86-64 (August 30, 2014) and
> 4.3.3_Linux_x86-64 (November 4, 2014) AND XDM+WindowMaker (built from
> October git commits).
> 
> 4.2.6 worked before without fails (so it stopped working recently), 4.3.3
> was just installed.

(In reply to Yury from comment #2)
> ...3.6.7.2 for x86_64 works as usual.

Well if 3.6 is still working, that sounds like it could be a regression.

Yury: How consistently can you cause this failure? Perhaps we can track-down which specific commit is the culprit here. Have you ever used the bibisect tool?
(https://wiki.documentfoundation.org/Bibisect)
Comment 5 lj618 2014-11-13 22:29:00 UTC
Bug author follow-up. Now using Libreoffice-4.3.2, and it fails about 75% of the time if I let XDM do XDM-AUTHORIZATION-1.

By comparing strace logs, I can see the failure occurs when a single thread (which I think runs "soffice.bin --splash-pipe=5") opens 2 connections to the X server within 1 second (specifically, when time(NULL) returns the same value both times.) With the same PID and timestamp, it gets the same XDM-AUTHORIZATION-1 key, and the X server rejects the second one. When the two connection tries have time() values 1 second apart, it works.  Therefore it should fail more often on a faster system.

I have no idea if this will help anyone.

By the way, if I disable the Libreoffice splash screen, it still fails.
Comment 6 QA Administrators 2015-06-08 14:28:25 UTC Comment hidden (obsolete)
Comment 7 lj618 2015-06-08 18:37:07 UTC
Changing status from NEEDINFO back to UNCONFIRMED in response to automated 
email (see comment #6 above). I don't know who moved it to NEEDINFO or why
since nobody seems to be asking me for INFO.
Comment 8 Robinson Tryon (qubit) 2015-06-08 18:52:31 UTC
(In reply to lb2048 from comment #7)
>

Looks like the last test you reported was back in November. Are you still seeing the same XDM error with our latest builds?

Status -> NEEDINFO

(For the very latest, see daily builds of master and our upcoming 5.0 here:
http://dev-builds.libreoffice.org/daily/master/
http://dev-builds.libreoffice.org/daily/libreoffice-5-0/
)

Yury: Are you still seeing the same bug as well?
Comment 9 lj618 2015-06-08 22:19:58 UTC
I can confirm that the problem exists in libreoffice-4.3.7 (current "still" release) and does not occur with libreoffice-4.4.3 (current "fresh" release). That is, I can easily duplicate the problem (if I re-enable XDM-AUTHORIZATION-1) with 4.3.7, and am unable to duplicate it at all with 4.4.3. So as far as I am concerned this is resolved.

Do you want me to change the bug report to resolved, or are you waiting to hear from Yuri as well?
Comment 10 lj618 2015-06-11 00:23:28 UTC
Changing to Resolved - Fixed because this seems to have been fixed in 4.4.x
Comment 11 Buovjaga 2015-06-23 12:52:30 UTC
Let's change to WFM as we don't know the exact fix.
Comment 12 Robinson Tryon (qubit) 2015-12-15 22:11:25 UTC Comment hidden (obsolete)
Comment 13 Xisco Faulí 2016-09-19 16:47:51 UTC Comment hidden (obsolete)