[comp.windows.x] R4 server question

kaleb@mars.jpl.nasa.gov (Kaleb Keithley) (01/19/90)

I have found a something in the server that I think is unusual,
and maybe a problem.  I'd appreciate any comments, especially from the
folks at Sun who seem to have written the mfb, cfb, and mi code, or anyone
at expo.

Specifically, in ddx/mi, mibstore.c makes a call to AllocateGCPrivate
in miInitializeBackingStore, with the amount set to zero.  The other two
calls to AllocateGCPrivate specify sizeof (relevant structure) for the
amount parameter.  Since this call is the second (of three) calls to
AllocateGCPrivate, when the third call is made, it appears that the
third private structure overlays the second.  The resulting effect is that
function pointers set in second private get wiped out when things get set
in the third private.  This only seems to be a problem the second time
through AddScreen.

After the privates have been initialized, when CreateDefaultStipple gets
called on the second trip through AddScreen, an attempt to call a function
in the private raises an illegal instruction exception, because the good
function pointer was wiped out.  As an experiment, I changed the allocation
to specify sizeof (relevant structure).  This is only partly successful,
the initialization completes, the server accepts client connections, etc,
however, when a client window is moved, the server generates a bus error
with the usual catastrophic results.

I might add that I'm using a Sun 4/260, running SunOS 4.0.3.  Compiled
with gcc 1.36, with the four requisite files compiled with cc.  The only
changes to source were in ddx/sun/sunInit.c, where I changed sunFbdata
from the six or seven different devices with their corresponding probes
and creates, to two cgtwos, with matching cgtwo probes and creates.

I'm hesitant to submit this as a bug to xbugs just yet, but will if
response indicates that I should.

Chewey, get us outta here!
                 
kaleb@mars.jpl.nasa.gov             (818)354-8771
Kaleb Keithley