From e46334eddf0df9760098070c4191e76bb764c3f5 Mon Sep 17 00:00:00 2001 From: koennecke Date: Thu, 8 May 2008 09:27:48 +0000 Subject: [PATCH] - Fixed a massive memory leak in Hipadaba - Extended the Hdb adapter to support SICSdata - Made the simulated histogram memory driver work properly when data has been set. - Implemented the hfactory command - Removed hdbcommand which was never finsihed --- exeman.c | 1 + hdbcommand.c | 291 ------------------------- hdbcommand.h | 96 --------- hipadaba.c | 14 +- histsim.c | 2 +- macro.c | 5 +- make_gen | 4 +- makefile_slinux | 2 +- mumo.c | 1 + ofac.c | 3 + proxy.c | 472 +++++++++++++++++++++++++++++++++++++++++ proxy.h | 17 ++ sicshdbadapter.c | 164 +++++++++++++- sicshdbfactory.c | 348 ++++++++++++++++++++++++++++++ sicshipadaba.c | 55 ++++- sicsobj.c | 26 ++- sicsobj.h | 8 +- simcter.c | 4 +- tasscanub.c | 16 +- val.lis | 539 ++++++----------------------------------------- 20 files changed, 1167 insertions(+), 901 deletions(-) delete mode 100644 hdbcommand.c delete mode 100644 hdbcommand.h create mode 100644 proxy.c create mode 100644 proxy.h create mode 100644 sicshdbfactory.c diff --git a/exeman.c b/exeman.c index 6f62d3c6..d5415592 100644 --- a/exeman.c +++ b/exeman.c @@ -372,6 +372,7 @@ int exeHdbNode(pHdb exeNode, SConnection *pCon){ SCSetWriteFunc(pCon,oldWrite); SCPopContext(pCon); exeBufDelete(buffer); + free(name); if(strlen(log->value.v.text) < 2){ v = MakeHdbText(strdup("OK\n")); UpdateHipadabaPar(log,v,pCon); diff --git a/hdbcommand.c b/hdbcommand.c deleted file mode 100644 index 5308322c..00000000 --- a/hdbcommand.c +++ /dev/null @@ -1,291 +0,0 @@ -/** - * This module implements a generalized scheme for executing functions. - * Functions are described by a special data structure containing the - * parameters as a Hipadaba list and and an execute function which implements - * the actual operation. This is augmented by list mechanisms in order to - * allow for a list of functions. This shall facilitate a couple of things: - * - when functions are defined in such a structured form, general invocation - * functions can be devised for handling the interpreter interface. - * - The set of functions of an object can be configured and extended at - * runtime. - * - A common usage case: execute a function with the same arguments, can be - * easily catered for. - * All this is not new and was pioneered in the language self or other - * dynamic object systems. - * - * copyright: see file COPYRIGHT - * - * Mark Koennecke, September 2006 - */ -#include -#include -#include -#include -#include -/*-------------------------------------------------------------------------*/ -static int debug = 1; -/* ============================= live and death ============================*/ -pHdbCommand CreateHdbCommand(char *name, int (*execute)(pHdb parameters)){ - pHdbCommand result = NULL; - - assert(name != NULL); - assert(execute != NULL); - - result = malloc(sizeof(hdbCommand)); - if(result == NULL){ - return NULL; - } - memset(result,0,sizeof(hdbCommand)); - result->name = strdup(name); - if(result->name == NULL){ - free(result); - return NULL; - } - result->execute = execute; - return result; -} -/*--------------------------------------------------------------------------*/ -void AppendHdbCommandToList(pHdbCommand commandList, pHdbCommand command){ - pHdbCommand current = NULL; - - assert(commandList != NULL); - assert(command != NULL); - - current = commandList; - while(current->next != NULL){ - current = (pHdbCommand)current->next; - } - command->previous = (struct __hdbCommand *)current; - current->next = (struct __hdbCommand *)command; - command->next = NULL; -} -/*--------------------------------------------------------------------------*/ -void AppendCommandParameter(pHdbCommand command, pHdb par){ - assert(command != NULL); - assert(par != NULL); - - AddHipadabaChild(command->parameters,par,NULL); -} -/*--------------------------------------------------------------------------*/ -void KillHdbCommandList(pHdbCommand commandList){ - pHdbCommand next = NULL, current = NULL; - - assert(commandList != NULL); - - current = commandList; - next = (pHdbCommand)current->next; - while(current != NULL){ - if(current->name != NULL){ - free(current->name); - } - if(current->parameters != NULL){ - DeleteHipadabaNode(current->parameters,NULL); - } - free(current); - current = next; - if(current != NULL){ - next = (pHdbCommand)current->next; - } else { - next = NULL; - } - } -} -/*======================= Invocation =======================================*/ -static pHdbCommand locateCommand(pHdbCommand commandList, char *name){ - pHdbCommand current = NULL; - - current = commandList; - while(current != NULL){ - if(strcmp(current->name,name) == 0) { - return current; - } - current = (pHdbCommand)current->next; - } - return NULL; -} -/*---------------------------------------------------------------------------*/ -int HdbCommandInvoke(pHdbCommand commandList, char *name, ...){ - va_list ap; - pHdbCommand toInvoke = NULL; - pHdb currentPar = NULL; - char *txt = NULL; - hdbValue *v = NULL; - - va_start(ap,name); - toInvoke = locateCommand(commandList,name); - if(toInvoke == NULL){ - return HDBCOMNOCOM; - } - - currentPar = toInvoke->parameters; - while(currentPar != NULL){ - /* - * I cannot call a function for this as ap would be undefined after - * a call to a function here - */ - switch(currentPar->value.dataType){ - case HIPNONE: - break; - case HIPINT: - currentPar->value.v.intValue = va_arg(ap,int); - if(debug == 1){ - printf("Read %d for parameter %s\n", - currentPar->value.v.intValue, currentPar->name); - } - break; - case HIPFLOAT: - currentPar->value.v.doubleValue = va_arg(ap,double); - if(debug == 1){ - printf("Read %lf for parameter %s\n", - currentPar->value.v.doubleValue, currentPar->name); - } - break; - case HIPTEXT: - txt = va_arg(ap,char *); - if(currentPar->value.v.text != NULL){ - free(currentPar->value.v.text); - } - currentPar->value.v.text = strdup(txt); - if(debug == 1){ - printf("Read %s for parameter %s\n", - currentPar->value.v.text, currentPar->name); - } - break; - case HIPOBJ: - currentPar->value.v.obj = va_arg(ap,void *); - break; - case HIPINTAR: - case HIPINTVARAR: - case HIPFLOATAR: - case HIPFLOATVARAR: - v = (hdbValue *)va_arg(ap,void *); - copyHdbValue(v,¤tPar->value); - break; - default: - assert(0); - break; - - } - currentPar = currentPar->next; - } - va_end(ap); - return toInvoke->execute(toInvoke->parameters); -} -/*-------------------------------------------------------------------------*/ -static void *(*objMap)(char *name) = NULL; -/*-------------------------------------------------------------------------*/ -void SetHdbComObjMapper(void *(*mapObj)(char *name)){ - objMap = mapObj; -} -/*-------------------------------------------------------------------------*/ -static int readParArguments(pHdb parNode, int argc, char *argv[]){ - int i, intVal; - double doVal; - - switch(parNode->value.dataType){ - case HIPNONE: - return 0; - break; - case HIPINT: - if(argc < 1){ - return HDBCOMNOARGS; - } - if(sscanf(argv[0],"%d",&parNode->value.v.intValue) != 1){ - return HDBCOMBADARG; - } - return 1; - break; - case HIPFLOAT: - if(argc < 1){ - return HDBCOMNOARGS; - } - if(sscanf(argv[0],"%lf",&parNode->value.v.doubleValue) != 1){ - return HDBCOMBADARG; - } - return 1; - break; - case HIPOBJ: - if(objMap != NULL){ - parNode->value.v.obj = objMap(argv[0]); - if(parNode->value.v.obj == NULL){ - return HDBCOMBADOBJ; - } else { - return 1; - } - } - return 0; - break; - case HIPTEXT: - if(argc < 1){ - return HDBCOMNOARGS; - } - if(parNode->value.v.text != NULL){ - free(parNode->value.v.text); - } - parNode->value.v.text = strdup(argv[0]); - return 1; - break; - case HIPINTAR: - if(parNode->value.arrayLength > argc){ - return HDBCOMNOARGS; - } - for(i = 0; i < parNode->value.arrayLength; i++){ - if(sscanf(argv[i],"%d",&intVal) != 1){ - return HDBCOMBADARG; - } - parNode->value.v.intArray[i] = intVal; - } - return parNode->value.arrayLength; - break; - case HIPFLOATAR: - if(parNode->value.arrayLength > argc){ - return HDBCOMNOARGS; - } - for(i = 0; i < parNode->value.arrayLength; i++){ - if(sscanf(argv[i],"%lf",&doVal) != 1){ - return HDBCOMBADARG; - } - parNode->value.v.floatArray[i] = doVal; - } - return parNode->value.arrayLength; - break; - default: - /* - * I cannot process such variables - */ - return HDBCOMINVARG; - break; - } - return 0; -} -/*--------------------------------------------------------------------------*/ -int HdbCommandTextInvoke(pHdbCommand commandList, int argc, char *argv[]){ - pHdbCommand toInvoke = NULL; - pHdb currentPar = NULL; - int argPointer, status; - - assert(commandList != NULL); - - if(argc < 1){ - return HDBCOMNOARGS; - } - - toInvoke = locateCommand(commandList,argv[0]); - if(toInvoke == NULL){ - return HDBCOMNOCOM; - } - - currentPar = toInvoke->parameters; - argPointer = 1; - while(currentPar != NULL){ - status = readParArguments(currentPar,argc-argPointer, - &argv[argPointer]); - if(status < 0){ - return status; - } else { - argPointer += status; - } - currentPar = currentPar->next; - } - return toInvoke->execute(toInvoke->parameters); -} diff --git a/hdbcommand.h b/hdbcommand.h deleted file mode 100644 index b1b8285f..00000000 --- a/hdbcommand.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This module implements a generalized scheme for executing functions. - * Functions are described by a special data structure containing the - * parameters as a Hipadaba list and and an execute function which implements - * the actual operation. This is augmented by list mechanisms in order to - * allow for a list of functions. This shall facilitate a couple of things: - * - when functions are defined in such a structured form, general invocation - * functions can be devised for handling the interpreter interface. - * - The set of functions of an object can be configured and extended at - * runtime. - * - A common usage case: execute a function with the same arguments, can be - * easily catered for. - * All this is not new and was pioneered in the language self or other - * dynamic object systems. - * - * copyright: see file COPYRIGHT - * - * Mark Koennecke, September 2006 - */ -#ifndef HDBCOMMAND_H_ -#define HDBCOMMAND_H_ -#include -#include -/*--------------- error codes ----------------------------------------------*/ -#define HDCOMNOMEM -7801 -#define HDBCOMNOCOM -7802 -#define HDBCOMNOARGS -7803 -#define HDBCOMBADARG -7804 -#define HDBCOMINVARG -7805 -#define HDBCOMBADOBJ -7806 -/*---------------------------------------------------------------------------*/ -typedef struct __hdbCommmand { - char *name; - pHdb parameters; - int (*execute)(pHdb parameters); - struct __hdbCommand *next; - struct __hdbCommand *previous; -}hdbCommand, *pHdbCommand; -/*======================= live and death ===================================*/ -/** - * create a hdbCommand with an empty parameter list - * @param name The name of teh command - * @param execute The execute function for this command - * @return a fresh hdbCommand or NULL when out of memory - * */ -pHdbCommand CreateHdbCommand(char *name, int (*execute)(pHdb parameters)); -/** - * append a hdbCommand to a command list - * @param commandList The list to append the command to - * @param command The command to append - * @return 1 on success, a negative error code else. - */ -void AppendHdbCommandToList(pHdbCommand commandList, pHdbCommand command); -/** - * append a parameter to the parameter list - * @param command The command to append the parameter too - * @param par The parameter to append - */ -void AppendCommandParameter(pHdbCommand command, pHdb par); -/** - * delete a command list recursively - * @param commandList The command list to delete - */ -void KillHdbCommandList(pHdbCommand commandList); -/*===================== invocation ========================================*/ -/** - * invoke a hdbCommand name. This does a lot: it locates the command, - * it assigne the parameter values and finally calls the execute function. - * @param commandList The command list in which to search for the command - * @param name The name of the command - * @param ... arguments to the command. ints, double, text and objects (pointers) - * are accepted as is.Arrays have to be passed in a pointers to a - * hdbValue structure. Otherwise there is not eonough information to safely - * copy array data. - * @return Negative error codes on invocation error, else the return - * value of the execute function. - */ -int HdbCommandInvoke(pHdbCommand commandList, char *name, ...); -/** - * invoke a hdbCommand name. This does a lot: it locates the command, - * it assigne the parameter values and finally calls the execute function. - * The name of the command must be in argv[0] - * @param commandList The command list in which to search for the command - * @param argc The number of arguments - * @param argv[] An array of strings holding the argument data - * @return Negative error codes on invocation error, else the return - * value of the execute function. - */ -int HdbCommandTextInvoke(pHdbCommand commandList, int argc, char *argv[]); -/** - * set a mapper which returns a void pointer for a name in order to resolve - * object references - * @param mapfunc - */ -void SetHdbComObjMapper(void *(*mapObj)(char *name)); -#endif /*HDBCOMMAND_H_*/ diff --git a/hipadaba.c b/hipadaba.c index 0de04f67..20308d59 100644 --- a/hipadaba.c +++ b/hipadaba.c @@ -402,7 +402,7 @@ hdbValue MakeHdbText(char *initText){ hdbValue result; result.dataType = HIPTEXT; - result.v.text = initText; + result.v.text = strdup(initText); result.arrayLength = strlen(initText); return result; } @@ -854,7 +854,8 @@ int copyHdbValue(hdbValue *source, hdbValue *target){ if(target->v.intArray == NULL){ return 0; } - memset(target->v.intArray,0,source->arrayLength * sizeof(int)); + memset(target->v.intArray,0,source->arrayLength + * sizeof(int)); target->arrayLength = source->arrayLength; } if(source->v.intArray != NULL){ @@ -865,15 +866,18 @@ int copyHdbValue(hdbValue *source, hdbValue *target){ break; case HIPFLOATAR: case HIPFLOATVARAR: - if(target->arrayLength != source->arrayLength || target->v.floatArray == NULL){ + if(target->arrayLength != source->arrayLength + || target->v.floatArray == NULL){ if(target->v.floatArray != NULL){ free(target->v.floatArray); } - target->v.floatArray = malloc(source->arrayLength * sizeof(double)); + target->v.floatArray = + malloc(source->arrayLength * sizeof(double)); if(target->v.floatArray == NULL){ return 0; } - memset(target->v.floatArray,0,source->arrayLength * sizeof(double)); + memset(target->v.floatArray,0,source->arrayLength * + sizeof(double)); target->arrayLength = source->arrayLength; } if(source->v.floatArray != NULL){ diff --git a/histsim.c b/histsim.c index be6a0d79..11e6b5bc 100644 --- a/histsim.c +++ b/histsim.c @@ -208,7 +208,7 @@ resizeBuffer(self->data); } iSetVal = lData[0]; - if(iEnd < getHMDataLength(self->data)){ + if(iEnd <= getHMDataLength(self->data)){ memcpy(self->data->localBuffer+iStart,lData,(iEnd - iStart)*sizeof(HistInt)); } return 1; diff --git a/macro.c b/macro.c index 81837df4..bc3a10e5 100644 --- a/macro.c +++ b/macro.c @@ -1040,7 +1040,7 @@ extern int Nxinter_SafeInit(Tcl_Interp *pTcl); /* from Swig NeXus Tcl interface pPubTcl pNew = NULL; char pBueffel[132]; int iUser, i, iRet; - + /* check no of args */ if(argc < 3) { @@ -1059,6 +1059,7 @@ extern int Nxinter_SafeInit(Tcl_Interp *pTcl); /* from Swig NeXus Tcl interface return 0; } + /* try convert last parameter to user code */ iUser = decodeSICSPriv(argv[2]); if(iUser < 0) @@ -1074,7 +1075,7 @@ extern int Nxinter_SafeInit(Tcl_Interp *pTcl); /* from Swig NeXus Tcl interface if (pNew) { /* yes -> overwrite access code */ pNew->iUser = iUser; - return 0; + return 1; } /* do a job !*/ pNew = CreatePublish(argv[1],iUser); diff --git a/make_gen b/make_gen index 3513e9bd..c4ea991d 100644 --- a/make_gen +++ b/make_gen @@ -32,8 +32,8 @@ SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ mcstashm.o initializer.o remob.o tclmotdriv.o protocol.o \ sinfox.o sicslist.o cone.o hipadaba.o sicshipadaba.o statistics.o \ ascon.o errormsg.o scriptcontext.o logger.o logreader.o logsetup.o \ - savehdb.o statusfile.o \ - moregress.o hdbcommand.o multicounter.o regresscter.o histregress.o \ + savehdb.o statusfile.o sicshdbfactory.o proxy.o \ + moregress.o multicounter.o regresscter.o histregress.o \ sicshdbadapter.o polldriv.o sicspoll.o statemon.o hmslave.o \ nwatch.o asyncqueue.o asyncprotocol.o sicsobj.o \ nxcopy.o nxinterhelper.o nxinter_wrap.o genericcontroller.o nxstack.o diff --git a/makefile_slinux b/makefile_slinux index 06a7df27..5435aa63 100644 --- a/makefile_slinux +++ b/makefile_slinux @@ -15,7 +15,7 @@ include sllinux_def CC = gcc CFLAGS = -I$(HDFROOT)/include -DNXXML -DHDF4 -DHDF5 $(NI) \ - -Ipsi/hardsup -I. \ + -Ipsi/hardsup -I. \ -Werror -DCYGNUS -DNONINTF -g $(DFORTIFY) \ -Wall -Wno-unused -Wno-comment -Wno-switch diff --git a/mumo.c b/mumo.c index 3fbb3ad8..d3b8c406 100644 --- a/mumo.c +++ b/mumo.c @@ -872,6 +872,7 @@ static void RecoverNamPos(pMulMot self, int argc, char *argv[]) sprintf(pBueffel,"%s list of known named positions \n", argv[0]); Tcl_DStringAppend(&tString,pBueffel,strlen(pBueffel)); + StringDictKillScan(self->pNamPos); pPtr = StringDictGetNext(self->pNamPos,pError,131); while(pPtr != NULL) { diff --git a/ofac.c b/ofac.c index 2e7788dc..9c5a5061 100644 --- a/ofac.c +++ b/ofac.c @@ -128,6 +128,7 @@ #include "sicsobj.h" #include "hdbqueue.h" #include "genericcontroller.h" +#include "proxy.h" /*----------------------- Server options creation -------------------------*/ static int IFServerOption(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]) @@ -348,6 +349,7 @@ /* AddCommand(pInter,"MakeHdbQueue",MakeHDBQueue,NULL,NULL); */ AddCommand(pInter,"MakeGenController",GenControllerFactory,NULL,NULL); AddCommand(pInter,"genconfigure",GenControllerConfigure,NULL,NULL); + AddCommand(pInter,"MakeProxy",ProxyFactory,NULL,NULL); /* install site specific commands @@ -422,6 +424,7 @@ RemoveCommand(pSics,"MakeSicsObject"); RemoveCommand(pSics,"MakeGenController"); RemoveCommand(pSics,"genconfigure"); + RemoveCommand(pSics,"MakeProxy"); /* remove site specific installation commands */ diff --git a/proxy.c b/proxy.c new file mode 100644 index 00000000..1a388030 --- /dev/null +++ b/proxy.c @@ -0,0 +1,472 @@ +/** + * This is the implementation of a SICS object which really is a placeholder + * for another one. It shall be used in Hipadaba for sample enviornment + * devices. This is also the reason why the objectNode is supposed to be + * double. + * + * copyright: see file COPYRIGHT + * + * Mark Koennecke, March 2008 + * + */ +#include +#include +#include +/*-----------------------------------------------------------------------*/ +typedef struct { + pIDrivable pDriv; + pEVInterface pEnv; + pIDrivable pSlaveDriv; + void *slaveData; + pEVInterface pEnvSlave; +} ProxyInt, *pProxyInt; +/*------------------------------------------------------------------------*/ +static void KillProxyInt(void *data){ + pProxyInt proxy = (pProxyInt)data; + + if(proxy == NULL){ + return; + } + if(proxy->pDriv != NULL){ + free(proxy->pDriv); + } + if(proxy->pEnv != NULL){ + free(proxy->pEnv); + } + free(proxy); +} +/*===================== Drivable Interfaces ================================*/ +static int testDrivProxy(pSICSOBJ self){ + pProxyInt proxy = self->pPrivate; + + if(proxy->pSlaveDriv != NULL && proxy->slaveData != NULL){ + return 1; + } + return 0; +} +/*-----------------------------------------------------------------------*/ +static int ProxyHalt(void *data){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testDrivProxy(self)){ + return proxy->pSlaveDriv->Halt(proxy->slaveData); + } else { + return 0; + } +} +/*------------------------------------------------------------------------*/ +static int ProxyLimits(void *data, float fval, + char *error, int iErrLen){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testDrivProxy(self)){ + return proxy->pSlaveDriv->CheckLimits(proxy->slaveData, fval, + error, iErrLen); + } else { + strncpy(error,"ERROR: device not configured",iErrLen); + return 0; + } +} +/*-----------------------------------------------------------------------*/ +static long ProxySet(void *data, SConnection *pCon, float fVal){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testDrivProxy(self)){ + return proxy->pSlaveDriv->SetValue(proxy->slaveData, + pCon, fVal); + } else { + SCWrite(pCon,"ERROR: device not configured", eError); + return 0; + } +} +/*-----------------------------------------------------------------------*/ +static int ProxyStatus(void *data, SConnection *pCon){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testDrivProxy(self)){ + return proxy->pSlaveDriv->CheckStatus(proxy->slaveData, + pCon); + } else { + SCWrite(pCon,"ERROR: device not configured", eError); + return HWFault; + } +} +/*-----------------------------------------------------------------------*/ +static float ProxyGet(void *data, SConnection *pCon){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testDrivProxy(self)){ + return proxy->pSlaveDriv->GetValue(proxy->slaveData, pCon); + } else { + SCWrite(pCon,"ERROR: device not configured", eError); + return HWFault; + } +} +/*===================== environment interface ==========================*/ +static int testEnvProxy(pSICSOBJ self){ + pProxyInt proxy = self->pPrivate; + + if(proxy->pEnvSlave != NULL && proxy->slaveData != NULL){ + return 1; + } + return 0; +} +/*-----------------------------------------------------------------------*/ +static EVMode ProxyMode(void *data){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testEnvProxy(self)){ + return proxy->pEnvSlave->GetMode(proxy->slaveData); + } else { + return EVError; + } +} +/*------------------------------------------------------------------------*/ +static int ProxyTolerance(void *data){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testEnvProxy(self)){ + return proxy->pEnvSlave->IsInTolerance(proxy->slaveData); + } else { + return 0; + } +} +/*-------------------------------------------------------------------------*/ +static int ProxyError(void *data){ + pSICSOBJ self = (pSICSOBJ)data; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + assert(self != NULL); + + if(testEnvProxy(self)){ + return proxy->pEnvSlave->HandleError(proxy->slaveData); + } else { + return 0; + } +} +/*-----------------------------------------------------------------------*/ +static void *findRealDev(pHdb node){ + char realDevice[80]; + CommandList *pCom = NULL; + + GetHdbProperty(node,"proxy",realDevice,80); + pCom = FindCommand(pServ->pSics,realDevice); + if(pCom != NULL){ + return pCom->pData; + } else { + return NULL; + } +} +/*-----------------------------------------------------------------------*/ +static void *ProxyGetInterface(void *pData, int iID){ + pSICSOBJ self = (pSICSOBJ)pData; + pDummy other = NULL; + void *inter = NULL; + pProxyInt proxy = NULL; + + assert(self != NULL); + proxy = self->pPrivate; + + if(self != NULL){ + other = (pDummy)findRealDev(self->objectNode); + if(other != NULL){ + inter = other->pDescriptor->GetInterface(other, iID); + if(inter == NULL && + (iID == DRIVEID || iID == ENVIRINTERFACE) ){ + proxy->pEnvSlave = NULL; + proxy->pSlaveDriv = NULL; + proxy->slaveData = NULL; + return NULL; + } else { + if(iID == DRIVEID){ + proxy->pSlaveDriv = inter; + proxy->slaveData = other; + return proxy->pDriv; + } else if(iID == ENVIRINTERFACE){ + proxy->pEnvSlave = inter; + proxy->slaveData = other; + return proxy->pEnv; + } + } + return inter; + } + } + return NULL; +} +/*------------------------------------------------------------------------*/ +static hdbCallbackReturn ProxyCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage get = NULL, set = NULL; + pDummy other = NULL; + pIDrivable pDriv = NULL; + float fval; + int status; + SConnection *pCon = NULL; + pSICSOBJ self = (pSICSOBJ)userData; + char proxyDev[80]; + + get = GetHdbGetMessage(message); + if(get != NULL){ + pCon = (SConnection *)get->callData; + other = (pDummy)findRealDev(node); + if(other != NULL){ + pDriv = other->pDescriptor->GetInterface(other,DRIVEID); + if(pDriv != NULL && pCon != NULL){ + fval = pDriv->GetValue(other, pCon); + get->v->v.doubleValue = (double)fval; + node->value.v.doubleValue = (double)fval; + return hdbContinue; + } + } + get->v->v.doubleValue = .0; + } + + set = GetHdbSetMessage(message); + if(set != NULL){ + pCon = (SConnection *)set->callData; + other = (pDummy)findRealDev(node); + if(other == NULL){ + if(pCon != NULL){ + SCWrite(pCon,"ERROR: device not configured", eError); + return hdbAbort; + } + } + GetHdbProperty(node,"proxy", proxyDev,80); + status = StartDevice(pServ->pExecutor, proxyDev, + self->pDes, self, pCon, (float)set->v->v.doubleValue); + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } + } + + return hdbContinue; +} +/*----------------------------------------------------------------------------*/ +static hdbCallbackReturn MapParCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage get = NULL, set = NULL; + CommandList *pCom = NULL; + SConnection *pCon = NULL; + char mapPar[80], proxyDev[80], *pData = NULL; + char command[1024]; + pDynString data = NULL; + + GetHdbProperty(node->mama, "proxy", proxyDev,80); + pCom = FindCommand(pServ->pSics, proxyDev); + if(pCom == NULL){ + if(pCon != NULL){ + SCWrite(pCon,"ERROR: device not configured", eError); + } + return hdbContinue; + } + GetHdbProperty(node,"mappar", mapPar, 80); + + get = GetHdbGetMessage(message); + if(get != NULL){ + pCon = (SConnection *)get->callData; snprintf(command,1024,"%s %s", proxyDev, mapPar); + if(pCon != NULL){ + SCStartBuffering(pCon); + InterpExecute(pServ->pSics, pCon,command); + data = SCEndBuffering(pCon); + if(data != NULL){ + pData = GetCharArray(data); + if(strstr(pData,"ERROR") != NULL){ + SCWrite(pCon,pData,eError); + } else { + pData = strchr(pData,(int)'='); + if(pData != NULL){ + pData++; + if(!readHdbValue(get->v, pData, command, 1024)){ + SCWrite(pCon, command, eError); + } + copyHdbValue(get->v, &node->value); + return hdbContinue; + } + } + } + } + } + + set = GetHdbSetMessage(message); + if(set != NULL){ + pCon = (SConnection *)set->callData; + data = formatValue(*(set->v), node); + if(data != NULL){ + snprintf(command,1024,"%s %s %s", proxyDev, mapPar, + GetCharArray(data)); + DeleteDynString(data); + InterpExecute(pServ->pSics, pCon, command); + } + } + + return hdbContinue; +} +/*-------------------------------------------------------------------------*/ +static int MapFunc(pSICSOBJ self, SConnection *pCon, pHdb commandNode, + pHdb par[], int nPar){ + pHdb node = NULL; + int type; + + if(nPar < 4){ + SCWrite(pCon,"ERROR: not enough arguments to MapFunc", eError); + return 0; + } + + type = convertHdbType(par[2]->value.v.text); + node = MakeHipadabaNode(par[0]->value.v.text, type, 1); + if(node == NULL){ + SCWrite(pCon,"ERROR: out of memory in MapFunc", eError); + return 0; + } + SetHdbProperty(node,"mappar", par[1]->value.v.text); + SetHdbProperty(node,"priv", par[3]->value.v.text); + AppendHipadabaCallback(node, + MakeHipadabaCallback(MapParCallback, NULL, NULL)); + AddHipadabaChild(self->objectNode, node, pCon); + + return 1; +} +/*--------------------------------------------------------------------------*/ +static int ProxyAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]){ + int status; + pSICSOBJ self = (pSICSOBJ)pData; + CommandList *pCom = NULL; + char proxyObj[80]; + + assert(self != NULL); + + /* + * do parameters and object functions + */ + if(argc > 1){ + status = InvokeSICSOBJ(pCon, pSics, pData, argc, argv); + if(status != -1 ){ + return status; + } + } + + /* + * try the interpreter function of the proxy object + */ + GetHdbProperty(self->objectNode,"proxy", proxyObj, 80); + pCom = FindCommand(pSics, proxyObj); + if(pCom != NULL){ + return pCom->OFunc(pCon,pSics,pCom->pData, argc, argv); + } else { + SCWrite(pCon,"ERROR: device not configured", eError); + return 0; + } +} +/*--------------------------------------------------------------------------*/ +int ProxyFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]){ + int type; + pSICSOBJ pNew = NULL; + pHdb mapFunc = NULL; + hdbValue v; + pProxyInt proxy = NULL; + + if(argc < 4){ + SCWrite(pCon,"ERROR: not enough arguments for ProxyFactory", + eError); + return 0; + } + + type = convertHdbType(argv[3]); + pNew = MakeSICSOBJv(argv[1], "ProxyObject", type, usSpy); + if(pNew == NULL){ + SCWrite(pCon,"ERROR: out of memory in ProxyFactory", + eError); + return 0; + } + + proxy = malloc(sizeof(ProxyInt)); + if(proxy == NULL){ + SCWrite(pCon,"ERROR: out of memory in ProxyFactory", + eError); + return 0; + } + memset(proxy,0,sizeof(ProxyInt)); + proxy->pDriv = CreateDrivableInterface(); + proxy->pEnv = CreateEVInterface(); + if(proxy->pDriv == NULL && proxy->pEnv == NULL){ + SCWrite(pCon,"ERROR: out of memory in ProxyFactory", + eError); + return 0; + } + proxy->pDriv->CheckLimits = ProxyLimits; + proxy->pDriv->CheckStatus = ProxyStatus; + proxy->pDriv->GetValue = ProxyGet; + proxy->pDriv->Halt = ProxyHalt; + proxy->pDriv->SetValue = ProxySet; + + proxy->pEnv->GetMode = ProxyMode; + proxy->pEnv->HandleError = ProxyError; + proxy->pEnv->IsInTolerance = ProxyTolerance; + + pNew->KillPrivate = KillProxyInt; + pNew->pPrivate = proxy; + + pNew->pDes->GetInterface = ProxyGetInterface; + SetHdbProperty(pNew->objectNode, "proxy", argv[2]); + AppendHipadabaCallback(pNew->objectNode, + MakeHipadabaCallback(ProxyCallback, pNew,NULL)); + + v = makeHdbData(HIPFUNC,1,MapFunc); + mapFunc = MakeSICSHdbPar("map", usMugger, v); + SetHdbProperty(mapFunc,"visible","false"); + v = MakeHdbText("Undefined"); + AddSICSHdbPar(mapFunc,"name",usMugger,v); + AddSICSHdbPar(mapFunc,"target",usMugger,v); + AddSICSHdbPar(mapFunc,"type",usMugger,v); + AddSICSHdbPar(mapFunc,"priv",usMugger,v); + AddHipadabaChild(pNew->objectNode, mapFunc, pCon); + + AddCommand(pSics,argv[1], + ProxyAction, + KillSICSOBJ, + pNew); + + return 1; +} + diff --git a/proxy.h b/proxy.h new file mode 100644 index 00000000..4afc22cc --- /dev/null +++ b/proxy.h @@ -0,0 +1,17 @@ +/** + * This is the implementation of a SICS object which really is a placeholder + * for another one. It shall be used in Hipadaba for sample enviornment + * devices. This is also the reason why the objectNode is supposed to be + * double. + * + * copyright: see file COPYRIGHT + * + * Mark Koennecke, March 2008 + * + */ +#ifndef PROXY_H_ +#define PROXY_H_ +int ProxyFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + +#endif /*PROXY_H_*/ diff --git a/sicshdbadapter.c b/sicshdbadapter.c index a65c91b8..6fd8169f 100644 --- a/sicshdbadapter.c +++ b/sicshdbadapter.c @@ -25,6 +25,7 @@ #include "lld.h" #include "sicshipadaba.h" #include "sicshdbadapter.h" +#include "sicsdata.h" #define PRIVNAM "priv" /*==================== support code ====================================*/ @@ -309,27 +310,32 @@ static long totalSum(int *data, int length){ return result; } /*----------------------------------------------------------------------*/ +typedef struct { + pHistMem pHM; + long oldSum; +} HMAdapter, *pHMAdapter; +/*-------------------------------------------------------------------------*/ static hdbCallbackReturn HMDataGetCallback(pHdb currentNode, void *userData, pHdbMessage message){ - pHistMem pHM = (pHistMem)userData; + pHMAdapter pHMA = (pHMAdapter)userData; SConnection *pCon = NULL; - long sum1, sum2; + long sum1; pHdbDataMessage mm = NULL; if((mm = GetHdbGetMessage(message)) == NULL){ return hdbContinue; } pCon = mm->callData; - assert(pHM != NULL); + assert(pHMA != NULL && pHMA->pHM != NULL); if(pCon == NULL){ return hdbAbort; } + currentNode->value.arrayLength = GetHistLength(pHMA->pHM); + currentNode->value.v.intArray = (int *)GetHistogramPointer(pHMA->pHM,pCon); sum1 = totalSum(currentNode->value.v.intArray, currentNode->value.arrayLength); - currentNode->value.arrayLength = GetHistLength(pHM); - currentNode->value.v.intArray = (int *)GetHistogramPointer(pHM,pCon); - sum2 = totalSum(currentNode->value.v.intArray, currentNode->value.arrayLength); - if(sum1 != sum2){ + if(sum1 != pHMA->oldSum){ UpdateHipadabaPar(currentNode,currentNode->value,NULL); + pHMA->oldSum = sum1; } return hdbContinue; } @@ -337,14 +343,17 @@ static hdbCallbackReturn HMDataGetCallback(pHdb currentNode, void *userData, static pHdb MakeHMDataNode(pHistMem pHM, char *name){ pHdb node = NULL; pHdbCallback pCall = NULL; - + pHMAdapter pHMA = NULL; node = MakeHipadabaNode(name,HIPINTVARAR,2); - if(node == NULL){ + pHMA = malloc(sizeof(HMAdapter)); + if(node == NULL || pHMA == NULL){ return NULL; } + pHMA->pHM = pHM; + pHMA->oldSum = 0; node->value.doNotFree = 1; - pCall = MakeHipadabaCallback(HMDataGetCallback,pHM,NULL); + pCall = MakeHipadabaCallback(HMDataGetCallback,pHMA,free); if(pCall == NULL){ return NULL; } @@ -498,6 +507,105 @@ static int CounterCallback(int iEvent, void *eventData, void *userData, updateCountList(); } return 1; +}/*=================== SICSData ========================================*/ +static void copyIntSicsData(pHdb node, pSICSData data){ + if(node->value.arrayLength != data->dataUsed){ + if(node->value.v.intArray != NULL){ + free(node->value.v.intArray); + node->value.arrayLength = data->dataUsed; + node->value.v.intArray = malloc(data->dataUsed*sizeof(int)); + if(node->value.v.intArray == NULL){ + node->value.arrayLength = 0; + return; + } + memcpy(node->value.v.intArray, data->data, + data->dataUsed*sizeof(int)); + } + } +} +/*-----------------------------------------------------------------------*/ +static void copyFloatSicsData(pHdb node, pSICSData data){ + int i; + float val; + + if(node->value.arrayLength != data->dataUsed){ + if(node->value.v.floatArray != NULL){ + free(node->value.v.floatArray); + node->value.arrayLength = data->dataUsed; + node->value.v.floatArray = malloc(data->dataUsed*sizeof(double)); + if(node->value.v.floatArray == NULL){ + node->value.arrayLength = 0; + return; + } + for(i = 0; i < data->dataUsed; i++){ + getSICSDataFloat(data,i,&val); + node->value.v.floatArray[i] = val; + } + } + } +} +/*----------------------------------------------------------------------*/ +static hdbCallbackReturn SICSDataCallback(pHdb node, void *userData, + pHdbMessage message){ + pSICSData self = (pSICSData)userData; + pHdbDataMessage mm = NULL; + int i, status; + char script[256], error[1024]; + + assert(self != NULL); + + /* + * I have to make copies because the floats in SICSData + * are floats but doubles in Hipdaba. Siiiigggghhhh! + * But it is cleaner in some way anyway. + */ + if((mm = GetHdbGetMessage(message)) != NULL){ + memset(script,0,256); + if(GetHdbProperty(node,"readscript", script,256) == 1){ + status = Tcl_Eval(InterpGetTcl(pServ->pSics),script); + if(status != TCL_OK){ + snprintf(error,1023,"ERROR: Tcl returned error: %s", + Tcl_GetStringResult(InterpGetTcl(pServ->pSics))); + if(mm->callData != NULL){ + SCWrite((SConnection *)mm->callData, error, eError); + return hdbAbort; + } + } + } + if(node->value.dataType == HIPINTVARAR){ + copyIntSicsData(node, self); + } else if(node->value.dataType == HIPFLOATVARAR){ + copyFloatSicsData(node, self); + } + return hdbContinue; + } + + if((mm = GetHdbSetMessage(message)) != NULL){ + if(node->value.dataType == HIPINTVARAR){ + for(i = 0; i < mm->v->arrayLength; i++){ + setSICSDataInt(self,i,mm->v->v.intArray[i]); + } + } else if(node->value.dataType == HIPFLOATVARAR){ + for(i = 0; i < mm->v->arrayLength; i++){ + setSICSDataFloat(self,i,(float)mm->v->v.floatArray[i]); + } + } + memset(script,0,256); + if(GetHdbProperty(node,"writescript", script,256) == 1){ + status = Tcl_Eval(InterpGetTcl(pServ->pSics),script); + if(status != TCL_OK){ + snprintf(error,1023,"ERROR: Tcl returned error: %s", + Tcl_GetStringResult(InterpGetTcl(pServ->pSics))); + if(mm->callData != NULL){ + SCWrite((SConnection *)mm->callData, error, eError); + return hdbAbort; + } + } + } + return hdbContinue; + } + + return hdbContinue; } /*============== interpreter function ==================================*/ int SICSHdbAdapter(SConnection *pCon, SicsInterp *pSics, void *pData, @@ -513,6 +621,9 @@ int SICSHdbAdapter(SConnection *pCon, SicsInterp *pSics, void *pData, char buffer[512]; pCounter pCount = NULL; CountEntry hugo; + pSICSData data = NULL; + int type; + pHdbCallback pCall = NULL; root = GetHipadabaRoot(); assert(root != NULL); @@ -620,6 +731,39 @@ int SICSHdbAdapter(SConnection *pCon, SicsInterp *pSics, void *pData, return 1; } + /** + * look for SICSData + */ + data = (pSICSData)FindCommandData(pSics,argv[2],"SICSData"); + if(data != NULL){ + if(argc < 5){ + SCWrite(pCon,"ERROR: need type and name to create SICSData adapter", + eError); + return 0; + } + type = convertHdbType(argv[3]); + if(type != HIPINTVARAR && type != HIPFLOATVARAR ){ + SCWrite(pCon, + "ERROR: need intvarar or floatvarar type for SICSData adapter", + eError); + return 0; + } + node = MakeHipadabaNode(argv[4],type,0); + if(node == NULL){ + SCWrite(pCon,"ERROR: out of memory in SICSHdbAdapter", eError); + return 0; + } + pCall = MakeHipadabaCallback(SICSDataCallback,data,NULL); + if(pCall == NULL){ + SCWrite(pCon,"ERROR: out of memory in SICSHdbAdapter", eError); + return 0; + } + AppendHipadabaCallback(node,pCall); + AddHipadabaChild(path,node,pCon); + SCSendOK(pCon); + return 1; + } + snprintf(buffer,511, "ERROR: attaching this type of object: %s at %s not implemented", argv[2], argv[1]); diff --git a/sicshdbfactory.c b/sicshdbfactory.c new file mode 100644 index 00000000..88c742a2 --- /dev/null +++ b/sicshdbfactory.c @@ -0,0 +1,348 @@ +/** + * This implements the hfactory command which is used to create + * hipadaba nodes. + * + * copyright: see file COPYRIGHT + * + * Mark Koennecke, March 2008, + * reusing code from former separate node creation functions. + */ +#include +#include "statusfile.h" + +#define MAX_HDB_PATH 1024 +/*-------------------------------------------------------------------------*/ +static int MakePlainNode(pHdb parent, char *name, SConnection *pCon, + int argc, char *argv[]){ + pHdb child = NULL; + int type = 0, length = 0, priv = -1; + hdbValue val; + + if(argc < 5){ + SCWrite(pCon,"ERROR: not enough arguments to create plain node", + eError); + return 0; + } + + /* + * convert privilege + */ + priv = decodeSICSPriv(argv[3]); + if(priv < 0){ + SCPrintf(pCon,eError,"ERROR: %s is no valid privilege code", argv[3]); + return 0; + } + /* + * convert datatype + */ + strtolower(argv[4]); + type = convertHdbType(argv[4]); + if(type > HIPFLOATVARAR){ + SCWrite(pCon, + "ERROR: invalid type requested: none, int, float, text, intar, floatar, intvarar, floatvarar supported", + eError); + return 0; + } + if(type >= HIPINTAR){ + if( argc < 6){ + SCWrite(pCon,"ERROR: array length missing for array data type", + eError); + return 0; + } else { + length = atoi(argv[5]); + } + } + + if(type != HIPNONE){ + val = makeHdbValue(type,length); + child = MakeSICSHdbPar(name, priv, val); + ReleaseHdbValue(&val); + } else { + child = MakeHipadabaNode(name,type,length); + } + if(child == NULL){ + SCWrite(pCon,"ERROR: out of memory creating node",eError); + return 0; + } + + AddHipadabaChild(parent,child,pCon); + SCSendOK(pCon); + return 1; +} +/*--------------------------------------------------------------------------*/ +static int MakeScriptNode(pHdb parent, char *name, SConnection *pCon, + int argc, char *argv[]){ + int type, length; + pHdb child = NULL; + hdbValue v; + + if(argc < 5){ + SCWrite(pCon, + "ERROR: not enough arguments to create script parameter node", + eError); + return 0; + } + + /* + * convert datatype + */ + strtolower(argv[5]); + type = convertHdbType(argv[5]); + if(type >= 7){ + SCWrite(pCon, + "ERROR: invalid type requested: none, int, float, text, intar, floatar, intvarar, floatvarar supported", + eError); + return 0; + } + if(type > 2){ + if( argc < 7){ + SCWrite(pCon,"ERROR: array length missing for array data type", + eError); + return 0; + } else { + length = atoi(argv[6]); + } + } + + v = makeHdbValue(type,length); + child = MakeSICSScriptPar(name, argv[4], argv[3], v); + ReleaseHdbValue(&v); + if(child == NULL){ + SCWrite(pCon,"ERROR: out of memory creating node",eError); + return 0; + } + + AddHipadabaChild(parent,child,pCon); + SCSendOK(pCon); + return 1; +} +/*-------------------------------------------------------------------------*/ +static int MakeLinkNode(pHdb parent, char *name, SConnection *pCon, + int argc, char *argv[]){ + pHdb node = NULL; + pObjectDescriptor pDes = NULL; + char buffer[256]; + + if(argc < 4){ + SCWrite(pCon,"ERROR: not enough arguments to create script node", + eError); + return 0; + } + pDes = FindCommandDescriptor(pServ->pSics,argv[3]); + if(pDes == NULL){ + snprintf(buffer,255,"ERROR: failed to find object %s", argv[3]); + SCWrite(pCon,buffer,eError); + return 0; + } + if(pDes->parNode == NULL){ + snprintf(buffer,255, + "ERROR: Object %s does not use Hipadaba natively and thus cannot be linked", + argv[3]); + SCWrite(pCon,buffer,eError); + return 0; + } + + if(pDes->parNode->mama != NULL){ + snprintf(buffer,255, + "ERROR: Object %s is already linked somewhere else", + argv[3]); + SCWrite(pCon,buffer,eError); + return 0; + } + + AddHipadabaChild(parent,pDes->parNode,pCon); + if(pDes->parNode->name != NULL){ + free(pDes->parNode->name); + } + pDes->parNode->name = strdup(name); + SCSendOK(pCon); + return 1; +} +/* -------------------------------------------------------------------------- + * This is actually SCInvoke but without advancing the context. I think this + * is only of local use. It makes sure that commands executed as Hipadaba + * commands get logged properly. + ---------------------------------------------------------------------------*/ + static int HDBInvoke(SConnection *self, SicsInterp *pInter, char *pCommand) + { + int iRet; + long lLen; + const char *pResult = NULL; + char *pBuffer = NULL, *pFile = NULL; + char pBueffel[80]; + int i, iSpace; + + assert(pInter); + + /* print command to log files */ + for( i = 0; i < self->iFiles; i++) + { + if(self->pFiles[i]) + { + fprintf(self->pFiles[i],"SICS>> %s\n",pCommand); + } + } + + /* print to command log if user or manager */ + if(SCGetRights(self) <= usUser) + { + if(self->pSock != NULL) + { + sprintf(pBueffel,"sock %d>>",self->pSock->sockid); + } + } + + /* invoke */ + self->inUse++; + self->eInterrupt = eContinue; + /* + get first word of command + */ + iRet = InterpExecute(pInter,self,pCommand); + + StatusFileTask(NULL); /* save changed parameters */ + + self->inUse--; + return iRet; + } +/*---------------------------------------------------------------------------*/ +static hdbCallbackReturn CommandSetCallback(pHdb node, void *userData, + pHdbMessage message){ + SConnection *pCon = NULL; + pDynString cmd = NULL, par = NULL; + pHdb current = NULL; + int status; + pHdbDataMessage mm = NULL; + hdbValue v; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = (SConnection *)pCon; + v = *(mm->v); + + if(pCon == NULL){ + printf("Cannot invoke command without connection\n"); + return hdbAbort; + } + + if(v.dataType == HIPTEXT){ + if(strstr(v.v.text,"start") != NULL) { + cmd = CreateDynString(64,64); + if(cmd == 0){ + SCWrite(pCon,"ERROR: out of memory in CommandSetCallback",eError); + return 0; + } + DynStringCopy(cmd, node->value.v.text); + DynStringConcat(cmd," "); + current = node->child; + while(current != NULL){ + par = formatValue(current->value, current); + if(par != NULL){ + DynStringConcat(cmd, GetCharArray(par)); + DynStringConcat(cmd," "); + DeleteDynString(par); + } + current = current->next; + } + status = HDBInvoke(pCon,pServ->pSics, GetCharArray(cmd)); + DeleteDynString(cmd); + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } + } else { + SCWrite(pCon,"ERROR: this node only understands start as value",eError); + return hdbAbort; + } + } + return hdbContinue; +} +/*---------------------------------------------------------------------------*/ +static hdbCallbackReturn CommandGetCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage mm = NULL; + + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + + hdbValue v2 = MakeHdbText("Nothing to get"); + *(mm->v) = v2; + return hdbContinue; +} +/*--------------------------------------------------------------------------*/ +static int MakeCommandNode(pHdb parent, char *name, SConnection *pCon, + int argc, char *argv[]){ + pHdb node = NULL; + pHdbCallback kalle = NULL; + + if(argc < 4){ + SCWrite(pCon,"ERROR: not enough arguments to create command node", + eError); + return 0; + } + node = MakeHipadabaNode(name, HIPTEXT, 1); + if(node == NULL){ + SCWrite(pCon,"ERROR: out of memory in hcommand",eError); + return 0; + } + node->value.v.text = strdup(argv[3]); + node->value.arrayLength = strlen(argv[3]); + SetHdbProperty(node,"sicscommand", argv[3]); + + kalle = MakeHipadabaCallback(CommandSetCallback,NULL, NULL); + if(kalle == NULL){ + SCWrite(pCon,"ERROR: out of memory in hcommand",eError); + return 0; + } + AppendHipadabaCallback(node,kalle); + + kalle = MakeHipadabaCallback(CommandGetCallback,NULL, NULL); + if(kalle == NULL){ + SCWrite(pCon,"ERROR: out of memory in hcommand",eError); + return 0; + } + AppendHipadabaCallback(node,kalle); + + AddHipadabaChild(parent,node,pCon); + + SCSendOK(pCon); + return 1; +} +/*--------------------------------------------------------------------------*/ +int HdbNodeFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]){ + char *name = NULL; + pHdb parent = NULL; + + if(!SCMatchRights(pCon,usMugger)){ + return 0; + } + + if(argc < 3) { + SCWrite(pCon,"ERROR: not enough arguments to hfactory",eError); + return 0; + } + + parent = FindHdbParent(NULL, argv[1], &name, pCon); + if (parent == NULL) { + return 0; /* error messages written inside FindHdbParent */ + } + + strtolower(argv[2]); + if(strcmp(argv[2],"plain") == 0){ + return MakePlainNode(parent,name,pCon,argc,argv); + } else if(strcmp(argv[2],"script") == 0){ + return MakeScriptNode(parent,name,pCon,argc,argv); + } else if(strcmp(argv[2],"link") == 0){ + return MakeLinkNode(parent,name,pCon,argc,argv); + } else if(strcmp(argv[2],"command") == 0){ + return MakeCommandNode(parent,name,pCon,argc,argv); + } else { + SCWrite(pCon,"ERROR: node type not recognised", eError); + return 0; + } + return 0; +} diff --git a/sicshipadaba.c b/sicshipadaba.c index 7b2937dc..2deda2f8 100644 --- a/sicshipadaba.c +++ b/sicshipadaba.c @@ -350,20 +350,35 @@ static int sendZippedNodeData(pHdb node, SConnection *pCon){ int i, *iData = NULL; char *path = NULL; - memset(&newValue,0,sizeof(hdbValue)); - GetHipadabaPar(node, &newValue, pCon); + newValue = node->value; path = GetHipadabaPath(node); switch(newValue.dataType){ case HIPINTAR: case HIPINTVARAR: - for(i = 0; i < newValue.arrayLength; i++){ - newValue.v.intArray[i] = htonl(newValue.v.intArray[i]); + if(newValue.v.intArray == NULL){ + free(path); + return 0; + } + iData = (int *)malloc(newValue.arrayLength*sizeof(int)); + if(iData == NULL){ + SCWrite(pCon,"ERROR: out of memory in sendZippedData",eError); + free(path); + return 0; } - SCWriteZipped(pCon,path, newValue.v.intArray, + memset(iData,0,newValue.arrayLength*sizeof(int)); + for(i = 0; i < newValue.arrayLength; i++){ + iData[i] = htonl(newValue.v.intArray[i]); + } + SCWriteZipped(pCon,path, iData, newValue.arrayLength*sizeof(int)); + free(iData); break; case HIPFLOATAR: case HIPFLOATVARAR: + if(newValue.v.floatArray == NULL){ + free(path); + return 0; + } iData = (int *)malloc(newValue.arrayLength*sizeof(int)); if(iData == NULL){ SCWrite(pCon,"ERROR: out of memory in sendZippedData",eError); @@ -385,7 +400,6 @@ static int sendZippedNodeData(pHdb node, SConnection *pCon){ return 0; } free(path); - ReleaseHdbValue(&newValue); return 1; } /*----------------------------------------------------------------------------------------*/ @@ -517,7 +531,6 @@ static hdbCallbackReturn TreeChangeCallback(pHdb node, void *userData, pHdbPtrMessage cmm = NULL; pHdbTreeChangeMessage tm = NULL; - result = CreateDynString(128,128); HdbCBInfo *cbInfo = (HdbCBInfo *)userData; /* @@ -550,6 +563,11 @@ static hdbCallbackReturn TreeChangeCallback(pHdb node, void *userData, } if(cbInfo != NULL && cbInfo->pCon != NULL){ + result = CreateDynString(128,128); + if(result == NULL){ + SCWriteInContext(cbInfo->pCon,"ERROR: out of memory in TreeChangeCallback",outCode,cbInfo->context); + return hdbAbort; + } path = GetHipadabaPath(node); if ((protocol = isJSON(cbInfo->pCon)) == 1) outCode = eHdbEvent; @@ -1248,7 +1266,7 @@ pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr, SConnection *p slash = strchr(element+6, '/'); if (slash != NULL) *slash = '\0'; /* split off object name */ - pDes = FindCommandDescriptor(pServ->pSics, element); + pDes = FindCommandDescriptor(pServ->pSics, element+6); if (pDes == NULL) { SCPrintf(pCon, eError, "ERROR: object %s not found", element); return NULL; @@ -1692,7 +1710,7 @@ pDynString formatValue(hdbValue v, pHdb node){ break; case HIPFLOATAR: case HIPFLOATVARAR: - if (!GetHdbProperty(node, "fmt", format+1, sizeof format -2)) { + if (GetHdbProperty(node, "fmt", format+1, sizeof format -2)) { format[0]=' '; } else { strcpy(format, " %.6g"); @@ -2072,7 +2090,7 @@ static int SetHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, pDynString parData = NULL; char error[512]; int i, status; - + if(!SCMatchRights(pCon,usUser)){ return 0; } @@ -2083,6 +2101,7 @@ static int SetHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, return 0; } + targetNode = FindHdbNode(NULL,argv[1],pCon); if(targetNode == NULL){ return 0; @@ -2179,7 +2198,8 @@ static int ZipGetHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, pHdb targetNode = NULL; char error[512], oriPath[512]; int status; - + hdbValue newValue; + if(argc < 2) { SCWrite(pCon,"ERROR: need path to node",eError); return 0; @@ -2190,6 +2210,9 @@ static int ZipGetHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, if(targetNode == NULL){ return 0; } + memset(&newValue,0,sizeof(hdbValue)); + GetHipadabaPar(targetNode, &newValue, pCon); + ReleaseHdbValue(&newValue); return sendZippedNodeData(targetNode,pCon); } /*---------------------------------------------------------------------------*/ @@ -2204,6 +2227,12 @@ static int GetHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, int outCode; char value[80]; + /* + if(strstr(argv[1],"values") != NULL){ + printf("Found!!\n"); + } + */ + if(argc < 2) { SCWrite(pCon,"ERROR: need path to node to print",eError); return 0; @@ -3060,11 +3089,15 @@ void killSICSHipadaba(){ root = NULL; } /*---------------------------------------------------------------------------*/ +extern int HdbNodeFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); /* from sicshdbfactory.c */ +/*---------------------------------------------------------------------------*/ int InstallSICSHipadaba(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]){ root = MakeHipadabaNode("/",HIPNONE,0); AddCommand(pSics,"hmake", MakeHdbNode, NULL, NULL); + AddCommand(pSics,"hfactory", HdbNodeFactory, NULL, NULL); AddCommand(pSics,"hmakescript", MakeHdbScriptNode, NULL, NULL); AddCommand(pSics,"hattach", SICSHdbAdapter, NULL, NULL); AddCommand(pSics,"hdel", DeleteHdbNode, NULL, NULL); diff --git a/sicsobj.c b/sicsobj.c index 17ec2625..1e0e99a5 100644 --- a/sicsobj.c +++ b/sicsobj.c @@ -239,15 +239,31 @@ int InvokeSICSOBJ(SConnection *pCon, SicsInterp *pSics, void *pData, if(strcmp(argv[1],"makescriptfunc") == 0) { return MakeScriptFunc(self,pCon,argc,argv); } - snprintf(buffer,131,"ERROR: no command or parameter found for key: %s", - argv[1]); - SCWrite(pCon,buffer,eError); - status = 0; } return status; } /*---------------------------------------------------------------------------*/ +int InterInvokeSICSOBJ(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]){ + int status; + char buffer[132]; + + status = InvokeSICSOBJ(pCon,pSics,pData,argc,argv); + if(status == -1){ + status = 0; + if(argc > 1){ + snprintf(buffer,131,"ERROR: no command or parameter found for key: %s", + argv[1]); + } else { + snprintf(buffer,131,"ERROR: no argument found"); + } + SCWrite(pCon,buffer,eError); + status = 0; + } + return status; +} +/*---------------------------------------------------------------------------*/ pSICSOBJ SetupSICSOBJ(SConnection *pCon,SicsInterp *pSics, void *pData, int argc, char *argv[]){ pSICSOBJ pNew = NULL; @@ -288,7 +304,7 @@ pSICSOBJ SetupSICSOBJ(SConnection *pCon,SicsInterp *pSics, void *pData, status = AddCommand(pSics, argv[1], - InvokeSICSOBJ, + InterInvokeSICSOBJ, KillSICSOBJ, pNew); if(status != 1){ diff --git a/sicsobj.h b/sicsobj.h index 92bd4607..38461a39 100644 --- a/sicsobj.h +++ b/sicsobj.h @@ -35,9 +35,15 @@ void KillSICSOBJ(void *data); */ pSICSOBJ SetupSICSOBJ(SConnection *pCon,SicsInterp *pSics, void *pData, int argc, char *argv[]); -/*====================== Interpreter Interface ===========================*/ +/*====================== Interpreter Interface =========================== + * InvokeSICSObj is special in that it returns -1 if it cannot handle + * the command. This leaves calling code the opportunity to process + * further commands.It returns 1 on success and 0 on failures though. + * ------------------------------------------------------------------------*/ int InvokeSICSOBJ(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]); +int InterInvokeSICSOBJ(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); int InstallSICSOBJ(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]); diff --git a/simcter.c b/simcter.c index 9963c191..821cc0a4 100644 --- a/simcter.c +++ b/simcter.c @@ -259,7 +259,7 @@ static float FAILRATE; { for(i = 0; i < MAXCOUNT; i++) { - self->lCounts[i] = (long)rand(); + self->lCounts[i] = (long)(SimRandom()*100); } self->lCounts[1] = self->fPreset; return OKOK; @@ -272,7 +272,7 @@ static float FAILRATE; for(i = 0; i < MAXCOUNT; i++) { - self->lCounts[i] = (long)rand(); + self->lCounts[i] = (long)(SimRandom()*100); } self->lCounts[1] = self->fPreset; return OKOK; diff --git a/tasscanub.c b/tasscanub.c index 6be8bf4f..e8b8e24d 100644 --- a/tasscanub.c +++ b/tasscanub.c @@ -1023,7 +1023,7 @@ int TASUBPrepare(pScanData self) /*---------------------------------------------------------------------*/ static void TASUBDump(pTASdata self, SicsInterp *pSics, SConnection *pCon, int argc, char *argv[]){ - float v[3], ub[3][3], cell[6]; + float v[9], ub[3][3], cell[6]; int status, i, j; pNXScript nxscript = NULL; char pBueffel[256]; @@ -1083,7 +1083,13 @@ static void TASUBDump(pTASdata self, SicsInterp *pSics, SConnection *pCon, v[0] = r.qe.qh; v[1] = r.qe.qk; v[2] = r.qe.ql; - status = NXDputalias(nxscript->fileHandle,nxscript->dictHandle,pBueffel,v); + v[3] = r.angles.a3; + v[4] = r.angles.sample_two_theta; + v[5] = r.angles.sgl; + v[6] = r.angles.sgu; + v[7] = KtoEnergy(r.qe.ki); + v[8] = KtoEnergy(r.qe.kf); + status = NXDputalias(nxscript->fileHandle,nxscript->dictHandle,pBueffel,v); if(status != NX_OK){ snprintf(pBueffel,255,"ERROR: failed to write plane vector 1 to %s_vec1",argv[3]); SCWrite(pCon,pBueffel,eWarning); @@ -1093,6 +1099,12 @@ static void TASUBDump(pTASdata self, SicsInterp *pSics, SConnection *pCon, v[0] = r.qe.qh; v[1] = r.qe.qk; v[2] = r.qe.ql; + v[3] = r.angles.a3; + v[4] = r.angles.sample_two_theta; + v[5] = r.angles.sgl; + v[6] = r.angles.sgu; + v[7] = KtoEnergy(r.qe.ki); + v[8] = KtoEnergy(r.qe.kf); status = NXDputalias(nxscript->fileHandle,nxscript->dictHandle,pBueffel,v); if(status != NX_OK){ snprintf(pBueffel,255,"ERROR: failed to write plane vector 2 to %s_vec2",argv[3]); diff --git a/val.lis b/val.lis index de5d80ce..ccc214ad 100644 --- a/val.lis +++ b/val.lis @@ -1,11 +1,3 @@ -==3348== Memcheck, a memory error detector. -==3348== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. -==3348== Using LibVEX rev 1658, a library for dynamic binary translation. -==3348== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. -==3348== Using valgrind-3.2.1, a dynamic binary instrumentation framework. -==3348== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. -==3348== For more details, rerun with: -v -==3348== WARNING: Cannot log(Accepted dummy connection ) sim/topsi/morpheus.tcl:0>> ServerOption ReadTimeOut 10 sim/topsi/morpheus.tcl:1>> ServerOption AcceptTimeOut 50 @@ -83,471 +75,74 @@ sim/topsi/morpheus.tcl:72>> Publish motransfer Spy sim/topsi/morpheus.tcl:73>> MakeO2T O2T sth stt sim/topsi/morpheus.tcl:74>> MakeO2T O2TL sth sttl sim/topsi/morpheus.tcl:75>> MakeO2T O2U sth sttl -sim/topsi/morpheus.tcl:76>> MakeScanCommand xxxscan counter $scripthome/morpheus.hdd \ +sim/topsi/morpheus.tcl:76>> MakeProxy ptt temperature float +sim/topsi/morpheus.tcl:77>> ptt map upperlimit upperlimit float user +ERROR: not enough arguments to MapFunc +sim/topsi/morpheus.tcl:78>> ptt map lowerlimit lowerlimit float user +ERROR: not enough arguments to MapFunc +sim/topsi/morpheus.tcl:79>> MakeScanCommand xxxscan counter $scripthome/morpheus.hdd \ $loghome/recover.bin -sim/topsi/morpheus.tcl:77>> MakePeakCenter xxxscan -sim/topsi/morpheus.tcl:78>> MakeOptimise opti counter -sim/topsi/morpheus.tcl:79>> SicsAlias drive dr -sim/topsi/morpheus.tcl:80>> MakeHKL stt sth sch sph -sim/topsi/morpheus.tcl:81>> MakeHKLMot hkl -sim/topsi/morpheus.tcl:82>> MakeUBCalc ubcalc hkl -sim/topsi/morpheus.tcl:83>> MakeCone cone ubcalc -sim/topsi/morpheus.tcl:84>> hkl lambdavar lambda -sim/topsi/morpheus.tcl:85>> MakeXYTable table -sim/topsi/morpheus.tcl:86>> MakeConfigurableMotor two -sim/topsi/morpheus.tcl:87>> two drivescript twoscript -ERROR: duplicate exe manager not created -sim/topsi/morpheus.tcl:88>> fileeval $scripthome/morpheuscom.tcl +sim/topsi/morpheus.tcl:80>> MakePeakCenter xxxscan +sim/topsi/morpheus.tcl:81>> MakeOptimise opti counter +sim/topsi/morpheus.tcl:82>> SicsAlias drive dr +sim/topsi/morpheus.tcl:83>> MakeHKL stt sth sch sph +sim/topsi/morpheus.tcl:84>> MakeHKLMot hkl +sim/topsi/morpheus.tcl:85>> MakeUBCalc ubcalc hkl +sim/topsi/morpheus.tcl:86>> MakeCone cone ubcalc +sim/topsi/morpheus.tcl:87>> hkl lambdavar lambda +sim/topsi/morpheus.tcl:88>> MakeXYTable table +sim/topsi/morpheus.tcl:89>> MakeConfigurableMotor two +sim/topsi/morpheus.tcl:90>> two drivescript twoscript +sim/topsi/morpheus.tcl:91>> fileeval $scripthome/morpheuscom.tcl ERROR: new SICSData not created due to name collision -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:89>> MakeStateMon xxxscan -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:90>> hmake /instrument spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:91>> hsetprop /instrument type instrument -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:92>> hmake /graphics spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:93>> hsetprop /graphics type graphset -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:94>> hattach /instrument title title -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:95>> hmake /instrument/user spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:96>> hsetprop /instrument/user type dev -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:97>> hattach /instrument/user user name -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:98>> hattach /instrument/user adress address -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:99>> hattach /instrument/user phone phone -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:100>> hattach /instrument/user email email -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:101>> hmake /instrument/user/flame user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:102>> hset /instrument/user/flame "This user is a DAU" -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:103>> hsetprop /instrument/user/flame visible false -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:104>> hmake /instrument/monochromator spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:105>> hsetprop /instrument/monochromator type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:106>> hattach /instrument/monochromator lambda wavelength -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:107>> hchain /instrument/monochromator/wavelength /instrument/monochromator/two_theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:92>> hfactory /instrument plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:93>> hsetprop /instrument type instrument +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:94>> hfactory /instrument/experiment/filemode script filemode filemode text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:95>> hsetprop /instrument/experiment/filemode values prehistoric,nexus,4circle,2circleub +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:96>> hfactory /instrument/monochromator plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:97>> hsetprop /instrument/monochromator type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:98>> hattach /instrument/monochromator lambda wavelength +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:99>> hchain /instrument/monochromator/wavelength /instrument/monochromator/two_theta ERROR: master /instrument/monochromator/wavelength not found -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:108>> hattach /instrument/monochromator mth theta -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:109>> hattach /instrument/monochromator mtt two_theta -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:110>> hattach /instrument/monochromator mtx x_translation -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:111>> hattach /instrument/monochromator mty y_translation -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:112>> hattach /instrument/monochromator mfv vertical_focusing -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:113>> hmake /instrument/slit1 spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:114>> hsetprop /instrument/slit1 type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:115>> hattach /instrument/slit1 d1l left -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:116>> hattach /instrument/slit1 d1r right -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:117>> hattach /instrument/slit1 d1t top -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:118>> hattach /instrument/slit1 d1b bottom -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:119>> hmake /instrument/slit2 spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:120>> hsetprop /instrument/slit2 type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:121>> hattach /instrument/slit2 d2l left -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:122>> hattach /instrument/slit2 d2r right -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:123>> hattach /instrument/slit2 d2t top -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:124>> hattach /instrument/slit2 d2b bottom -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:125>> hmake /instrument/sample spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:126>> hsetprop /instrument/sample type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:127>> hattach /instrument/sample sample name -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:128>> hattach /instrument/sample sth omega -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:129>> hattach /instrument/sample stt two_theta -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:130>> hattach /instrument/sample stx x_translation -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:131>> hattach /instrument/sample sty y_translation -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:132>> hattach /instrument/sample sgy y_goniometer -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:133>> hattach /instrument/sample sgx x_goniometer -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:134>> hmake /instrument/monitor spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:135>> hsetprop /instrument/monitor type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:136>> hmake /instrument/monitor/counts internal int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:137>> hattach /instrument/monitor/counts counter 1 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:138>> hsetprop /instrument/monitor/counts priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:139>> hsetprop /instrument/monitor/counts sicsdev counter -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:140>> hmakescript /instrument/monitor/preset "counter getpreset" "counter setpreset" float -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:141>> hmakescript /instrument/monitor/countmode "counter getmode" "counter setmode" text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:142>> hmake /instrument/counter spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:143>> hsetprop /instrument/counter type part -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:144>> hmake /instrument/counter/counts internal int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:145>> hattach /instrument/counter/counts counter 0 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:146>> hsetprop /instrument/counter/counts priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:147>> hmake /gui spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:148>> hmake /gui/status internal text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:149>> status hdbinterest /gui/status -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:150>> hmake /graphics/scan_data spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:151>> hsetprop /graphics/scan_data type graphdata -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:152>> hsetprop /graphics/scan_data viewer default -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:153>> hmake /graphics/scan_data/rank mugger int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:154>> hset /graphics/scan_data/rank 1 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:155>> hsetprop /graphics/scan_data/rank priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:156>> hmakescript /graphics/scan_data/dim "xxxscan np" hdbReadOnly intar 1 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:157>> hsetprop /graphics/scan_data/dim priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:158>> hmakescript /graphics/scan_data/scan_variable "gethdbscanvardata 0" hdbReadOnly floatvarar 1 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:159>> hsetprop /graphics/scan_data/scan_variable type axis -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:160>> hsetprop /graphics/scan_data/scan_variable dim 0 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:161>> hsetprop /graphics/scan_data/scan_variable transfer zip -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:162>> hsetprop /graphics/scan_data/scan_variable priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:163>> hmakescript /graphics/scan_data/counts "gethdbscancounts" hdbReadOnly intvarar 1 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:164>> hsetprop /graphics/scan_data/counts type data -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:165>> hsetprop /graphics/scan_data/counts transfer zip -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:166>> hsetprop /graphics/scan_data/counts priv internal -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:167>> hmake /instrument/commands spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:168>> hsetprop /instrument/commands type commandset -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:169>> hcommand /instrument/commands/scan hdbscan -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:170>> hsetprop /instrument/commands/scan type command -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:171>> hsetprop /instrument/commands/scan priv user -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:172>> hmake /instrument/commands/scan/scan_variables user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:173>> hsetprop /instrument/commands/scan/scan_variables argtype drivable -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:174>> hmake /instrument/commands/scan/scan_start user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:175>> hmake /instrument/commands/scan/scan_increments user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:176>> hmake /instrument/commands/scan/NP user int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:177>> hmake /instrument/commands/scan/mode user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:178>> hsetprop /instrument/commands/scan/mode values "monitor,timer" -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:179>> hmake /instrument/commands/scan/preset user float -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:180>> hcommand /instrument/commands/graphscan hdbscan -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:181>> hsetprop /instrument/commands/graphscan type command -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:182>> hsetprop /instrument/commands/graphscan viewer mountaingumui.ScanEditor -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:183>> hsetprop /instrument/commands/graphscan priv user -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:184>> hmake /instrument/commands/graphscan/scan_variables user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:185>> hsetprop /instrument/commands/graphscan/scan_variables argtype drivable -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:186>> hmake /instrument/commands/graphscan/scan_start user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:187>> hmake /instrument/commands/graphscan/scan_increments user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:188>> hmake /instrument/commands/graphscan/NP user int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:189>> hmake /instrument/commands/graphscan/mode user text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:190>> hsetprop /instrument/commands/graphscan/mode values "monitor,timer" -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:191>> hmake /instrument/commands/graphscan/preset user float -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:192>> hcommand /instrument/commands/wait wait -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:193>> hsetprop /instrument/commands/wait type command -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:194>> hsetprop /instrument/commands/wait priv user -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:195>> hmake /instrument/commands/wait/time user int -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:196>> hmake /quickview spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:197>> hmake /batch spy none -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:198>> hmakescript /batch/bufferlist listbatchfiles hdbReadOnly text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:199>> sicspoll add /batch/bufferlist hdb 30 -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:200>> hmake /batch/commandtext spy text -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:201>> hsetprop /batch/commandtext viewer mountaingumui.TextEdit -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:202>> hsetprop /batch/commandtext commandtext true -/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:203>> __filemode prehistoric +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:100>> hattach /instrument/monochromator mth theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:101>> hattach /instrument/monochromator mtt two_theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:102>> hattach /instrument/monochromator mtx x_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:103>> hattach /instrument/monochromator mty y_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:104>> hattach /instrument/monochromator mfv vertical_focusing +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:105>> hsetprop /instrument/slit1/upper sicsdev d1t +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:106>> hsetprop /instrument/slit1/bottom sicsdev d1b +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:107>> hsetprop /instrument/slit2/upper sicsdev d2t +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:108>> hsetprop /instrument/slit2/bottom sicsdev d2b +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:109>> hfactory /instrument/sample plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:110>> hsetprop /instrument/sample type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:111>> hattach /instrument/sample sample name +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:112>> hattach /instrument/sample sth omega +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:113>> hattach /instrument/sample stt two_theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:114>> hattach /instrument/sample stx x_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:115>> hattach /instrument/sample sty y_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:116>> hattach /instrument/sample sgy y_goniometer +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:117>> hattach /instrument/sample sgx x_goniometer +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:118>> hattach /imstrument/sample scx chi +ERROR: path to attach object too not found +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:119>> hattach /imstrument/sample scy phi +ERROR: path to attach object too not found +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:120>> hfactory /instrument/monitor plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:121>> hsetprop /instrument/monitor type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:122>> hfactory /instrument/monitor/counts plain internal int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:123>> hattach /instrument/monitor/counts counter 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:124>> hsetprop /instrument/monitor/counts priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:125>> hsetprop /instrument/monitor/counts sicsdev counter +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:126>> hfactory /instrument/monitor/preset script "counter getpreset" "counter setpreset" float +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:127>> hfactory /instrument/monitor/countmode script "counter getmode" "counter setmode" text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:128>> hfactory /instrument/counter plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:129>> hsetprop /instrument/counter type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:130>> hfactory /instrument/counter/counts plain internal int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:131>> hattach /instrument/counter/counts counter 0 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:132>> hsetprop /instrument/counter/counts priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:133>> hfactory /graphics plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:134>> hsetprop /graphics type graphset +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:135>> hfactory /instrument/commands plain spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:136>> hsetprop /instrument/commands type commandset +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:137>> hmake /quickview spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:138>> __filemode prehistoric OK -==3348== Invalid read of size 1 -==3348== at 0x400630E: strcmp (mc_replace_strmem.c:341) -==3348== by 0x80FE3D1: compareHdbValue (hipadaba.c:482) -==3348== by 0x81140E4: pollHdb (polldriv.c:38) -==3348== by 0x811459A: PollTask (sicspoll.c:135) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== by 0x8057A25: RunServer (nserver.c:406) -==3348== by 0x8057F27: main (SICSmain.c:62) -==3348== Address 0x4CC7A38 is 0 bytes inside a block of size 8 free'd -==3348== at 0x4004FDA: free (vg_replace_malloc.c:233) -==3348== by 0x81039B1: readHdbValue (sicshipadaba.c:1797) -==3348== by 0x81010AF: SICSScriptReadCallback (sicshipadaba.c:683) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF222: GetHipadabaPar (hipadaba.c:940) -==3348== by 0x8114091: pollHdb (polldriv.c:37) -==3348== by 0x811459A: PollTask (sicspoll.c:135) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== by 0x8057A25: RunServer (nserver.c:406) -==3348== by 0x8057F27: main (SICSmain.c:62) -==3348== -==3348== Invalid read of size 1 -==3348== at 0x400632E: strcmp (mc_replace_strmem.c:341) -==3348== by 0x80FE3D1: compareHdbValue (hipadaba.c:482) -==3348== by 0x81140E4: pollHdb (polldriv.c:38) -==3348== by 0x811459A: PollTask (sicspoll.c:135) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== by 0x8057A25: RunServer (nserver.c:406) -==3348== by 0x8057F27: main (SICSmain.c:62) -==3348== Address 0x4E89ED9 is 1 bytes inside a block of size 957 free'd -==3348== at 0x4004FDA: free (vg_replace_malloc.c:233) -==3348== by 0x81039B1: readHdbValue (sicshipadaba.c:1797) -==3348== by 0x81010AF: SICSScriptReadCallback (sicshipadaba.c:683) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF222: GetHipadabaPar (hipadaba.c:940) -==3348== by 0x8114091: pollHdb (polldriv.c:37) -==3348== by 0x811459A: PollTask (sicspoll.c:135) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== by 0x8057A25: RunServer (nserver.c:406) -==3348== by 0x8057F27: main (SICSmain.c:62) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27DB2: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) -==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x80F6F79: ContextDo (protocol.c:200) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x805027F: SCInvoke (conman.c:1604) -==3348== by 0x805165F: SCTaskFunction (conman.c:2097) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27CE9: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) -==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x80F6F79: ContextDo (protocol.c:200) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x805027F: SCInvoke (conman.c:1604) -==3348== by 0x805165F: SCTaskFunction (conman.c:2097) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27DB2: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) -==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x80F6F79: ContextDo (protocol.c:200) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x805027F: SCInvoke (conman.c:1604) -==3348== by 0x805165F: SCTaskFunction (conman.c:2097) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27CE9: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) -==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x80F6F79: ContextDo (protocol.c:200) -==3348== by 0x80527B6: InterpExecute (SCinter.c:322) -==3348== by 0x805027F: SCInvoke (conman.c:1604) -==3348== by 0x805165F: SCTaskFunction (conman.c:2097) -==3348== by 0x8059016: TaskSchedule (task.c:211) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D82: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D91: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27DA3: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D3C: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D4F: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D61: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D70: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D82: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D3C: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D4F: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D61: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D70: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27D91: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27DA3: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27CF9: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== Conditional jump or move depends on uninitialised value(s) -==3348== at 0xD27CF9: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) -==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) -==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) -==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) -==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) -==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) -==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) -==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) -==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) -==3348== by 0x805992C: SicsUnknownProc (macro.c:185) -==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) -==3348== -==3348== ERROR SUMMARY: 57717 errors from 22 contexts (suppressed: 22 from 1) -==3348== malloc/free: in use at exit: 1,197,084 bytes in 8,439 blocks. -==3348== malloc/free: 595,895 allocs, 587,456 frees, 89,983,020 bytes allocated. -==3348== For counts of detected errors, rerun with: -v -==3348== searching for pointers to 8,439 not-freed blocks. -==3348== checked 708,956 bytes. -==3348== -==3348== LEAK SUMMARY: -==3348== definitely lost: 619,696 bytes in 8,379 blocks. -==3348== possibly lost: 439,796 bytes in 28 blocks. -==3348== still reachable: 137,592 bytes in 32 blocks. -==3348== suppressed: 0 bytes in 0 blocks. -==3348== Use --leak-check=full to see details of leaked memory.