Segfault in xdata/xodtemplate.c:13774 + patch

Herbert Straub herbert at linuxhacker.at
Mon Feb 12 20:16:11 CET 2007


Hallo,

i'm used the CVS snapshot of today and after converting my nagios.cfg i
got with 'nagios -v /etc/nagios3/nagios.cfg' - Debugger output:

(gdb) bt
    #0  0x00002aaaaafcefc0 in strlen () from /lib/libc.so.6
    #1  0x00002aaaaafced06 in strdup () from /lib/libc.so.6
    #2  0x0000000000480dd7 in xodtemplate_add_member_to_memberlist
(list=0x7fffffa55fc0, name1=0x5f9ce6 "mytest", name2=0xfffffeff00000000
<Address 0xfffffeff00000000 out of bounds>) at ../xdata/xodtemplate.c:13774
    #3  0x000000000047ef42 in
xodtemplate_add_hostgroup_members_to_memberlist (list=0x7fffffa55fc0,
temp_hostgroup=0x5b5df0, _config_file=6, _start_line=154) at
../xdata/xodtemplate.c:12684
    #4  0x000000000047ea1c in xodtemplate_expand_hostgroups
(list=0x7fffffa55fc0, reject_list=0x7fffffa55fb8, hostgroups=0x5bada0
"nntp-server", _config_file=6, _start_line=154) at
../xdata/xodtemplate.c:12488
    #5  0x000000000047e647 in xodtemplate_expand_hostgroups_and_hosts
(hostgroups=0x5bada0 "nntp-server", hosts=0x0, _config_file=6,
_start_line=154) at ../xdata/xodtemplate.c:12325
    #6  0x00000000004694d1 in xodtemplate_duplicate_services () at
../xdata/xodtemplate.c:4318
    #7  0x000000000045447d in xodtemplate_read_config_data
(main_config_file=0x5af010 "/etc/nagios3/nagios.cfg", options=32511,
cache=0, precache=0) at ../xdata/xodtemplate.c:278
    #8  0x000000000044b120 in read_object_config_data
(main_config_file=0x5af010 "/etc/nagios3/nagios.cfg", options=32511,
cache=0, precache=0) at ../common/objects.c:93
    #9  0x0000000000419a0a in read_all_object_data
(main_config_file=0x5af010 "/etc/nagios3/nagios.cfg") at config.c:225
    #10 0x000000000040f420 in main (argc=3, argv=0x7fffffa56438) at
nagios.c:470
    (gdb)

    (gdb) frame 2
    #2  0x0000000000480dd7 in xodtemplate_add_member_to_memberlist
(list=0x7fffffa55fc0, name1=0x5f9ce6 "mytest", name2=0xfffffeff00000000
<Address 0xfffffeff00000000 out of bounds>) at ../xdata/xodtemplate.c:13774
    (gdb)

See the pointer of name2 : <Address 0xfffffeff00000000 out of bounds>
and this is not null. This happens an an amd64 machine. I think the
problem ist the call of xodtemplate_add_member_to_memberlist with only
two parameters: list,member_name. After patching (see attachment), the
error is gone.

Regards
Herbert Straub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xodtemplate-segfault.c.patch
Type: text/x-patch
Size: 2842 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070212/dc647a92/attachment.bin>
-------------- next part --------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
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