Apache OpenOffice (AOO) Bugzilla – Issue 90483
OOffice Mac/X11 cannot be started in nonstandard environment (pre-Leopard)
Last modified: 2010-03-27 21:36:27 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.
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 ***
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.
Do you have a fix for the problem? I don't have Tiger to test.
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.
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.
adding pl to cc
obsolete/worksforme OOo now is aqua-native and doesn't require to launch X11 anymore.
closing.