Page 1 of 1

[Nagios-devel] Segfault using servicegroups in servicedependency

Posted: Fri Oct 20, 2006 9:10 am
by Guest
This is a multi-part message in MIME format.

------=_NextPart_000_04A4_01C6F449.14E91F50
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

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 ,
host_name=0x81ca9d0 "HOSTNAM1",
services=0x204f4d53 ) 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

------=_NextPart_000_04A4_01C6F449.14E91F50
Content-Type: application/x-pkcs7-signature;
name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="smime.p7s"

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIIzjCCAlYw
ggG/oAMCAQICEF6WlTyD2iR9R4J/yf+4yw4wDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx
JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ
ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MTAxNjE1MTgxNVoXDTA3MTAxNjE1MTgx
NVowQjEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEfMB0GCSqGSIb3DQEJARYQdGhv
bWFzQHphbmdvLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtkCTbSUT0qmJN70ik/vg
3cNmuRbfC18Mz7T6CNqwyb/URZ5n3PQlA0Tel2aY73QfCa4Ws1eQ+b19KJb/9IbgcRM198OZx+jY
3R+Y2/lVSsUoQaFpHYnZp9voKG+ugi3MiPChy9q/OuNfRL7IiKxjpsYKVRHrqFLWvnX9qIoxkjcC
AwEAAaMtMCswGwYDVR0RBBQwEoEQdGhvbWFzQHphbmdvLmNvbTAMBgNVHRMBAf8EAjAAMA0GCSqG
SIb3DQEBBQUAA4GBAMNB9/ulaYWECjEiG5hlAtN/ZXiaWSOOBRp4LJSfXX60VgmwQUfYHmWycMAv
yHaGz06DrMonrCHiHcpkEkntgU7NK6G95Hg7CpHyd98+zRDxBe/TTeGrePqFxQ+MbGZ4+orUPAtq
8PNFGCogpyCElTzkSP8KkYJ3cKIAaBAa2NrxMIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQF
ADCB0TELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBU
b3duMRowGAYDVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT
ZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIENBMSsw
KQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUuY29tMB4XDTk2MDEwMTAwMDAw
MFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYTAlpBMRUwEwYDV

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]