[Nagiosplug-devel] check_http bug

Karl DeBisschop karl at debisschop.net
Fri Aug 22 05:22:16 CEST 2003


On Fri, 2003-08-22 at 06:16, Voon, Ton wrote:
> 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?

I ran across the error when I was working on the redirection loop
limits. In my test cases, it was fixed by my changes.

But I did not find a bug and fix it - it was a side effect.

I don't see the problem in the current code either, butit is quite
obviously there. Is there some URL I can use to run this against so I
can try and debug it?

--
Karl




More information about the Devel mailing list