Top Up Prev Next Bottom Contents Index Search

D.5 GateKeeper Error

If there are problems with shared libraries, then you may see

ERROR: GateKeeper error! 
message when you exit pigi.

GateKeepers are objects that are used to ensure atomic operations within the Ptolemy kernel. The Ptolemy error handling routines use GateKeepers to ensure that the error messages are not garbled by two errors trying to write to the screen at once.

Say we have two files that make up two different libraries, and both contain the line:

KeptGate gate;
With static libraries, the linker will resolve gate to one address and call the constructor once. The destructor will also be called once.

With shared libraries, there are two instances of this variable, so the constructor and the destructor get called twice.

The problem is that there are several different implementations of the error routines depending on if we are running under pigi, ptcl or tycho. The static function Error::error is defined in several places, and which definition we get depends on the order of the libraries. (See $PTOLEMY/src/kernel/Error.[cc,h], $PTOLEMY/src/pigilib/, $PTOLEMY/src/ptcl/ and $PTOLEMY/src/tycho/tysh/ Each implementation defines a static instance gate of KeptGate.

You will see the ERROR: GateKeeper error! message when you exit if there is more than one KeptGate gate, and the destructor is called twice for gate.

Under HPUX10.x, the error message is produced if libptolemy is static and the other lib (libpigi, libptcl, libtysh) is shared. Here the work around is to make the other library static too.

The way to debug GateKeeper Error! problems is to set breakpoints in Error::error, and then trigger an error and make sure that the right error routine in the right file is being called. One quick way to trigger an error is to set the current domain to a non-existent domain. Try typing domain foo into a pigi -console, ptcl or
tycho -ptiny

Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.