public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Crashing after two or three server resets
@ 2004-01-11  3:12 Harold L Hunt II
  2004-01-11 14:29 ` Takuma Murakami
  0 siblings, 1 reply; 8+ messages in thread
From: Harold L Hunt II @ 2004-01-11  3:12 UTC (permalink / raw)
  To: cygx; +Cc: xorg

Upon looking into this problem, I have found the following:

1) The crashes after a few resets in XFree86-xserv-4.3.0-35 are due to 
double-freeing of timers in the xc/programs/Xserver/os/ code.  A fix for 
this was added to the XFree86 tree back in October, shortly after the 
changes to WaitForSomething that changed the order of timeout processing 
and input event processing.  This fix is already in our xorg tree, so...

2) I tried the server from xorg and it crashes in a different place:

Program received signal SIGSEGV, Segmentation fault.
0x61093af5 in strtosigno () from /usr/bin/cygwin1.dll
(gdb) bt
#0  0x61093af5 in strtosigno () from /usr/bin/cygwin1.dll
#1  0x6103eb65 in free () from /usr/bin/cygwin1.dll
#2  0x006f6038 in FontFileFreeEntry ()
#3  0x006f6075 in FontFileFreeTable ()
#4  0x006f6222 in FontFileFreeDir ()
#5  0x006ec6cf in FontFileFreeFPE ()
#6  0x00412096 in FreeFPE ()
#7  0x00414548 in FreeFontPath ()
#8  0x00414e2d in FreeFonts ()
#9  0x0040187d in main ()
(gdb)


So, it seems that there is still a double-free problem in dix/fonts.c. 
Ugh... this ought to be fun to fix :)  I might look into this more, but 
I can't promise anything (particularly since no Cygwin/X users are 
complaining about crashes on resets).

Harold


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11  3:12 Crashing after two or three server resets Harold L Hunt II
@ 2004-01-11 14:29 ` Takuma Murakami
  2004-01-11 17:17   ` Alexander Gottwald
  2004-01-11 20:21   ` Harold L Hunt II
  0 siblings, 2 replies; 8+ messages in thread
From: Takuma Murakami @ 2004-01-11 14:29 UTC (permalink / raw)
  To: cygwin-xfree

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

The crash in fontdir.c have been there for a while.  At least
most of xserv-2x releases have it.  I challenged the problem
several times but I could neither fix, nor unveil how to
reproduce it.  I think it occurred on the first reset as well
as plural resets.  But it's not certain because I have not yet
encountered it with xorg-based servers.

Another problem on server reset is that Japanese keyboard
layout is ignored after server reset in XDMCP sessions.
I attach a patch for the problem.  Now I'm missing where
the latest code resides, so I create it against xorg repository
on freedesktop.org.

Takuma Murakami (murakami@ipl.t.u-tokyo.ac.jp)

[-- Attachment #2: xwin.jpkbd.patch --]
[-- Type: application/octet-stream, Size: 2381 bytes --]

Index: winconfig.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winconfig.c,v
retrieving revision 1.1.4.1.2.3
diff -u -r1.1.4.1.2.3 winconfig.c
--- winconfig.c	8 Jan 2004 05:10:32 -0000	1.1.4.1.2.3
+++ winconfig.c	11 Jan 2004 13:57:47 -0000
@@ -241,7 +241,7 @@
 winConfigKeyboard (DeviceIntPtr pDevice)
 {
   char                          layoutName[KL_NAMELENGTH];
-  unsigned int                  layoutNum;
+  static unsigned int           layoutNum = 0;
   int                           keyboardType;  
   XF86ConfInputPtr		kbd = NULL;
   XF86ConfInputPtr		input_list = NULL;
@@ -295,14 +295,25 @@
   if (keyboardType > 0 && GetKeyboardLayoutName (layoutName)) 
   {
     WinKBLayoutPtr	pLayout;
-      
-    layoutNum = strtoul (layoutName, (char **)NULL, 16);
+
+    if (! layoutNum)
+      layoutNum = strtoul (layoutName, (char **)NULL, 16);
     if ((layoutNum & 0xffff) == 0x411) {
         /* The japanese layouts know a lot of different IMEs which all have
-	  different layout numbers set. Map them to a single entry. 
-	  Same might apply for chinese, korean and other symbol languages
-	  too */
+	   different layout numbers set. Map them to a single entry. 
+	   Same might apply for chinese, korean and other symbol languages
+	   too */
         layoutNum = (layoutNum & 0xffff);
+	if (keyboardType == 7)
+	  {
+	    /* Japanese layouts have problems with key event messages
+	       such as the lack of WM_KEYUP for Caps Lock key.
+	       Loading US layout fixes this problem. */
+	    if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
+	      winMsg (X_INFO, "Loading US keyboard layout.\n");
+	    else
+	      winMsg (X_ERROR, "LoadKeyboardLaout failed.\n");
+	  }
     }
     winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n", 
             layoutName, layoutNum);
@@ -325,17 +336,6 @@
 	break;
       }
 
-    if ((layoutNum == 0x411) && keyboardType == 7)
-      {
-	/* Japanese layouts have problems with key event messages
-	   such as the lack of WM_KEYUP for Caps Lock key.
-	   Loading US layout fixes this problem. */
-	if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
-	  winMsg (X_INFO, "Loading US keyboard layout.\n");
-	else
-	  winMsg (X_ERROR, "LoadKeyboardLaout failed.\n");
-      }
-	   
   }  
   
   g_winInfo.xkb.initialMap = NULL;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 14:29 ` Takuma Murakami
@ 2004-01-11 17:17   ` Alexander Gottwald
  2004-01-11 17:27     ` Thomas Dickey
  2004-01-11 17:50     ` Alexander Gottwald
  2004-01-11 20:21   ` Harold L Hunt II
  1 sibling, 2 replies; 8+ messages in thread
From: Alexander Gottwald @ 2004-01-11 17:17 UTC (permalink / raw)
  To: cygwin-xfree

Takuma Murakami wrote:

> Another problem on server reset is that Japanese keyboard
> layout is ignored after server reset in XDMCP sessions.
> I attach a patch for the problem.

The patch looks clean to me and I'll apply it to CVS.

> Now I'm missing where
> the latest code resides, so I create it against xorg repository
> on freedesktop.org.

This is the latest public code and already contains the latest test
relases. At least up to test 37.

NP: JBO - der spatz in der hand
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de
 http://www.gotti.org           ICQ: 126018723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 17:17   ` Alexander Gottwald
@ 2004-01-11 17:27     ` Thomas Dickey
  2004-01-11 18:00       ` Alexander Gottwald
  2004-01-11 17:50     ` Alexander Gottwald
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Dickey @ 2004-01-11 17:27 UTC (permalink / raw)
  To: cygwin-xfree

On Sun, 11 Jan 2004, Alexander Gottwald wrote:

> Takuma Murakami wrote:
>
> > Another problem on server reset is that Japanese keyboard
> > layout is ignored after server reset in XDMCP sessions.
> > I attach a patch for the problem.
>
> The patch looks clean to me and I'll apply it to CVS.
>
> > Now I'm missing where
> > the latest code resides, so I create it against xorg repository
> > on freedesktop.org.
>
> This is the latest public code and already contains the latest test
> relases. At least up to test 37.

for xc/lib/font ?

not necessarily - freedesktop.org's imports from xfree86 are not timely.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 17:17   ` Alexander Gottwald
  2004-01-11 17:27     ` Thomas Dickey
@ 2004-01-11 17:50     ` Alexander Gottwald
  1 sibling, 0 replies; 8+ messages in thread
From: Alexander Gottwald @ 2004-01-11 17:50 UTC (permalink / raw)
  To: cygwin-xfree

Alexander Gottwald wrote:

> Takuma Murakami wrote:
>
> > Another problem on server reset is that Japanese keyboard
> > layout is ignored after server reset in XDMCP sessions.
> > I attach a patch for the problem.
>
> The patch looks clean to me and I'll apply it to CVS.

One minor glitch: If the user changes the layout externally the xserver
will not get the new layout on reset but only by restarting the server.

But this is only a minor problem and I posted this only for pointing
the users to a small change in server behaviour.

bye
    ago

NP: Zeraphine - No tears
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de
 http://www.gotti.org           ICQ: 126018723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 17:27     ` Thomas Dickey
@ 2004-01-11 18:00       ` Alexander Gottwald
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Gottwald @ 2004-01-11 18:00 UTC (permalink / raw)
  To: cygwin-xfree

Thomas Dickey wrote:

> > This is the latest public code and already contains the latest test
> > relases. At least up to test 37.
>
> for xc/lib/font ?
>
> not necessarily - freedesktop.org's imports from xfree86 are not timely.

There are more recent branches in the xorg repository but none of them are
merged into the cygwin branch. We currently work with 4.3.99.16, but the
latest XFree release in CVS is 4.3.99.902.
I'll take a look if we can merge this release into the cygwin branch.

bye
    ago
NP: Covenant - One World One Sky
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de
 http://www.gotti.org           ICQ: 126018723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 14:29 ` Takuma Murakami
  2004-01-11 17:17   ` Alexander Gottwald
@ 2004-01-11 20:21   ` Harold L Hunt II
  2004-01-12  0:00     ` Alexander Gottwald
  1 sibling, 1 reply; 8+ messages in thread
From: Harold L Hunt II @ 2004-01-11 20:21 UTC (permalink / raw)
  To: cygwin-xfree

Takuma,

Takuma Murakami wrote:

> The crash in fontdir.c have been there for a while.  At least
> most of xserv-2x releases have it.  I challenged the problem
> several times but I could neither fix, nor unveil how to
> reproduce it.  I think it occurred on the first reset as well
> as plural resets.  But it's not certain because I have not yet
> encountered it with xorg-based servers.

I think the first thing to do is just check if FreeFonts () is being 
called twice on some server resets.  If it is, then the problem is 
simple: prevent it from being called twice.  If FreeFonts () is not 
called twice, then the problem could be more difficult to track down.

> Another problem on server reset is that Japanese keyboard
> layout is ignored after server reset in XDMCP sessions.
> I attach a patch for the problem.  Now I'm missing where
> the latest code resides, so I create it against xorg repository
> on freedesktop.org.

Yes, the latest code for Cygwin/X is in the xorg repository on 
freedesktop.org, you made your patch against the correct source.

Thanks for the patch!

By the way, is there anything that makes this just apply to Japanese 
keyboard layouts, or is it generally applicable to all keyboard layouts 
being lost on a server reset in Xdcmp sessions?

Harold


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Crashing after two or three server resets
  2004-01-11 20:21   ` Harold L Hunt II
@ 2004-01-12  0:00     ` Alexander Gottwald
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Gottwald @ 2004-01-12  0:00 UTC (permalink / raw)
  To: cygwin-xfree

Harold L Hunt II wrote:

> By the way, is there anything that makes this just apply to Japanese
> keyboard layouts, or is it generally applicable to all keyboard layouts
> being lost on a server reset in Xdcmp sessions?

This is special to the japanese layouts. We get the layoutnumber with
GetKeyboardLayout() on every reset. For the japanese layouts we call
SetKeyboardLayout(EN_US) later. After the next reset GetKeyboardLayout()
now returns EN_US instead of japanese.

bye
    ago

NP: VNV Nation - Saviour (Vox)
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de
 http://www.gotti.org           ICQ: 126018723


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-01-12  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-11  3:12 Crashing after two or three server resets Harold L Hunt II
2004-01-11 14:29 ` Takuma Murakami
2004-01-11 17:17   ` Alexander Gottwald
2004-01-11 17:27     ` Thomas Dickey
2004-01-11 18:00       ` Alexander Gottwald
2004-01-11 17:50     ` Alexander Gottwald
2004-01-11 20:21   ` Harold L Hunt II
2004-01-12  0:00     ` Alexander Gottwald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).