Segfault using servicegroups in servicedependency

Thomas Guyot-Sionnest Thomas at zango.com
Fri Oct 20 19:10:14 CEST 2006


I was trying out my patch in another thread and experienced a segfault. It 
ended up the segfault is not caused by my code at all. It's not really 
bothering me but it's something devs might want to take a look at...

I'm using Nagios 2.5 with the fix for unscheduled triggered downtime entries 
from CVS.

So with:

define servicedependency {
  hostgroup_name                [Some hostgroups]
  service_description           Service name
  dependent_hostgroup_name      [Some hostgroups, same as in hostgroup_name]
  dependent_servicegroup_name   Servicegroup
  notification_failure_criteria c,u
}

When I run nagios -v I get a segfault. If I replace 
dependent_servicegroup_name with dependent_service_description it works fine.
Backtrace (I changed some recognizable names in it, but did not change length 
and kept unique names unique)

(gdb) run -v /etc/nagios/nagios.cfg
Starting program: /usr/src/nagios-2.5/base/nagios -v /etc/nagios/nagios.cfg
[Thread debugging using libthread_db enabled]
[New Thread -1209858368 (LWP 7456)]

Nagios 2.5
Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org)
Last Modified: 07-13-2006
License: GPL

Reading configuration data...


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209858368 (LWP 7456)]
0xb7eb26db in strlen () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7eb26db in strlen () from /lib/tls/libc.so.6
#1  0xb7eb2445 in strdup () from /lib/tls/libc.so.6
#2  0x080a4df7 in xodtemplate_expand_services (list=0xbfc284e4, 
reject_list=0xbfc284e8, host_name=0x81ca9d0 "HOSTNAM1", services=0xb7f63000 
"\\}\021")
    at ../xdata/xodtemplate.c:11142
#3  0x080a4a0f in xodtemplate_expand_servicegroups_and_services 
(servicegroups=0x204f4d53 <Address 0x204f4d53 out of bounds>, 
host_name=0x81ca9d0 "HOSTNAM1",
    services=0x204f4d53 <Address 0x204f4d53 out of bounds>) at 
../xdata/xodtemplate.c:10943
#4  0x0809a51a in xodtemplate_duplicate_objects () at 
../xdata/xodtemplate.c:4238
#5  0x080926cf in xodtemplate_read_config_data (main_config_file=0x81942b8 
"check_ckcmd!0!\"cmdargumen\"", options=32511, cache=0)
    at ../xdata/xodtemplate.c:252
#6  0x0808ad97 in read_object_config_data (main_config_file=0x8191008 
"/path/to/my/nagios.cfg", options=32511, cache=0) at ../common/objects.c:97
#7  0x0806da30 in read_all_object_data (main_config_file=0x8191008 
"/path/to/my/nagios.cfg") at config.c:193
#8  0x0806880c in main (argc=0, argv=0xbfc38b84, env=0xbfc38b94) at 
nagios.c:389
(gdb)

Thomas 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3076 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20061020/5886c762/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