diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-27 08:45:38 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-27 08:45:38 +0000 |
commit | 3a20ee45be537a98d9da4a7dc994b375ac4a7055 (patch) | |
tree | 9e0e1ddfd0d06b8eac5d092acb0ab032267ca791 /debug.c | |
parent | eb4b1915d1655d801e0232f4196fbdc1af3c857f (diff) | |
download | rsyslog-3a20ee45be537a98d9da4a7dc994b375ac4a7055.tar.gz rsyslog-3a20ee45be537a98d9da4a7dc994b375ac4a7055.tar.bz2 rsyslog-3a20ee45be537a98d9da4a7dc994b375ac4a7055.zip |
bugfix: queue cancel cleanup handler could be called with invalid pointer
if dequeue failed
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -57,10 +57,10 @@ static dbgThrdInfo_t *dbgGetThrdInfo(void); /* static data (some time to be replaced) */ int Debug; /* debug flag - read-only after startup */ int debugging_on = 0; /* read-only, except on sig USR1 */ -static int bLogFuncFlow = 0; /* shall the function entry and exit be logged to the debug log? */ +static int bLogFuncFlow = 1; /* shall the function entry and exit be logged to the debug log? */ static int bLogAllocFree = 0; /* shall calls to (m/c)alloc and free be logged to the debug log? */ static int bPrintFuncDBOnExit = 0; /* shall the function entry and exit be logged to the debug log? */ -static int bPrintMutexAction = 1; /* shall mutex calls be printed to the debug log? */ +static int bPrintMutexAction = 0; /* shall mutex calls be printed to the debug log? */ static int bPrintTime = 1; /* print a timestamp together with debug message */ static char *pszAltDbgFileName = NULL; /* if set, debug output is *also* sent to here */ static FILE *altdbg = NULL; /* and the handle for alternate debug output */ @@ -930,8 +930,11 @@ int dbgEntrFunc(dbgFuncDB_t *pFuncDB, int line) /* when we reach this point, we have a fully-initialized FuncDB! */ //if(bLogFuncFlow) /* quick debug hack... select the best for you! */ - if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "vm.c")) /* quick debug hack... select the best for you! */ + //if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "vm.c")) /* quick debug hack... select the best for you! */ //if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "expr.c")) /* quick debug hack... select the best for you! */ + if(bLogFuncFlow && (!strcmp((char*)pFuncDB->file, "wti.c") + ||!strcmp((char*)pFuncDB->file, "wtp.c") + ||!strcmp((char*)pFuncDB->file, "queue.c"))) /* quick debug hack... select the best for you! */ dbgprintf("%s:%d: %s: enter\n", pFuncDB->file, pFuncDB->line, pFuncDB->func); if(pThrd->stackPtr >= (int) (sizeof(pThrd->callStack) / sizeof(dbgFuncDB_t*))) { dbgprintf("%s:%d: %s: debug module: call stack for this thread full, suspending call tracking\n", @@ -961,8 +964,11 @@ void dbgExitFunc(dbgFuncDB_t *pFuncDB, int iStackPtrRestore) dbgFuncDBPrintActiveMutexes(pFuncDB, "WARNING: mutex still owned by us as we exit function, mutex: ", pthread_self()); //if(bLogFuncFlow) /* quick debug hack... select the best for you! */ - if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "vm.c")) /* quick debug hack... select the best for you! */ + //if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "vm.c")) /* quick debug hack... select the best for you! */ //if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "expr.c")) /* quick debug hack... select the best for you! */ + if(bLogFuncFlow && (!strcmp((char*)pFuncDB->file, "wti.c") + ||!strcmp((char*)pFuncDB->file, "wtp.c") + ||!strcmp((char*)pFuncDB->file, "queue.c"))) /* quick debug hack... select the best for you! */ dbgprintf("%s:%d: %s: exit\n", pFuncDB->file, pFuncDB->line, pFuncDB->func); pThrd->stackPtr = iStackPtrRestore; if(pThrd->stackPtr < 0) { |