Re: Server regeneration no longer works

2003-10-31 Thread David Dawes
On Thu, Oct 30, 2003 at 08:51:48AM +0100, Frank Gießler wrote:
David Dawes wrote:

snip
 
 cvs rdiff -D 15 October 2003 -D 16 October 2003 Xserver/os
 
 gives:
snip

Thanks, it is indeed the same bug. I've marked the one in Bugzilla as fixed. Is there 
an easy 
way to figure out the dates for the diffs?

I chose them based on the date of the message of mine you quoted that
mentioned the fix :-)

 Also, cvsweb.xfree86.org allows easy viewing of changes.

That's how I found out. But one has to know which files to investigate, and if more 
than one 
file is involved it can be a real PITA. Or am I missing something?

The cvs-commit list (and its archive) are useful for this.  The commit
messages will show you exactly what the revisions are for each changed
file.  I'd recommend that anyone following XFree86 development subscribe
to cvs-commit (see http://www.xfree86.org/lists.html).

David
-- 
David Dawes X-Oz Technologies
www.XFree86.org/~dawes  www.x-oz.com
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Server regeneration no longer works

2003-10-30 Thread Mike A. Harris
On Thu, 30 Oct 2003, [ISO-8859-1] Frank Gießler wrote:

snip
 
 cvs rdiff -D 15 October 2003 -D 16 October 2003 Xserver/os
 
 gives:
snip

Thanks, it is indeed the same bug. I've marked the one in Bugzilla as fixed. Is there 
an easy 
way to figure out the dates for the diffs?

 Also, cvsweb.xfree86.org allows easy viewing of changes.

That's how I found out. But one has to know which files to investigate, and if more 
than one 
file is involved it can be a real PITA. Or am I missing something?

Search cvs-commits list archives, and/or use the cvsps tool to 
generate patchsets.  You can find the latter with google.  The 
documentation blows goats but the tool works awesome once you 
mess with it for hours and hours wasting time until you figure 
out the right magic.  ;o)

It's a godsend.

-- 
Mike A. Harris


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Server regeneration no longer works

2003-10-29 Thread David Dawes
On Tue, Oct 28, 2003 at 12:48:36PM +0100, Frank Gießler wrote:
David Dawes wrote:
 On Wed, Oct 15, 2003 at 04:17:35PM -0400, David Dawes wrote:
 
On Wed, Oct 15, 2003 at 12:53:32PM -0400, Mark Vojkovich wrote:

 Start the server with no clients and access control disabled
XFree86 -ac.  Run a client and kill it, or run a client that
terminates itself (like xset) and the server segfaults on the
server regeneration.  I'm having a hard time getting a back trace.
It looks like the stack is trashed pretty badly.  This appears
to be a recent regression.

It looks like a malloc/free bug -- maybe a double free somewhere.  I
see it crashing in free(), called from CMapUnwrapScreen().  If I add
some debugging ErrorF's the caller of the crashing free() moves.  I'll
try a build on FreeBSD and enable some of its malloc debugging flags.
 
 
 That located the problem nicely, aborting at the actual double-free.
 The screen saver timers get freed in TimerInit() for each generation.
 However, the timer pointers kept by the screen saver code weren't being
 cleared for each generation, so the old values kept being used and added
 back to the timers list.  Then they'd get freed again in TimerInit() at
 the second regeneration.  Not to mention that freed memory was still
 being used.  I'm going to commit a fix that clears the Screensaver and
 DPMS timers at each regeneration.
 
 David

Is this fix available as a single patch? I would like to check whether this also 
fixes 
Bugzilla's #776.

cvs rdiff -D 15 October 2003 -D 16 October 2003 Xserver/os

gives:

Index: xc/programs/Xserver/os/WaitFor.c
diff -u xc/programs/Xserver/os/WaitFor.c:3.41 xc/programs/Xserver/os/WaitFor.c:3.42
--- xc/programs/Xserver/os/WaitFor.c:3.41   Thu Sep 25 09:26:27 2003
+++ xc/programs/Xserver/os/WaitFor.cWed Oct 15 21:33:35 2003
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/os/WaitFor.c,v 3.41 2003/09/25 13:26:27 pascal Exp $ 
*/
+/* $XFree86: xc/programs/Xserver/os/WaitFor.c,v 3.42 2003/10/16 01:33:35 dawes Exp $ 
*/
 /***
 
 Copyright 1987, 1998  The Open Group
@@ -112,7 +112,7 @@
 };
 
 static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
-static OsTimerPtr timers;
+static OsTimerPtr timers = NULL;
 
 /*
  * WaitForSomething:
@@ -568,10 +568,15 @@
 }
 
 static OsTimerPtr ScreenSaverTimer = NULL;
+static int ScreenSaverGeneration = -1;
 
 void
 SetScreenSaverTimer(void)
 {
+if (ScreenSaverGeneration != serverGeneration) {
+   ScreenSaverTimer = NULL;
+   ScreenSaverGeneration = serverGeneration;
+}
 if (ScreenSaverTime  0) {
ScreenSaverTimer = TimerSet(ScreenSaverTimer, 0, ScreenSaverTime,
ScreenSaverTimeoutExpire, NULL);
@@ -586,6 +591,7 @@
 static OsTimerPtr DPMSStandbyTimer = NULL;
 static OsTimerPtr DPMSSuspendTimer = NULL;
 static OsTimerPtr DPMSOffTimer = NULL;
+static int DPMSGeneration = -1;
 
 static CARD32
 DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg)
@@ -635,12 +641,19 @@
 if (!DPMSEnabled)
 return;
 
+if (DPMSGeneration != serverGeneration) {
+   DPMSStandbyTimer = NULL;
+   DPMSSuspendTimer = NULL;
+   DPMSOffTimer = NULL;
+   DPMSGeneration = serverGeneration;
+}
+
 if (DPMSStandbyTime  0) {
 DPMSStandbyTimer = TimerSet(DPMSStandbyTimer, 0, DPMSStandbyTime,
 DPMSStandbyTimerExpire, NULL);
 }
 if (DPMSSuspendTime  0) {
-DPMSStandbyTimer = TimerSet(DPMSSuspendTimer, 0, DPMSSuspendTime,
+DPMSSuspendTimer = TimerSet(DPMSSuspendTimer, 0, DPMSSuspendTime,
 DPMSSuspendTimerExpire, NULL);
 }
 if (DPMSOffTime  0) {


Also, cvsweb.xfree86.org allows easy viewing of changes.

A better approach is to explicitly free the timers at the end of each
generation.  I committed that last night.

David
-- 
David Dawes X-Oz Technologies
www.XFree86.org/~dawes  www.x-oz.com
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Server regeneration no longer works

2003-10-28 Thread Frank Gießler
David Dawes wrote:
On Wed, Oct 15, 2003 at 04:17:35PM -0400, David Dawes wrote:

On Wed, Oct 15, 2003 at 12:53:32PM -0400, Mark Vojkovich wrote:

Start the server with no clients and access control disabled
XFree86 -ac.  Run a client and kill it, or run a client that
terminates itself (like xset) and the server segfaults on the
server regeneration.  I'm having a hard time getting a back trace.
It looks like the stack is trashed pretty badly.  This appears
to be a recent regression.
It looks like a malloc/free bug -- maybe a double free somewhere.  I
see it crashing in free(), called from CMapUnwrapScreen().  If I add
some debugging ErrorF's the caller of the crashing free() moves.  I'll
try a build on FreeBSD and enable some of its malloc debugging flags.


That located the problem nicely, aborting at the actual double-free.
The screen saver timers get freed in TimerInit() for each generation.
However, the timer pointers kept by the screen saver code weren't being
cleared for each generation, so the old values kept being used and added
back to the timers list.  Then they'd get freed again in TimerInit() at
the second regeneration.  Not to mention that freed memory was still
being used.  I'm going to commit a fix that clears the Screensaver and
DPMS timers at each regeneration.
David
Is this fix available as a single patch? I would like to check whether this also fixes 
Bugzilla's #776.

Thanks, Frank.

--
 Frank Giessler
 Klinikum der Universitaet Jena   Tel.: +49-3641-9 32 57 80
 Biomagnetisches Zentrum  Fax : +49-3641-9 32 57 72
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel