Subject: FVWM: [2.0.41] FVWM core dump while running tgif

From: "Paul D. Smith" <[email-masked]>
Date: Tue, 12 Mar 96 18:10:19 EST

SunOS 4.1.3_U1, X11R6 (latest patches), built with GCC, XPM, SHAPE, etc.

I can get fvwm2 to dump core every single time I run tgif.  The version
of tgif I'm running is 2.16p8, I believe--I don't really want to start
it up again :-/ :).

Anyway, the traceback in fvwm2 is this:

  Core was generated by `fvwm2'.
  Program terminated with signal 10, Bus error.
  #0  DispatchEvent () at events.c:225
  225         (*EventHandlerJumpTable[Event.type])();
  (gdb) bt
  #0  DispatchEvent () at events.c:225
  #1  0xb43c in HandleEvents () at events.c:246
  #2  0xe91c in main (argc=147456, argv=0xeffff7e4) at fvwm.c:430

The problem is that Event.type is 64, but EventHandlerJumpTable has only
35 members:

  (gdb) p Event.type
  $1 = 64
  (gdb) ptype EventHandlerJumpTable
  type = void (*[35])()
  (gdb) p EventHandlerJumpTable[Event.type]
  $2 = (void (*)()) 0x1

Obviously indirecting through 0x1 is not good!

I don't know what the problem is here: should Event.type never be >34?
Should EventHandlerJumpTable be larger than it is?

At any rate, some sanity checking of this value would probably be A Good
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: <[email-masked]> (Charles Hines)
Date: Tue, 12 Mar 1996 18:39:35 -0500

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

Paul> SunOS 4.1.3_U1, X11R6 (latest patches), built with GCC, XPM,
Paul> SHAPE, etc.  I can get fvwm2 to dump core every single time I
Paul> run tgif.  The version of tgif I'm running is 2.16p8, I
Paul> believe--I don't really want to start it up again :-/ :).

I just tried tgif 2.16 pl 12 and didn't have any problems.  Different
OS though (AIX).

Paul> Anyway, the traceback in fvwm2 is this:

Paul>   Core was generated by `fvwm2'.
Paul>   Program terminated with signal 10, Bus error.
Paul>   #0  DispatchEvent () at events.c:225
Paul>   225         (*EventHandlerJumpTable[Event.type])();
....
Paul> The problem is that Event.type is 64, but EventHandlerJumpTable has only
Paul> 35 members:
....

Paul> Obviously indirecting through 0x1 is not good!

Paul> I don't know what the problem is here: should Event.type never be >34?
Paul> Should EventHandlerJumpTable be larger than it is?

I set the size of that to be LASTEvent, which is defined in X.h to be
of a greater value than any of the events.  Apparently on your
machine, this is not the case.  I could set it to something like 256
always, but I wanted to save space.  Besides, LASTEvent is SUPPOSED to
be the max event number...

Paul> At any rate, some sanity checking of this value would probably be A Good
Paul> Thing.

Possibly, but I took out the checking that was there (the switch
statement) to get a speedup.  As I said, I could extend the size of
the jump table to like 256 and still get that speedup, but waste that
extra space (even if it is only about 888 bytes).

Perhaps I'll have do that...

Chuck

---

From: "Paul D. Smith" <[email-masked]>
Date: Tue, 12 Mar 96 18:50:54 EST

%% Regarding Re: FVWM: [2.0.41] FVWM core dump while running tgif;
%% <[email-masked]> (Charles Hines) writes:

    ch> I just tried tgif 2.16 pl 12 and didn't have any problems.
    ch> Different OS though (AIX).

Who knows; could be any number of problems.  Never seen it in any
version of fvwm with anything but tgif though :-/.

    ch> I set the size of that to be LASTEvent, which is defined in X.h
    ch> to be of a greater value than any of the events.  Apparently on
    ch> your machine, this is not the case.  I could set it to something
    ch> like 256 always, but I wanted to save space.  Besides, LASTEvent
    ch> is SUPPOSED to be the max event number...

Agreed; in both X11R5 and X11R6 (note these are straight from MIT; we
build them locally from the public sources) that value is 35, and there
are only 35 events listed (0 to 34).

So it seems to be a bug in the X server, or the tgif code, or fvwm, or
_something_ that lets a value of 64 get into that variable; it shouldn't
hold values that high.

I'll try recompiling tgif and see if it breaks after that.