When first installed, nethack would dump core immediately after
opening its window. This behavior persisted through several trials,
including some debuging runs and a recompile, after which it suddenly
started working. After the X maintainer installed the X fonts, it
crashed again the first time I tried to use them (which was also the
first time I had any nethack-specific resources defined), then worked
fine thereafter.
Using gdb (and without special fonts or resources), I determined what
was happening:
1) init_standard_windows() calls create_message_window() to create
the window for the informative messages ("You die..." and friends).
It allocates a window and, among other things, sets its size to
420x156 (or so) pixels.
2) A little further on, init_standard_windows() calls
set_message_height(). This routine figures out how large
the window should be to display as many lines as the program
wants in the window.
3) set_message_height() calculates the new height, sets up an
argument for the change, and calls XtSetValues() to perform
the change.
4) This triggers bunches of calls to mesg_resized(), a callback
function which tracks the window size and resizes a circular
buffer. On each call, the width of the window is reduced
15 pixels.
5) Eventually the window has a width of 1 pixel and the
XtSetValues() call returns.
6) Some time later, the first line of text ("NetHack") is printed
in the window. The routine which does this sees that it's
too wide for the window and tries to break it at a space.
Since there's no place to break it, the routine eventually
calls panic().
[ 7) I eventually get a second panic due to a write failure, but
I think that's irrelevant.]
From later debugging sessions I gather that the shrinking-window
behavior is expected but that something should come along and make it
bigger eventually.
The strangest part of this is that, like I said, it was initially
repeatable but has now gone away completely.
Any idea what's happening?
--
Kenneth Herron khe...@ms.uky.edu
University of Kentucky +1 606 257 2975
Dept. of Mathematics "Your ball goes over them, it sails off the edge into a
huge cauldren of fire-breathing dragons." "And they call this a par three?"