Cannot view trends
Hendrik Bäcker
andurin at process-zero.de
Sat Mar 22 23:52:16 CET 2008
Hi List,
I've spent some time with the gdb too.
> Running trends.cgi in gdb, it apparently fails at this point:
>
> <snip>
> ~ printf("</table>\n");
> ~ }
>
> #ifndef DEBUG
> ~ /* check authorization... */
> ~ if(display_type==DISPLAY_HOST_TRENDS){
> ~ temp_host=find_host(host_name); // fail here!!!
> <snip>
>
> because the call to find_host() returns NULL. Again, running the other scripts
> from the command line, with the same host entry, *does* work fine.
>
That's true. find_host() returns NULL cause skiplist_find_first()
returns NULL behind.
I am not familar with the new skiplist logic, so perhaps someone else
can make a review of that gdb run.
########
Breakpoint 1, find_host (name=0x807d008 "localhost") at
../common/objects.c:2746
2746 host * find_host(char *name){
(gdb) s
2748
2749 if(name==NULL)
2751
2752 temp_host.name=name;
2753
2754 return
skiplist_find_first(object_skiplists[HOST_SKIPLIST],&temp_host,NULL);
(gdb)
skiplist_find_first (list=0x807dba0, data=0xbfe52ad8, node_ptr=0x0) at
../common/skiplist.c:336
336 skiplistnode *thisnode=NULL;
337 skiplistnode *nextnode=NULL;
338 int level=0;
340 if(list==NULL || data==NULL)
343 thisnode=list->head;
344 for(level=list->current_level;level>=0;level--){
345 while((nextnode=thisnode->forward[level])){
### At this point 'level' is '0'
### Don't know what should happen with 'nextmode' but it results in NULL
344 for(level=list->current_level;level>=0;level--){
### 'level' is decrementet so actual '-1'
353 if(nextnode &&
list->compare_function(nextnode->data,data)==0){
### not true cause nextmode is null - I think
359 if(node_ptr)
363 return NULL;
(gdb) bt full
#0 skiplist_find_first (list=0x807dba0, data=0xbfe52ad8, node_ptr=0x0)
at ../common/skiplist.c:363
thisnode = (skiplistnode *) 0x807ecc0
nextnode = (skiplistnode *) 0x0
level = -1
#1 0x0805ac86 in find_host (name=0x807d008 "localhost") at
../common/objects.c:2754
temp_host = {name = 0x807d008 "localhost", display_name =
0x807fd3c "CEST", alias = 0xb7eb59c0 "", address = 0x0, parent_hosts =
0x0, child_hosts = 0x0, services = 0x3637,
<cutted useless data> nexthash = 0x47e4349c}
#2 0x0804a935 in main () at trends.c:561
result = 0
temp_buffer = "Host State Trends\000ٷ�7���������\035��ѷ\001",
'\0' <repeats 15 times>, "�忳\216�\225��\000����\006", '\0' <repeats 11
times>, ",\227�000\000\000\000K
<cutted useless data>
end_time = '\0' <repeats 1023 times>
string_width = -1209311244
string_height = -1075493448
start_timestring = "03-21-2008 23:20:12", '\0' <repeats 1004 times>
end_timestring = "03-22-2008 23:20:12", '\0' <repeats 1004 times>
temp_host = (host *) 0x80494a0
temp_service = (service *) 0xb7eb5ff4
is_authorized = 1
found = 0
days = 1
hours = 0
minutes = 0
seconds = 0
first_service = 0x0
t3 = -1208422412
current_time = 1206224412
t = (struct tm *) 0xb7f77ab0
########
Regards
Hendrik
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel
More information about the Developers
mailing list