[Nagiosplug-devel] check_http bug

Voon, Ton Ton.Voon at egg.com
Fri Aug 22 03:17:38 CEST 2003


Karl,

I seem to have a problem with the CVS HEAD version of check_http, but I
can't find a fix. This works okay on r130, but was failing before the
endless redirection loop change. Don't know exactly which version introduced
the problem.

On SunOS 5.6, if I run check_http against www.egg.com (through a proxy, but
also fails on internal test machines), there is a coredump.

Here's the output:
-----
$ ./check_http -v -H localhost -p 5865 -u http://www.egg.com/
--onredirect=follow
option f:4 
http://localhost:5865http://www.egg.com/ is 213 characters
STATUS: HTTP/1.1 301 Unknown reason
**** HEADER ****
Via: 1.1 PNNPXP01, 1.1 PNNPXP02
Connection: close
Content-Length: 0
Date: Fri, 22 Aug 2003 09:58:03 GMT
Server: Netscape-Enterprise/3.6 SP3
Location: http://new.egg.com/newegg
**** CONTENT ****

http://new.egg.com:80/newegg is 310 characters
STATUS: HTTP/1.1 302 Moved Temporarily
**** HEADER ****
Server: Netscape-Enterprise/4.1
Date: Fri, 22 Aug 2003 09:58:04 GMT
Set-Cookie:  ssuid=Maz84g00nVM0000EfQnFb643Kf; path= /; expires=Saturday,
06-Sep-2014 23:50:08 GMT
Location:  http://new.egg.com/visitor/0,,3_11060--View_819,00.html
Content-length: 0
Connection: close
**** CONTENT ****

Segmentation Fault(coredump)

-----

With a truss I get (tail last lines):
-----
write(1, " h t t p : / / l o c a l".., 59)      = 59
STATUS: HTTP/1.1 301 Unknown reason
write(1, " S T A T U S :   H T T P".., 36)      = 36
**** HEADER ****
Via: 1.1 PNNPXP01, 1.1 PNNPXP02
Connection: close
Content-Length: 0
Date: Fri, 22 Aug 2003 09:58:34 GMT
Server: Netscape-Enterprise/3.6 SP3
Location: http://new.egg.com/newegg
**** CONTENT ****

write(1, " * * * *   H E A D E R  ".., 217)     = 217
open64("/etc/.name_service_door", O_RDONLY)     = 3
fcntl(3, F_SETFD, 0x00000001)                   = 0
door_info(3, 0xEF62BD60)                        = 0
door_call(3, 0xEFFFD458)                        = 0
so_socket(2, 2, 0, "", 1)                       = 4
connect(4, 0x00032708, 16)                      = 0
send(4, " G E T   / n e w e g g  ".., 96, 0)    = 96
recv(4, " H T T P / 1 . 1   3 0 2".., 1023, 0)  = 310
recv(4, 0x00031D44, 1023, 0)                    = 0
close(4)                                        = 0
alarm(0)                                        = 0
http://new.egg.com:80/newegg is 310 characters
write(1, " h t t p : / / n e w . e".., 47)      = 47
STATUS: HTTP/1.1 302 Moved Temporarily
write(1, " S T A T U S :   H T T P".., 39)      = 39
**** HEADER ****
Server: Netscape-Enterprise/4.1
Date: Fri, 22 Aug 2003 09:58:35 GMT
Set-Cookie:  ssuid=Maz82w00gRo00018fQnFiNT3x3; path= /; expires=Saturday,
06-Sep-2014 23:50:08 GMT
Location:  http://new.egg.com/visitor/0,,3_11060--View_819,00.html
Content-length: 0
Connection: close
**** CONTENT ****

write(1, " * * * *   H E A D E R  ".., 311)     = 311
door_info(3, 0xEFFFD340)                        = 0
door_call(3, 0xEFFFD328)                        = 0
so_socket(2, 2, 0, "", 1)                       = 4
connect(4, 0x00032738, 16)                      = 0
    Incurred fault #6, FLTBOUNDS  %pc = 0xEF5C7020
      siginfo: SIGSEGV SEGV_MAPERR addr=0x2E6BD07C
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x2E6BD07C
        *** process killed ***
-----

I have narrowed the problem down to line 500 in check_http.c:
asprintf (&buf, "%s %s HTTP/1.0\r\n", http_method, server_url);

But I can't see anything wrong with it (in fact, the line is the same from
r130). Also a check_http to the redirected url is okay. I've tried a buf =
strdup(""), but this didn't fix. Any ideas?

Ton


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.





More information about the Devel mailing list