This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Recent X installation oddity


On 16 Jul, To: cygwin-xfree@cygwin.com wrote:
>  Two more installs today, with the same problem. 

On one machine, X just blocked if you started it with the -multiwindow
option.  The X logo appeared in the taskbar, but you couldn't even
right-click on that to bring up the menu, or kill the blocked X if you
started it from the command line via CTRL-C (had to use Task Manager).
Except that you *could* kill it if you ran it under strace, which I'll
show you the last 25 lines of the > 3000 lines of output that that
produced, in case it's of interest.  (That's at the end.)

Fortunately, -rootless seems to work well again now.

Below is my byzantine workaround that we're starting to use locally to
fix up the install.

luke

----- fixup-X -------------
#!/bin/sh
#
# As of about June 2004, every Cygwin installation installs a broken
# version of X.
#
# Workaround is as per the FAQ:
# http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof
# This is an attempt to automate the workaround as far as possible.
#
# Author: Luke Kendall
#

DONE_PROOF=/etc/profile.d/.X-fixed	# Same as in try-X
MYNAME=`basename $0`
XFONTDIR=/usr/X11R6/lib/X11/fonts

if [ -s $DONE_PROOF ]
then
    echo "$MYNAME: $DONE_PROOF indicates X11 has already been fixed."
    if yorn "do you really want to do it again"
    then
	:
    else
	exit 0
    fi
fi


if [ ! -d $XFONTDIR ]
then
    echo "Strange but kind of good: as expected, $XFONTDIR did not exist"
else
    echo "Hmm, $XFONTDIR exists.  So much for that theory."
    if [ ! -d $XFONTDIR/misc ]
    then
	echo "Not unexpected, $XFONTDIR/misc did not exist"
    else
	echo "Hmm, $XFONTDIR/misc exists too.  So much for that theory."
	NUM=`ls $XFONTDIR/misc | wc -l`
	if [ $NUM -le 100 ]
	then
	    echo "As expected, $XFONTDIR/misc had few fonts ($NUM, actually)"
	else
	    echo "Hmm, $XFONTDIR/misc had plenty of fonts ($NUM, actually)"
	fi
    fi
fi
echo "Checking for $XFONTDIR mount point..."
if mount | grep "$XFONTDIR"
then
    echo "Unmounting $XFONTDIR in preparation for fix"
    umount $XFONTDIR
else
    echo "Hmm, pretty strange, $XFONTDIR wasn't mounted on C:/cygwin$XFONTDIR"
fi

echo "Now re-running setup: you will need to choose RE-INSTALL for each"
echo "of the X11 font sets (about 4 sets) under the X11 category."

//samba/install/win32/cygwin/setup.exe

echo "******************************************************************"
echo "Let's try starting X to see if it now works.  If you have to"
echo "kill any of these attempts, you can continue from where you left off"
echo "by using the try-X script."
echo "******************************************************************"

try-X


----------- try-X --------------------
#!/bin/sh
#
# Try to run X in different ways.  If you find a way that works, exit with
# success.
# If X blocks so badly you have to kill the calling script, this is written
# so that next time you run it, it will skip the methods it's tried and
# proceed to the next attempt.
#
# Author: Luke Kendall
#

DONE_PROOF=/etc/profile.d/.X-fixed	# Same as in fixup-X
MYNAME=`basename $0`
PATH="/usr/X11R6/bin:$PATH"
STAGE=/tmp.$USER

for TRY in 			\
    startx			\
    "startx -- -multiwindow :0"	\
    "startx -- -clipboard :0"	\
    /startx.bat			\
    startxwin.sh		\
    "xinit -- -kb -clipboard"	\
    "X :0 -multiwindow"
do
    if [ -s "$STAGE.$TRY.bad" ]
    then
	echo "Skipping $TRY - must have failed badly last time"
	continue
    elif [ -s "$STAGE.$TRY" ]
    then
	echo "Skipping $TRY - already tried"
	continue
    else
	date > "$STAGE.$TRY.bad"
    fi

    echo "Now attempting to start X via $TRY ..."
    $TRY
    mv "$STAGE.$TRY.bad" "$STAGE.$TRY"

    if yorn "Did that run X correctly"
    then
	echo "Noting that the problem has now been fixed"
	date >> $DONE_PROOF
	head -5 /tmp/XWin.log >> $DONE_PROOF
	echo >> $DONE_PROOF

	echo "That method ($TRY) would be good"
	echo " for you to put into /startx.bat"

	exit 0
    fi
done

exit 1

---------------- strace output -------------------
  216 35608223 [main] Xwin 3132 open: 6 = open (/usr/X11R6/lib/X11/locale/locale.alias, 0x0)
    4 35608227 [unknown (0x84C)] Xwin 3132 fhandler_base::write: 1 = write (0x100F390B, 1)
  122 35608349 [main] Xwin 3132 _cygwin_istext_for_stdio: fd 6: defaulting to text
28189 35636538 [unknown (0x84C)] Xwin 3132 writev: 1 = write (3, 0x17AEBD0, 1),errno 0
  258 35636796 [unknown (0x84C)] Xwin 3132 fhandler_base::set_flags: flags 0x120601, supplied_bin 0x0
  112 35636908 [unknown (0x84C)] Xwin 3132 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x20000
  115 35637023 [unknown (0x84C)] Xwin 3132 fhandler_base::set_flags: filemode set to text
  116 35637139 [unknown (0x84C)] Xwin 3132 _cygwin_istext_for_stdio: fd 3: defaulting to text
    1 35637140 [main] Xwin 3132 fhandler_base::fstat_by_handle: 1 = GetFileInformationByHandle (C:\cygwin\usr\X11R6\lib\X11\locale\locale.alias, 1348)
  118 35637258 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 0 !=3
  152 35637410 [main] Xwin 3132 get_file_attribute: file: C:\cygwin\usr\X11R6\lib\X11\locale\locale.alias
  126 35637536 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 1 !=3
  237 35637773 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 2 !=3
  129 35637902 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 0 !=3
  147 35638049 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 1 !=3
    4 35638053 [main] Xwin 3132 cygpsid::debug_print: get_sids_info: owner SID =S-1-5-21-5706737-76180391-208020174-2148
  113 35638166 [unknown (0x84C)] Xwin 3132 setmode_helper: improbable, but 2 !=3
  119 35638285 [main] Xwin 3132 cygpsid::debug_print: get_sids_info: group SID =S-1-5-32-545
  122 35638407 [unknown (0x84C)] Xwin 3132 setmode_helper: file was binary now text
  244 35638651 [main] Xwin 3132 get_info_from_sd: ACL = 1E8, uid 12148, gid -1143 35638794 [main] Xwin 3132 fhandler_base::fstat_helper: 0 = fstat (, 0x22E9
A0) st_atime=40F77AFA st_size=57376, st_mode=0x81E8, st_ino=114071, sizeof=96134 35638928 [main] Xwin 3132 fstat64: 0 = fstat (6, 0x22E9A0)
  147 35639075 [main] Xwin 3132 fhandler_base::set_flags: flags 0x110000, supplied_bin 0x0
  112 35639187 [main] Xwin 3132 fhandler_base::set_flags: O_TEXT/O_BINARY set inflags 0x10000
  116 35639303 [main] Xwin 3132 fhandler_base::set_flags: filemode set to binary
  131 35639434 [main] Xwin 3132 _cygwin_istext_for_stdio: fd 6: opened as binary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]