Subject: FVWM: [2.0.41] fvwm core on bad Event.type

From: "Paul D. Smith" <[email-masked]>
Date: Wed, 13 Mar 96 13:37:44 EST

OK, it turns out that resizing absolutely _any_ X application, then
moving the mouse outside the window will cause FVWM to core with the
same problem: Event.type is 64 and you get a core dump.  I tried it with
Netscape, xterm, etc. and all did the same thing.

Note that if the memory after that array happens to be NULL, you won't
see anything go wrong; the event will just be ignored.  So at least when
you're debugging FVWM, be sure to add a check for this or you might
think it doesn't happen on your system.

PS. Someone mentioned a way to create a "pseudo display" on your normal
    display that you can use to start and debug another FVWM process; I
    looked at ftp.x.org and found xpseudoroot-1.04 which looks
    promising, but I can't get it to compile, even after toying with the
    makefile and fixing a reference to dpy->display_name (changed to
    DisplayString(dpy)), because it uses the functions LockMutex and
    UnlockMutex which I can't find anywhere on my system.

    I tried searching through the FVWM mailing list archives but
    couldn't find anything about it.

    Is there a newer version of xpseudoroot or another app that does the
    same thing?

-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 Senior Software Engineer                                   Bay Networks, Inc.
-----------------------------------------------==<http://www.baynetworks.com/>-
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Paul D. Smith" <[email-masked]>
Date: Wed, 13 Mar 96 14:13:40 EST

%% Regarding FVWM: [2.0.41] fvwm core on bad Event.type; I wrote:

    pds> OK, it turns out that resizing absolutely _any_ X application,
    pds> then moving the mouse outside the window will cause FVWM to
    pds> core with the same problem: Event.type is 64 and you get a core
    pds> dump.  I tried it with Netscape, xterm, etc. and all did the
    pds> same thing.

Ugh.  Sorry for the glut of email :(

Anyway, I added some code to check for bogus Event.type values in both
events.c:DispatchEvent() _and_ in events.c:My_XNextEvent(), right after
the XNextEvent() function returns.

It turns out that the Event.type==64 is happening fairly regularly,
every 30 seconds or so, and it's being returned that way from
XNextEvent().  It happens even if I don't resize the window... even if I
just let my mouse sit idle.

And I found the culprit: xfaces!  Every time xfaces polls for mail it
does something with its window that generates that event.

I recompiled FVWM to catch that event type and ignore it; then xfaces
didn't quite work: when I had no mail I got the proper shaped mailbox
pixmap.  When I received some mail, it tried to put up a square bitmap,
but the shape of the bitmap was still the mailbox shape (i.e., it still
looked like a mailbox but it was "filled in" with the mail sender's
icon).

I don't understand why it works sometimes and core dumps other times;
very odd.  Even more strange is that if I add a test so it doesn't core,
xfaces doesn't reshape correctly as I mentioned above!  It's almost like
there's _normally_ some valid function pointer at location
EventHandlerJumpTable[64] that makes things work, but it gets
overwritten by 1 every now and then.

My xfaces app _was_ compiled a long time ago, with older X and Xpm
libraries; ldd says:

        -lXpm.4 => /usr/X11R5/lib/libXpm.so.4.2
        -lXaw.5 => /usr/X11R5/lib/libXaw.so.5.0
        -lXmu.4 => /usr/X11R5/lib/libXmu.so.4.10
        -lXt.4 => /usr/X11R5/lib/libXt.so.4.10
        -lXext.4 => /usr/X11R5/lib/libXext.so.4.10
        -lX11.4 => /usr/X11R5/lib/libX11.so.4.10
        -lc.1 => /usr/lib/libc.so.1.9
        -ldl.1 => /usr/lib/libdl.so.1.0

I suppose that might be part of the problem.  I'll recompile and see if
there's any difference.

---

From: <[email-masked]> (Charles Hines)
Date: Wed, 13 Mar 1996 14:45:16 -0500

>>>>> "Paul" == Paul D Smith <[email-masked]> writes:

Paul> Yep, you're right; I just attached to my fvwm2 and looked up
Paul> ShapeEventBase, and it's 64; the X include files say ShapeNotify
Paul> is 0, so voila!

That'd do it...

Paul> I guess your only alternative to making the array 256 is to
Paul> dynamically allocate the event table to be the proper size after
Paul> you determine what ShapeEventBase+ShapeNotify is, since
Paul> ShapeEventBase is a runtime value.

I'll go to 256.  The 'wasted' memory is pretty insignificant.

Paul> I'll make the change in my FVWM sources, thanks.

No problem.  Sorry it gave you such grief - I should have caught this
before I sent it out.  I'm going try to compile it under SunOS or
Solaris and check it w/ Purify to make sure I didn't do anything else
silly like this...

And the default is now 256 (for the next release):

--------------->8 cut here 8<---------------
--- ../../fvwm-2.0.41/fvwm/events.c     Sun Feb 18 19:08:36 1996
+++ ./events.c  Wed Mar 13 14:36:31 1996
@@ -87,9 +87,12 @@
 Window PressedW;

 /*
-** number of X events defined - it should be defined in X.h (to be
-** like 35), but just in case...
+** LASTEvent is the number of X events defined - it should be defined
+** in X.h (to be like 35), but since extension (eg SHAPE) events are
+** numbered beyond LASTEvent, we need to use a bigger number than the
+** default, so let's undefine the default and use 256 instead.
 */
+#undef LASTEvent
 #ifndef LASTEvent
 #define LASTEvent 256
 #endif /* !LASTEvent */
--------------->8 cut here 8<---------------

I CC'd the mailing list in case anyone else out there needs to apply
this patch.  I'll put it on the LATEST NEWS section of the home page
too.

Chuck

---

From: Mark Powell <[email-masked]>
Date: Thu, 14 Mar 1996 10:02:45 GMT

> Date: Wed, 13 Mar 96 13:37:44 EST
> From: "Paul D. Smith" <[email-masked]>
> 
>     promising....

X11R6 has a server called Xnest which is implemented using Xlib calls
(wierd!!). This has the effect that if you run it you get a window which
is itself another X server you can connect to and a start new sessions
etc. without losing your main session.

-- 
Mark Powell, Senior Software Engineer <[email-masked]>
Primagraphics Limited, Graphics Court, Melbourn Science Park,
Melbourn, Royston, Herts SG8 6EJ, England. Tel. +44 1763 262041
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Ross J. Reedstrom)
Date: Thu, 14 Mar 1996 10:06:56 -0600 (CST)

"Mark Powell said:"
> etc. without losing your main session.
Xnest is the more general solution, but under Linux, many people don't
realize that you can start additional X sessions on other virtual consoles. 
You do need the proper command line switch to tell X that it's display :1
for example - I just tried it with:

startx -- :1

and sure enough, a second X server started up using another VC and a second
copy of fvwm, xclock, etc.

----------------
 Ross J. Reedstrom
 [email-masked]                      (608) 265-5591
 School of Pharmacy                               or
 University of Wisconsin-Madison            (608) 265-2599
 425 N. Charter St.
 Madison, WI 53706

---

From: Sean Kelly <[email-masked]>
Date: Thu, 14 Mar 1996 09:14:57 -0700

>>>>> "Ross" == Ross J Reedstrom <[email-masked]> writes:

    Ross> Xnest is the more general solution, but under Linux, many
    Ross> people don't realize that you can start additional X
    Ross> sessions on other virtual consoles.

Linux isn't the only Unix-style OS with virtual consoles.  There's
also FreeBSD, eSix, Interactive SVR4, and Solaris, to name a few.  But
no other non-Intel based Unix that I know has it.  Curious.

Anyone know what the deal is?  Why haven't other vendors implemented
similar technology?

-- 
Sean Kelly                          
NOAA Forecast Systems Laboratory    [email-masked]
Boulder Colorado USA                http://www-sdd.fsl.noaa.gov/~kelly/
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Alan Wild" <[email-masked]>
Date: Thu, 14 Mar 1996 08:48:58 -0800 (PST)

> Anyone know what the deal is?  Why haven't other vendors implemented

There are rs6000 AIX boxes here that have virtual consoles.

-Alan

-- 
Alan Wild  f/s/c                                   Intel SET-CA AV Tools
Mail Stop: CO3-222                          Office Phone:  (503)677-4538
[email-masked]             [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: tim werner <[email-masked]>
Date: Thu, 14 Mar 1996 14:05:35 -0500

>From: [email-masked] (Ross J. Reedstrom)
>Date: Thu, 14 Mar 1996 10:06:56 -0600 (CST)

>for example - I just tried it with:

I have escaped from X to a virtual console under Linux, but never made
it back.  Sorry for the off-topic, but what keystrokes does one use to
switch back and forth?

thanks,
tw

---

From: "Alan Wild" <[email-masked]>
Date: Thu, 14 Mar 1996 11:17:31 -0800 (PST)

> it back.  Sorry for the off-topic, but what keystrokes does one use to

The defaults for XFree86 Are:

Ctrl-Alt +F?

Where '?' is the number of the consoel you want to use.  F7 is used for
X.  I believe if you are using xdm, there is a virtual console attached
to 6, as well.

-Alan

---

From: Raymond Toy <[email-masked]>
Date: Thu, 14 Mar 1996 14:38:22 -0500

>> it back.  Sorry for the off-topic, but what keystrokes does one use to

    Alan> The defaults for XFree86 Are:

    Alan> Ctrl-Alt +F?

    Alan> Where '?' is the number of the consoel you want to use.  F7 is used for
    Alan> X.  I believe if you are using xdm, there is a virtual console attached
    Alan> to 6, as well.

That only gets you from X to some other console.  To get back to X use
Alt F? where '?' is the first virtual console that doesn't
have a getty running on it.  For me, that's 5---getty is running on
the first 4.

Of course, there are probably other strange setups where this is not
true.  I'd just try pressing Alt F? for all values of ? until X comes
back.  

Ray

---

From: "Brandon M. Browning" <[email-masked]>
Date: Thu, 14 Mar 1996 12:53:42 -0800 (PST)

> it back.  Sorry for the off-topic, but what keystrokes does one use to

To go from X to commandline:
CTRL-ALT-F1 for the first "virtual" terminal, F2 for the second, etc.

To go from commandline to X:
ALT-F7 for the first "virtual" terminal, F8 for the second, etc.

(or is it CTRL-ALT-F7?  I'm not on my console, so i can't doublecheck)

HTH,

-- Brandon Browning                                                          )
   Powertie Software                                                        (
   http://www.powertie.org/                                                c[]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Chicken Little was right!
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Todd Fries)
Date: Sat, 16 Mar 1996 20:15:37 -0600 (CST)

> true.  I'd just try pressing Alt F? for all values of ? until X comes

Considering there are a total of 63 'possible' virtual consoles, I have
found it much easier to use 'alt-leftarrow' and 'alt-rightarrow' while
at the console to change back to X...note, however, that 'ctrl-alt-arrow'
does not work.

-- 
Todd [email-masked]
http://www.umr.edu/~tfries
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].