[comp.sys.hp] ctrl-c in xdb makes starbase / X lock up

hzatz@nntp-server.caltech.edu (Harold R. Zatz) (12/01/90)

I'm running HP/UX 7.0 on an HP 9000/835, with a hp98731 graphics
accelerator and HP's distribued X11R3. (whew) My X server is
running in the 98731's overlay planes.

I've repeatedly noticed that while debugging a program with xdb,
if you hit ctrl-C while the program is in the midst of starbase
calls, the computer will lock up. The pointer doesn't move, and
the offending process must be killed from another terminal.

When the process is killed, xdb always notes that the process was
stopped at about the same place:

interrupt (ignore) at 0x000922b4
(file unknown): _hp_davinci_wait +0x0000005c: (line unknown)
>

Does anyone know a way around this bug so that I can debug programs
that use starbase?

Thanks much,
--Harold
-- 
"Twas brillig and the slithy toves --This space available for rent--
Did gyre and gimble in the wabe;   BITnet:    hzatz@citromeo.bitnet
All mimsy were the borogoves,      Internet:  hzatz@bruno.graphics.cornell.edu
And the mome raths, outgrabe..."   USmail:    232 Linden Ave. Apt. #2

stroyan@hpfcso.HP.COM (Mike Stroyan) (12/03/90)

> I've repeatedly noticed that while debugging a program with xdb,
> if you hit ctrl-C while the program is in the midst of starbase
> calls, the computer will lock up. The pointer doesn't move, and
> the offending process must be killed from another terminal.

Starbase programs and the X server are sharing one display board.  To do
this without messing up the hardware state for each other, they use a
semaphore to lock out other processes while they set up and use the
display registers.  When you hit break, the debugger caught the program
with the semaphore held.  This wouldn't be a problem, except that the
debugger is running to a terminal emulator that uses the X server on
that same display.  You now have a deadlock.  The debugger is waiting
for the display semaphore while the Starbase program is waiting for the
debugger to restart it.

To avoid this situation you need to either run the debugger on a
different display or refrain from hitting the break key in the debugger.

Mike Stroyan, mike_stroyan@fc.hp.com