Issue 90483 - OOffice Mac/X11 cannot be started in nonstandard environment (pre-Leopard)
Summary: OOffice Mac/X11 cannot be started in nonstandard environment (pre-Leopard)
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 2.4.0
Hardware: Mac Mac OS X, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: shaunmcdonald131
QA Contact: issues@framework
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2008-06-08 01:40 UTC by moriborg
Modified: 2010-03-27 21:36 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moriborg 2008-06-08 01:40:10 UTC
The "main.scpt" AppleScript that is used to launch the OOffice binary on Mac OS X has a reliability issue 
with determining the current DISPLAY. On line 238, the following code is used to get the display number 
from output of ps:

set xdisplay to do shell script "ps -wx -o command | grep X11.app | grep \":.$\" | sed \"s/^.*:/:/g\""

This works in principle, but only if the relevant line returned by ps is shorter than 133 characters. 
Otherwise, it is truncated, and the DISPLAY is not recovered (above command returns an empty string). 
This only happens if the X11 application is located in some nonstandard path that is very long, or if the 
same is the case for the .Xauthority file. For example, if $HOME is not /Users/user/, but somewhere else.

The problem is aggravated by the fact that the AppleScript has no error handling whatsoever for the case 
that the command cited above returns an empty string. The symptom of the problem is that OpenOffice.org 2.4.app just seems to hang, nothing happens. OpenOffice is indeed started in the 
background, but it doesn't appear because there is no correct DISPLAY set.

The fix to this problem is to replace all calls to `ps -w` by `ps -ww`, especially the one on line 238.

Also, some more robust error handling would probably be appropriate.
Comment 1 shaunmcdonald131 2008-06-08 15:25:26 UTC
Due to a change in the way that X11 is launched in Leopard there is a workaround mentioned in issue 87538 and http://shaunmcdonald131.blogspot.com/2008/03/ooo-possible-fix-for-command-timed-
out.html

*** This issue has been marked as a duplicate of 87538 ***
Comment 2 moriborg 2008-06-08 16:26:22 UTC
I don't think this is a duplicate of 87538. The issues are completely orthogonal. On Systems before 
Leopard, Shaun is still calling startXServer(), which is broken in the way described. I observed the issue on 
a Tiger system.
Comment 3 shaunmcdonald131 2008-06-08 17:20:42 UTC
Do you have a fix for the problem?

I don't have Tiger to test.
Comment 4 moriborg 2008-06-08 18:41:18 UTC
Yes, it's mentioned in the original report: Whenever `ps` is called with `-w`, give it `-ww` instead. See 
`man ps` for details. I thought this fix is so trivial that I didn't submit a formal patch. The fix should be 
safe, I don't see potential side effects.

Comment 5 shaunmcdonald131 2008-06-08 18:47:16 UTC
reassigning. Will do it at the same time as issue 87538, when the CWS for it is opened. Thus the change 
would get into 2.4.1, the last release that this will be relevant due to Aqua coming for 3.0.
Comment 6 shaunmcdonald131 2008-06-08 18:48:33 UTC
adding pl to cc
Comment 7 lohmaier 2010-03-27 21:36:00 UTC
obsolete/worksforme 

OOo now is aqua-native and doesn't require to launch X11 anymore.
Comment 8 lohmaier 2010-03-27 21:36:27 UTC
closing.