ERROR: GateKeeper error!message when you exit
GateKeepers are objects that are used to ensure atomic operations within the Ptolemy kernel. The Ptolemy error handling routines use
GateKeepersto 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
tycho. The static function
Error::erroris defined in several places, and which definition we get depends on the order of the libraries. (See $
$PTOLEMY/src/tycho/tysh/TyError.cc). Each implementation defines a static instance
You will see the
ERROR: GateKeeper error!message when you exit if there is more than one
gate, and the destructor is called twice for
Under HPUX10.x, the error message is produced if
libptolemyis static and the other lib (
libtysh) is shared. Here the work around is to make the other library static too.
The way to debug
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 foointo a