uncommented dbgprintf's as I think these may be the trouble source

this callback is somewhat unportable in combination with dlopen()
This commit is contained in:
Rainer Gerhards 2008-04-29 10:38:22 +02:00
parent 3a4f679c3b
commit a84a60d8dd
4 changed files with 22 additions and 23 deletions

View File

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([rsyslog],[3.17.2-klog0],[rsyslog@lists.adiscon.com])
AC_INIT([rsyslog],[3.17.2-klog1],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([syslogd.c])
AC_CONFIG_HEADERS([config.h])

View File

@ -190,20 +190,19 @@ extern int InitKsyms(char *mapfile)
} else {
if ( (mapfile = FindSymbolFile()) == NULL ) {
imklogLogIntMsg(LOG_WARNING, "Cannot find map file.");
dbgprintf("Cannot find map file.\n");
////dbgprintf("Cannot find map file.\n");
return(0);
}
if ( (sym_file = fopen(mapfile, "r")) == NULL ) {
imklogLogIntMsg(LOG_WARNING, "Cannot open map file.");
dbgprintf("Cannot open map file.\n");
//dbgprintf("Cannot open map file.\n");
return(0);
}
}
/*
* Read the kernel symbol table file and add entries for each
/* Read the kernel symbol table file and add entries for each
* line. I suspect that the use of fscanf is not really in vogue
* but it was quick and dirty and IMHO suitable for fixed format
* data such as this. If anybody doesn't agree with this please
@ -217,7 +216,7 @@ extern int InitKsyms(char *mapfile)
return(0);
}
if(dbgPrintSymbols)
dbgprintf("Address: %lx, Type: %c, Symbol: %s\n", address, type, sym);
//dbgprintf("Address: %lx, Type: %c, Symbol: %s\n", address, type, sym);
if ( AddSymbol(address, sym) == 0 ) {
imklogLogIntMsg(LOG_ERR, "Error adding symbol - %s.", sym);
@ -304,11 +303,11 @@ static char *FindSymbolFile(void)
return(0);
}
dbgprintf("Searching for symbol map.\n");
//dbgprintf("Searching for symbol map.\n");
for(mf = system_maps; *mf != NULL && file == NULL; ++mf) {
snprintf(mysymfile, sizeof(mysymfile), "%s-%s", *mf, utsname.release);
dbgprintf("Trying %s.\n", mysymfile);
//dbgprintf("Trying %s.\n", mysymfile);
if((sym_file = fopen(mysymfile, "r")) != NULL) {
if(CheckMapVersion(mysymfile) == 1)
file = mysymfile;
@ -316,7 +315,7 @@ static char *FindSymbolFile(void)
}
if(sym_file == NULL || file == NULL) {
sprintf (mysymfile, "%s", *mf);
dbgprintf("Trying %s.\n", mysymfile);
//dbgprintf("Trying %s.\n", mysymfile);
if((sym_file = fopen(mysymfile, "r")) != NULL ) {
if (CheckMapVersion(mysymfile) == 1)
file = mysymfile;
@ -326,7 +325,7 @@ static char *FindSymbolFile(void)
}
/* At this stage of the game we are at the end of the symbol tables. */
dbgprintf("End of search list encountered.\n");
//dbgprintf("End of search list encountered.\n");
ENDfunc
return(file);
}
@ -397,8 +396,8 @@ static int CheckVersion(char *version)
patch = vnum & 0x000000FF;
minor = (vnum >> 8) & 0x000000FF;
major = (vnum >> 16) & 0x000000FF;
dbgprintf("Version string = %s, Major = %d, Minor = %d, Patch = %d.\n", version +
strlen(prefix), major, minor, patch);
//dbgprintf("Version string = %s, Major = %d, Minor = %d, Patch = %d.\n", version +
// strlen(prefix), major, minor, patch);
sprintf(vstring, "%d.%d.%d", major, minor, patch);
/* We should now have the version string in the vstring variable in
@ -411,7 +410,7 @@ static int CheckVersion(char *version)
imklogLogIntMsg(LOG_ERR, "Cannot get kernel version information.");
return(0);
}
dbgprintf("Comparing kernel %s with symbol table %s.\n", utsname.release, vstring);
//dbgprintf("Comparing kernel %s with symbol table %s.\n", utsname.release, vstring);
if ( sscanf (utsname.release, "%d.%d.%d", &major, &minor, &patch) < 3 ) {
imklogLogIntMsg(LOG_ERR, "Kernel send bogus release string `%s'.", utsname.release);
@ -478,7 +477,7 @@ static int CheckMapVersion(char *fname)
return(0);
}
if(dbgPrintSymbols)
dbgprintf("Address: %lx, Type: %c, Symbol: %s\n", address, type, sym);
//dbgprintf("Address: %lx, Type: %c, Symbol: %s\n", address, type, sym);
version = CheckVersion(sym);
}
fclose(sym_file);
@ -488,10 +487,10 @@ static int CheckMapVersion(char *fname)
imklogLogIntMsg(LOG_ERR, "Symbol table has incorrect version number.\n");
break;
case 0:
dbgprintf("No version information found.\n");
//dbgprintf("No version information found.\n");
break;
case 1:
dbgprintf("Found table with matching version number.\n");
//dbgprintf("Found table with matching version number.\n");
break;
}
@ -791,8 +790,8 @@ extern char *ExpandKadds(char *line, char *el)
strcat(elp, symbol);
elp += strlen(symbol);
dbgprintf("Symbol: %s = %lx = %s, %x/%d\n", sl+1, value,
(sym.size==0) ? symbol+1 : symbol, sym.offset, sym.size);
//dbgprintf("Symbol: %s = %lx = %s, %x/%d\n", sl+1, value,
// (sym.size==0) ? symbol+1 : symbol, sym.offset, sym.size);
value = 2;
if ( sym.size != 0 ) {
@ -808,7 +807,7 @@ extern char *ExpandKadds(char *line, char *el)
}
while ( kp != NULL);
dbgprintf("Expanded line: %s\n", el);
//dbgprintf("Expanded line: %s\n", el);
return(el);
}

View File

@ -167,7 +167,7 @@ extern int InitMsyms(void)
return(0);
}
dbgprintf("Loading kernel module symbols - Source: %s\n", KSYMS);
//dbgprintf("Loading kernel module symbols - Source: %s\n", KSYMS);
while ( fgets(buf, sizeof(buf), ksyms) != NULL ) {
if (num_syms > 0 && index(buf, '[') == NULL)

View File

@ -232,8 +232,8 @@ static void LogLine(char *ptr, int len)
*/
*line = 0; /* force null terminator */
dbgprintf("Line buffer full:\n");
dbgprintf("\tLine: %s\n", line);
//dbgprintf("Line buffer full:\n");
//dbgprintf("\tLine: %s\n", line);
Syslog(LOG_INFO, line_buff);
line = line_buff;
@ -504,7 +504,7 @@ rsRetVal klogWillRun(void)
symbol_lookup = (InitKsyms(symfile) == 1);
symbol_lookup |= InitMsyms();
if (symbol_lookup == 0) {
dbgprintf("cannot find any symbols, turning off symbol lookups\n");
//dbgprintf("cannot find any symbols, turning off symbol lookups\n");
imklogLogIntMsg(LOG_WARNING, "cannot find any symbols, turning off symbol lookups");
}
}