Hi Grant,
Thanks for your reply.
On Tue, 10 Sep 1996, Grant McDorman wrote:
> Based on this, I suspect your problem may not be the signal handler.
> What I suggest you do is break into the looping process(es) with your
> debugger, get the call stack, and post it to the list. We can proceed
> from there.
O.K. I had a 1 hour debugging session this morning before I had to do
what I get paid for :-)
1.) FVWM2 didn't always loop when exiting X. Sometimes I dumped core
as well. I got the following traceback for that:
(gdb) r
Starting program: /home/users/tom/sources/fvwm-2.0.43/fvwm/fvwm2
X connection to finwal01:0.0 broken (explicit kill or server shutdown).
Program received signal SIGSEGV, Segmentation fault.
0x3ff8046fdb8 in XQueryPointer ()
(gdb) bt
#0 0x3ff8046fdb8 in XQueryPointer ()
#1 0x120025eec in WaitForButtonsUp () at menus.c:852
#2 0x12001da98 in ExecuteFunction (
Action=0x140001850 "Function ExitFunction", tmp_win=0x0,
eventp=0x140004980, context=8, Module=-1) at functions.c:183
#3 0x120020600 in Done (restart=0, command=0x0) at fvwm.c:1076
#4 0x120020948 in CatchFatal (dpy=0x140008000) at fvwm.c:1149
#5 0x3ff80485cf4 in _XIOError ()
#6 0x3ff80482054 in _XRead ()
#7 0x3ff80483664 in _XReply ()
#8 0x3ff8047b6a0 in XSync ()
#9 0x12002760c in Destroy (Tmp_win=0x14005d300) at misc.c:116
#10 0x12001bc48 in HandleUnmapNotify () at events.c:931
#11 0x120019e78 in DispatchEvent () at events.c:232
#12 0x120019ed8 in HandleEvents () at events.c:253
#13 0x12001ebd0 in main (argc=1, argv=0x11ffff9a8) at fvwm.c:447
(gdb)
The reason whas, that I had an "ExitFunction" defined which was
supposed to kill FvwmButton. I saw this in a posting in the list
and though it might be good idea. Actually when the ExitFunction
was defined, ExecuteFunction is called which in turn makes some
X calls again which dump core since the connection is already
broken.
2.) Now for the looping problem. As expected, I get a SIGPIPE when X
is killed. When I execute the SIGPIPE Handler with "signal 13"
(13 = SIGPIPE) I found that this:
struct stat buf;
if (fstat(XConnectionNumber(dpy), &buf) == -1) exit(1);
is not working! The program does not exit. Instead:
signal(SIGPIPE, DeadPipe);
is executed and the program continues.
Now the program loops and eats cpu time. When I interrupt it with
the debugger I get the following traceback:
(gdb) bt
#0 0x3ff80481398 in _XFlush ()
#1 0x3ff80485fd4 in _XData32 ()
#2 0x3ff80472888 in XConfigureWindow ()
#3 0x120010e0c in SetupFrame (tmp_win=0x14006af20, x=79, y=1055,w=921,
h=981, sendEvent=1) at borders.c:1154
#4 0x120034408 in MoveViewport (newx=0, newy=0, grab=0) at virtual.c:393
#5 0x1200205b0 in Done (restart=0, command=0x0) at fvwm.c:1071
#6 0x120020948 in CatchFatal (dpy=0x140008000) at fvwm.c:1149
#7 0x3ff80485cf4 in _XIOError ()
#8 0x3ff80481614 in _XFlush ()
#9 0x3ff804835fc in _XReply ()
warning: Hit heuristic-fence-post without finding
warning: enclosing function for address 0x4a40537248019600
Apparently "CatchFatal" is correctly called but in turn calls
X functions and ends up in XFlush which sits there and loops.
XFlush never returns.
Examining the source reveals that the 'Done' routine does:
#ifndef NON_VIRTUAL
MoveViewport(0,0,False);
#endif
I don't know what this is for but it is definately the reason
for the troubles.
So all in all I come to the following conclusions:
a.) ExitFunctions are not good !! The can cause fvwm2 to dump core
when exiting!
b.) The MoveViewPort call in 'Done' is the reason for the troubles.
I don't have too much insight in fvwm to decide if its appropriate just
to remove this call from the 'Done' routine.
So how can we solve the problem?
Thanks for your help everybody -- Tom
--------------------------------------------------------------------------
T o m L e i t n e r Dept. of Communications
Graz University of Technology,
e-mail : tom_at_finwds01.tu-graz.ac.at Inffeldgasse 12
Phone : +43-316-873-7455 A-8010 Graz / Austria / Europe
Fax : +43-316-463-697
Home page :
http://wiis.tu-graz.ac.at/people/tom.html
PGP public key on :
ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send
mail with subject "get Thomas Leitner" to pgp-public-keys_at_keys.pgp.net
--------------------------------------------------------------------------
--
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Sep 11 1996 - 02:52:54 BST