XWin crash after the launch of startkde on a remote Red Hat 5 machine

2010-08-03 Thread Michel Hummel
Hello,
I'm using cygwin on Microsoft Windows XP with XWin version :
sh-3.2# XWin.exe -version
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.8.0.0 (1080)
Build Date: 2010-04-02
Contact: cygwin-xfree@cygwin.com

I think I have found a bug in the XWin reset procedure which leads to
the start of two clipboard thread's and sometime to a crash of the X
server.

The crash can be produced by lauching startkde on a Red Hat 5 remote
machine (The crash should arrive after some minutes of work)
but the bug can simply be produced like this :

On my installation if I launch Xwin with this options :
XWin :0 -ac
then I do
xsetroot -solid '#00'

After setting the color, Xwin launches its reset procedure because
there is no more client connected ( the server loses the color but it
is the normal comportment isn't it ?
http://sourceware.org/ml/cygwin-xfree/2002-01/msg00106.html)

The problem comes from the clipboard thread. In this example, when the
server launches its reset procedure, the clipboard is in state
Launched but is not in state Started (Boolean variable about
clipboard status, see file hw/xwin/winclipboardthread.c).

This particular status of the ClipboardThread during server reset is
normaly managed by two if statements :

* An if in the file hw/xwin/InitOutput.c disables the exit of the
clipboard thread in this state
Extract of the file hw/xwin/InitOutput.c (with line number) :

 169 winClipboardShutdown (void)
 170 {
 171   /* Close down clipboard resources */
 172   if (g_fClipboard  g_fClipboardLaunched  g_fClipboardStarted)
 173     {
 174       /* Synchronously destroy the clipboard window */
 175       if (g_hwndClipboard != NULL)
 176         {
 177           SendMessage (g_hwndClipboard, WM_DESTROY, 0, 0);
 178           /* NOTE: g_hwndClipboard is set to NULL in
winclipboardthread.c */
 179         }
 180       else
 181         return;
 182
 183       /* Wait for the clipboard thread to exit */
 184       pthread_join (g_ptClipboardProc, NULL);
 185
 186       g_fClipboardLaunched = FALSE;
 187       g_fClipboardStarted = FALSE;
 188
 189       winDebug (winClipboardShutdown - Clipboard thread has exited.\n);
 190     }
 191 }

* An if statement in the file hw/xwin/winclipboardwrappers.c
prohibits the launch of clipboard thread if one is already Launched.
Extract of the file hw/xwin/winclipboardwrappers.c (with line number)
256   /* If the clipboard client has already been started, abort */
257   if (g_fClipboardLaunched)
258     {
259       ErrorF (winProcEstablishConnection - Clipboard client already 
260               launched, returning.\n);
261       return iReturn;
262     }


The problem is that the Boolean variables g_fClipboardLaunched and
g_fClipboardStarted are re-initialized by the server reset procedure
(function winInitializeGlobals of the file  hw/xwin/winglobals.c)
Extract of the file hw/xwin/winglobals.c (with line number)
128 /*
129  * Re-initialize global variables that are invalidated 130  * by a
server reset.
131  */
132
133 void
134 winInitializeGlobals (void)
135 {
136   g_dwCurrentThreadID = GetCurrentThreadId ();
137   g_hwndKeyboardFocus = NULL;
138 #ifdef XWIN_CLIPBOARD
139   g_fClipboardLaunched = FALSE;
140   g_fClipboardStarted = FALSE;
141   g_iClipboardWindow = None;
142   g_pClipboardDisplay = NULL;
143   g_atomLastOwnedSelection = None;
144   g_hwndClipboard = NULL;
145 #endif
146 }

The consequence of this Re-initialization in this particular situation
is that the clipboard thread is launched two times and sometimes leads
to a crash of the X server.
You can see the double launch of the clipboard thread at the end of
the attached log file Xwin.0.log ( 2 times the sentence :
winClipboardProc - XOpenDisplay () returned and successfully opened
the display. )

To fix this bug I purpose to remove the variables g_fClipboardLaunched
and g_fClipboardStarted of the winInitializeGlobals (void) function,
as their re-initializations are handled in in the files :
hw/xwin/InitOutput.c.

That what is doing the patch Attached to this email.

Regards,
Michel Hummel


XWin_winglobals_ClipboardThread.patch
Description: Binary data


XWin.0.log
Description: Binary data
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/

Re: Missing charsets in String to FontSet conversion

2010-08-03 Thread Thomas Dickey

On Tue, 3 Aug 2010, Ryan Johnson wrote:


Hi all,

At some point an annoyance appeared with my xterm windows: The first time I 
use [ctrl]+mouse click in any window, that xterm becomes unresponsive for 
about 5 seconds with the CPU pegged to 100%. After the five seconds is up, 
whatever shell spawned the xterm receives the following message:

Warning: Missing charsets in String to FontSet conversion


After that all works normally (until I open the next xterm window).

Is there a way to diagnose what the problem is? I don't know what FontSet 
string the error even refers to, let alone which parts of that string were 
invalid. In any case, it really shouldn't take five seconds of hard CPU 
crunching to detect and report an invalid input string.


This topic came up last year, iirc the issue was this:

http://invisible-island.net/xterm/xterm.faq.html#slow_menus

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Fwd: Bootstrapping Emacs (trunk) with GCC = 4.5.1 [Cygwin]

2010-08-03 Thread Angelo Graziosi

 Messaggio originale 
Oggetto: Bootstrapping Emacs (trunk) with GCC = 4.5.1 [Cygwin]
Data: Tue, 03 Aug 2010 13:50:09 +0200
Mittente: Angelo Graziosi
A: Emacs emacs-devel AT gnu DOT org

On Cygwin, I have tried to bootstrap Emacs-trunk using gcc-4.5.1 (just
released) and gcc-4.6-20100731 (snapshot), but the build fails as follows:

===
[...]
gcc-4.6 -c  -Demacs -DHAVE_CONFIG_H  -I. -I/tmp/emacs/src   -D_REENTRANT
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12
-I/usr/include/freetype2 -D_REENTRANT -I/usr/include/librsvg-2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/gtk-2.0 -I/usr/include/cairo -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DORBIT2=1
-D_REENTRANT -I/usr/include/gconf/2 -I/usr/include/orbit-2.0
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -MMD -MF
deps/xfns.d  -Wold-style-definition -Wdeclaration-after-statement
-Wno-pointer-sign  -g -O2 /tmp/emacs/src/xfns.c
In file included from /usr/include/X11/Xos.h:146:0,
 from /tmp/emacs/src/xfaces.c:277:
/usr/include/X11/Xarch.h:43:30: fatal error: sys/byteorder.h: No such
file or directory
compilation terminated.
make[2]: *** [xfaces.o] Error 1
make[2]: *** Waiting for unfinished jobs
make[2]: Leaving directory `/tmp/emacs/Work/src'
make[1]: *** [src] Error 2
make[1]: Leaving directory `/tmp/emacs/Work'
make: *** [bootstrap] Error 2
===

The culprit are these statements in '/usr/include/X11/Xarch.h':

[...]
#  if defined(SVR4) || defined(__SVR4)
#   include sys/byteorder.h
#  elif [...]

On Cygwin, it seems that the

if defined(SVR4)...

branch is executed and the header 'byteorder.h' is not found because it
lives in /usr/include/asm not in /usr/include/sys!

Now I have tried the same on GNU/Linux Kubuntu 10.04, on which that
header, 'byteorder.h', lives in the same /usr/include/asm directory as
on Cygwin, but the bootstrap passes, almost surely because the 'elif'
branch is executed!

So, on Cygwin, I adopted the workaround to create a symbolic link:

cd /usr/include/sys
ln -sf ../asm/byteorder.h byteorder.h

Now the bootstrap (with GCC = 4.5.1) passes also on Cygwin, and works.

Have you better ideas on this issue?

Thanks,
Angelo.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Missing charsets in String to FontSet conversion

2010-08-03 Thread Jon TURNEY

On 03/08/2010 10:00, Thomas Dickey wrote:

On Tue, 3 Aug 2010, Ryan Johnson wrote:

At some point an annoyance appeared with my xterm windows: The first time I
use [ctrl]+mouse click in any window, that xterm becomes unresponsive for
about 5 seconds with the CPU pegged to 100%. After the five seconds is up,
whatever shell spawned the xterm receives the following message:

Warning: Missing charsets in String to FontSet conversion


After that all works normally (until I open the next xterm window).

Is there a way to diagnose what the problem is? I don't know what FontSet
string the error even refers to, let alone which parts of that string were
invalid. In any case, it really shouldn't take five seconds of hard CPU
crunching to detect and report an invalid input string.


There's some more discussion at
http://sourceware.org/bugzilla/show_bug.cgi?id=10948

Installing the fonts font-isas-misc, font-jis-misc and font-daewoo-misc should 
also work around the problem, which can also be seen with other applications, 
as that ensures that at least one font exists for every charset.


I agree that the error message sucks and should tell you the charsets which 
are missing and what string it was attempting to convert.



This topic came up last year, iirc the issue was this:

http://invisible-island.net/xterm/xterm.faq.html#slow_menus


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Missing charsets in String to FontSet conversion

2010-08-03 Thread Andy Koppe
On 3 August 2010 14:35, Jon TURNEY wrote:
 On 03/08/2010 10:00, Thomas Dickey wrote:

 On Tue, 3 Aug 2010, Ryan Johnson wrote:

 At some point an annoyance appeared with my xterm windows: The first time
 I
 use [ctrl]+mouse click in any window, that xterm becomes unresponsive for
 about 5 seconds with the CPU pegged to 100%. After the five seconds is
 up,
 whatever shell spawned the xterm receives the following message:

 Warning: Missing charsets in String to FontSet conversion

 After that all works normally (until I open the next xterm window).

 Is there a way to diagnose what the problem is? I don't know what FontSet
 string the error even refers to, let alone which parts of that string
 were
 invalid. In any case, it really shouldn't take five seconds of hard CPU
 crunching to detect and report an invalid input string.

 There's some more discussion at
 http://sourceware.org/bugzilla/show_bug.cgi?id=10948

 Installing the fonts font-isas-misc, font-jis-misc and font-daewoo-misc
 should also work around the problem, which can also be seen with other
 applications, as that ensures that at least one font exists for every
 charset.

 I agree that the error message sucks and should tell you the charsets which
 are missing and what string it was attempting to convert.

 This topic came up last year, iirc the issue was this:

 http://invisible-island.net/xterm/xterm.faq.html#slow_menus

Could the menuLocale resource setting mentioned there be added to
Cygwin xterm's default config at /etc/X11/app-defaults/XTerm?

Andy

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Missing charsets in String to FontSet conversion

2010-08-03 Thread Ryan Johnson

 On 8/3/2010 3:35 PM, Jon TURNEY wrote:

On 03/08/2010 10:00, Thomas Dickey wrote:

On Tue, 3 Aug 2010, Ryan Johnson wrote:
At some point an annoyance appeared with my xterm windows: The first 
time I
use [ctrl]+mouse click in any window, that xterm becomes 
unresponsive for
about 5 seconds with the CPU pegged to 100%. After the five seconds 
is up,

whatever shell spawned the xterm receives the following message:

Warning: Missing charsets in String to FontSet conversion


After that all works normally (until I open the next xterm window).

Is there a way to diagnose what the problem is? I don't know what 
FontSet
string the error even refers to, let alone which parts of that 
string were

invalid. In any case, it really shouldn't take five seconds of hard CPU
crunching to detect and report an invalid input string.


There's some more discussion at
http://sourceware.org/bugzilla/show_bug.cgi?id=10948

Installing the fonts font-isas-misc, font-jis-misc and 
font-daewoo-misc should also work around the problem, which can also 
be seen with other applications, as that ensures that at least one 
font exists for every charset.


I agree that the error message sucks and should tell you the charsets 
which are missing and what string it was attempting to convert.



This topic came up last year, iirc the issue was this:

http://invisible-island.net/xterm/xterm.faq.html#slow_menus
The xterm FAQ's workaround (setting LANG=C) indeed works, but then I 
lose all of UTF-8, including some of the punctuation marks man pages and 
gcc errors like to use.


As I mentioned before, I'd seen references to those fonts but wasn't 
sure it would actually help me. I just installed them and, sure enough, 
there's still some (fewer?) missing charsets.


The delay dropped to only 2-3 seconds now though, so I guess that helps. 
Is there a way to diagnose which fonts/charsets are still missing?


Regards,
Ryan


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Can't Paste into Xwindow application from Winows7

2010-08-03 Thread Jon TURNEY

On 02/08/2010 20:50, Scott Bushnell wrote:

I running Windows 7  the latest version of Cygwin/X. I can paste from
my X windows application to any Windows application but can't paste to
X windows from Windows7.

It works fine using Windows XP.

P.S. How can I debug/troubleshoot this.


[1] suggests some steps which you might take.

You should also mention if you are using a Windows 'clipboard manager' 
application.


[1] http://sourceware.org/ml/cygwin-xfree/2009-10/msg00129.html

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Re: Slow response to keypresses in xorg-server-1.8.0-1

2010-08-03 Thread Ryan Johnson

 On 8:59 PM, Jon TURNEY wrote:
I've cooked up a small additional change which should prevent this 
blocking behaviour and uploaded a build [2]. It seems to resolve the 
problem in this specific case. Perhaps you could try it out and see if 
it helps?


[1] http://cygwin.com/ml/cygwin-xfree/2010-02/msg00124.html
[2] 
ftp://cygwin.com/pub/cygwinx/XWin.20100630-git-bc2f74e105146c36.exe.bz2


I just downloaded this version, and it indeed fixes the slow [alt]-[tab] 
behavior, but I'm still having one problem: the invisible xterm root 
window covers my windows taskbar until I've moused over it for several 
seconds (or alt-tab somewhere else first).


Ideas?
Ryan


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Missing charsets in String to FontSet conversion

2010-08-03 Thread Thomas Dickey

On Tue, 3 Aug 2010, Andy Koppe wrote:


On 3 August 2010 14:35, Jon TURNEY wrote:

On 03/08/2010 10:00, Thomas Dickey wrote:

This topic came up last year, iirc the issue was this:

http://invisible-island.net/xterm/xterm.faq.html#slow_menus


Could the menuLocale resource setting mentioned there be added to
Cygwin xterm's default config at /etc/X11/app-defaults/XTerm?


fwiw, I made it default in #257 (current is #261)

http://invisible-island.net/xterm/xterm.log.html#xterm_257

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/