Committed and pushed.
In message <[email protected]> on
Tue, 18 Dec 2012 14:41:09 -0500, "Michael O'Donnell" <[email protected]> said:
mod.ctwm>
mod.ctwm>
mod.ctwm> Richard,
mod.ctwm>
mod.ctwm> I never got any response (positive or negative) from you
mod.ctwm> when I submitted my fix for the SIGSEGV problem that CTWM
mod.ctwm> suffers on occasion. It happens that I've been out of work
mod.ctwm> and I'd like to be able to show that I've not been idle
mod.ctwm> during that time so I'm hoping to be able to say that my
mod.ctwm> patch was accepted.
mod.ctwm>
mod.ctwm> Now, obviously, my employment situation is strictly my own
mod.ctwm> problem and in no way obligates you to do anything, but since
mod.ctwm> the patch is straightforward and the benefit (both to CTWM
mod.ctwm> users as well as to my "street cred") is real, I ask once
mod.ctwm> again that you accept the patch. Thanks.
mod.ctwm>
mod.ctwm> --Michael O'Donnell
mod.ctwm>
mod.ctwm>
mod.ctwm> ###### REPEATED POSTING FROM JULY, INCLUDING PATCH:
mod.ctwm>
mod.ctwm> For those who asked, here are excerpts from emails I've sent
mod.ctwm> to Debian regarding the CTWM crashes that I've repaired.
mod.ctwm>
mod.ctwm> #################################################################
mod.ctwm>
mod.ctwm> A brief sketch of typical usage and failure mode:
mod.ctwm>
mod.ctwm> I am running CTWM with eight workspaces (most are populated)
mod.ctwm> and switching workspaces fairly often. The most active
mod.ctwm> X apps are xterm, Firefox, exmh and mahjongg. I typically
mod.ctwm> have several Firefox windows open, each of which has multiple
mod.ctwm> tabs active, sometimes dozens. Failure seemed most often
mod.ctwm> to happen immediately after I switched workspaces to one
mod.ctwm> containing a Firefox window with a *LOT* of tabs open.
mod.ctwm> I've not seen it even once since this I made this fix.
mod.ctwm>
mod.ctwm> Note that I was usually able to recover my entire X session
mod.ctwm> and continue without harm if I could manage to launch a
mod.ctwm> new instance of CTWM from the console or an SSH session.
mod.ctwm> Until I patched my CTWM I actually had a shell loop right
mod.ctwm> inside my .xsession file that would automatically relaunch
mod.ctwm> CTWM when it crashed, so I was able to live with it for
mod.ctwm> several years before finally getting fed up and fixing it!
mod.ctwm>
mod.ctwm> #################################################################
mod.ctwm>
mod.ctwm> Here's a bit of GDB output to illustrate the specific
mod.ctwm> fauilt that was constantly occurring before I fixed it:
mod.ctwm>
mod.ctwm> Program received signal SIGSEGV, Segmentation fault.
mod.ctwm> 0x0805f131 in PlaceOntop (ontop=8, where=0) at menus.c:3756
mod.ctwm> 3756 for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
mod.ctwm> (gdb) where
mod.ctwm> #0 0x0805f131 in PlaceOntop (ontop=8, where=0) at menus.c:3756
mod.ctwm> #1 0x0805f24b in RaiseWindow (tmp_win=0x83343a0) at menus.c:3787
mod.ctwm> #2 0x0806ab10 in AutoRaiseWindow (tmp=0x83343a0) at events.c:218
mod.ctwm> #3 0x0807096f in HandleEvents () at events.c:547
mod.ctwm> #4 0x0804e3a7 in main (argc=2, argv=0xbff491a4, environ=0xbff491b0)
mod.ctwm> at ctwm.c:1027
mod.ctwm> (gdb) print Scr
mod.ctwm> $2 = (ScreenInfo *) 0x0
mod.ctwm>
mod.ctwm> #################################################################
mod.ctwm>
mod.ctwm> To: Debian Bug Tracking System <[email protected]>
mod.ctwm> Date: Tue, 06 Mar 2012 15:42:25 -0500
mod.ctwm> Subject: debianBug#662860 - ctwm: SIGSEGV when changing workspaces
mod.ctwm>
mod.ctwm> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662860
mod.ctwm>
mod.ctwm> Package: ctwm
mod.ctwm> Version: 3.7-3.2
mod.ctwm> Severity: important
mod.ctwm> Tags: upstream patch
mod.ctwm>
mod.ctwm> Dear Maintainer,
mod.ctwm>
mod.ctwm> I'm a longtime CTWM user who finally got tired of the random
mod.ctwm> crashes that occur, typically when I'm switching workspaces.
mod.ctwm> I can sometimes go for a month without seeing them and sometimes
mod.ctwm> it happens several times a day. I've analyzed this to the point
mod.ctwm> where I can see that code in DispatchEvent() is occasionally
mod.ctwm> leaving the global Scr pointer NULL which causes a SIGSEGV on
mod.ctwm> our next pass through the loop in HandleEvents().
mod.ctwm>
mod.ctwm> I've provided a patch that adds a few lines of defensive code
mod.ctwm> which seems to have improved the situation, though I have not
mod.ctwm> analyzed the root cause, which appears to be that, for unknown
mod.ctwm> reasons, either XFindContext() or FindScreenInfo() seem to be
mod.ctwm> unable to return the answer expected of them.
mod.ctwm>
mod.ctwm> --Michael O'Donnell
mod.ctwm>
mod.ctwm> BEGIN PATCH:
mod.ctwm> --- events.c.b0rken 2012-03-06 15:10:42.093677349 -0500
mod.ctwm> +++ events.c 2012-03-06 15:19:52.369161662 -0500
mod.ctwm> @@ -435,21 +435,25 @@
mod.ctwm> */
mod.ctwm> Bool DispatchEvent2 (void)
mod.ctwm> {
mod.ctwm> Window w = Event.xany.window;
mod.ctwm> StashEventTime (&Event);
mod.ctwm> + ScreenInfo *lastScr = Scr; /* XXX_MIKE - assume Scr OK on
entry... */
mod.ctwm>
mod.ctwm> if (XFindContext (dpy, w, TwmContext, (XPointer *) &Tmp_win) ==
XCNOENT)
mod.ctwm> Tmp_win = NULL;
mod.ctwm>
mod.ctwm> if (XFindContext (dpy, w, ScreenContext, (XPointer *)&Scr) ==
XCNOENT) {
mod.ctwm> Scr = FindScreenInfo (WindowOfEvent (&Event));
mod.ctwm> }
mod.ctwm>
mod.ctwm> dumpevent(&Event);
mod.ctwm>
mod.ctwm> - if (!Scr) return False;
mod.ctwm> + if (!Scr) {
mod.ctwm> + Scr = lastScr; /* XXX_MIKE - try not to leave Scr
NULL */
mod.ctwm> + return False;
mod.ctwm> + }
mod.ctwm> if (Scr->Root != Scr->RealRoot) FixRootEvent (&Event);
mod.ctwm>
mod.ctwm> #ifdef SOUNDS
mod.ctwm> play_sound(Event.type);
mod.ctwm> #endif
mod.ctwm> @@ -473,21 +477,25 @@
mod.ctwm> */
mod.ctwm> Bool DispatchEvent (void)
mod.ctwm> {
mod.ctwm> Window w = Event.xany.window;
mod.ctwm> StashEventTime (&Event);
mod.ctwm> + ScreenInfo *lastScr = Scr; /* XXX_MIKE - assume Scr OK on
entry... */
mod.ctwm>
mod.ctwm> if (XFindContext (dpy, w, TwmContext, (XPointer *) &Tmp_win) ==
XCNOENT)
mod.ctwm> Tmp_win = NULL;
mod.ctwm>
mod.ctwm> if (XFindContext (dpy, w, ScreenContext, (XPointer *)&Scr) ==
XCNOENT) {
mod.ctwm> Scr = FindScreenInfo (WindowOfEvent (&Event));
mod.ctwm> }
mod.ctwm>
mod.ctwm> dumpevent(&Event);
mod.ctwm>
mod.ctwm> - if (!Scr) return False;
mod.ctwm> + if (!Scr) {
mod.ctwm> + Scr = lastScr; /* XXX_MIKE - try not to leave Scr
NULL */
mod.ctwm> + return False;
mod.ctwm> + }
mod.ctwm>
mod.ctwm> if (captive) {
mod.ctwm> if ((Event.type == ConfigureNotify) &&
(Event.xconfigure.window == Scr->CaptiveRoot)) {
mod.ctwm> ConfigureRootWindow (&Event);
mod.ctwm> return (False);
mod.ctwm>
mod.ctwm> END PATCH
mod.ctwm>
mod.ctwm> -- System Information:
mod.ctwm> Debian Release: wheezy/sid
mod.ctwm> APT prefers testing
mod.ctwm> APT policy: (990, 'testing'), (500, 'unstable')
mod.ctwm> Architecture: i386 (i686)
mod.ctwm>
mod.ctwm> Kernel: Linux 3.1.0 (SMP w/2 CPU cores)
mod.ctwm> Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
mod.ctwm> Shell: /bin/sh linked to /bin/bash
mod.ctwm>
mod.ctwm> Versions of packages ctwm depends on:
mod.ctwm> ii libc6 2.13-26
mod.ctwm> ii libice6 2:1.0.7-2
mod.ctwm> ii libjpeg8 8d-1
mod.ctwm> ii librplay3 3.3.2-14
mod.ctwm> ii libsm6 2:1.2.0-2
mod.ctwm> ii libx11-6 2:1.4.4-4
mod.ctwm> ii libxext6 2:1.3.0-3
mod.ctwm> ii libxmu6 2:1.1.0-3
mod.ctwm> ii libxpm4 1:3.5.9-4
mod.ctwm> ii libxt6 1:1.1.1-2
mod.ctwm> ii m4 1.4.16-2
mod.ctwm> ii x11-common 1:7.6+11
mod.ctwm>
mod.ctwm> ctwm recommends no packages.
mod.ctwm>
mod.ctwm> ctwm suggests no packages.
mod.ctwm>
mod.ctwm> -- Configuration Files:
mod.ctwm> /etc/X11/ctwm/system.ctwmrc [Errno 2] No such file or directory:
u'/etc/X11/ctwm/system.ctwmrc'
mod.ctwm>