Mailing List Archive

0.8.1 bug report
There's a loop somewhere in the directory index generation code, that causes
apache to go into a neverending loop sucking down memory until it exhausts
the system and core dumps. Here's a snippet of a backtrace on the stack:

#41 0x6e79 in process_request_internal (r=0xd99d34) at http_request.c:528
#42 0x7147 in internal_redirect (new_uri=0xd99d1c "/vrml.tech/vrml/index", r=0xd58f28) at http_request.c:606
#43 0x11e7d in handle_dir (r=0xd58f28) at mod_dir.c:782
#44 0x5100 in invoke_handler (r=0xd58f28) at http_config.c:289
#45 0x6e79 in process_request_internal (r=0xd58f28) at http_request.c:528
#46 0x7147 in internal_redirect (new_uri=0xd58f10 "/vrml.tech/vrml/index", r=0xd19f18) at http_request.c:606
#47 0x11e7d in handle_dir (r=0xd19f18) at mod_dir.c:782
#48 0x5100 in invoke_handler (r=0xd19f18) at http_config.c:289
#49 0x6e79 in process_request_internal (r=0xd19f18) at http_request.c:528
#50 0x7147 in internal_redirect (new_uri=0xd19f00 "/vrml.tech/vrml/index", r=0xcdcd34) at http_request.c:606
#51 0x11e7d in handle_dir (r=0xcdcd34) at mod_dir.c:782
#52 0x5100 in invoke_handler (r=0xcdcd34) at http_config.c:289

This was in response to a request for
"http://vrml.wired.com/vrml.tech/vrml" (don't do it!) which doesn't exist.
however, a directory called "vrml.tech/vrml.art" exists. Here's the
output from ktrace:


....loop....
21198 httpd CALL break(0xe3fffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe42ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe45ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe48ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe4bffc)
21198 httpd RET break 0
21198 httpd CALL open(0xe498cc,0,0x1b6)
21198 httpd NAMI "/.htaccess"
21198 httpd RET open -1 errno 2 No such file or directory
21198 httpd CALL open(0xe498e4,0,0x1b6)
21198 httpd NAMI "/export/.htaccess"
21198 httpd RET open -1 errno 2 No such file or directory
21198 httpd CALL stat(0xe498a0,0xe08af4)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml/index"
21198 httpd RET stat -1 errno 2 No such file or directory
21198 httpd CALL stat(0xe498a0,0xe08af4)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml"
21198 httpd RET stat -1 errno 2 No such file or directory
21198 httpd CALL stat(0xe498a0,0xe08af4)
21198 httpd NAMI "/export/pub/vrml/vrml.tech"
21198 httpd RET stat 0
21198 httpd CALL open(0xe49a84,0,0xefbf79f8)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/"
21198 httpd RET open 12/0xc
21198 httpd CALL fcntl(0xc,0x2,0x1)
21198 httpd RET fcntl 0
21198 httpd CALL getdirentries(0xc,0x4e000,0x1000,0x4d014)
21198 httpd RET getdirentries 512/0x200
21198 httpd CALL stat(0xdcb14c,0xdcb098)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml.art"
21198 httpd RET stat 0
21198 httpd CALL getdirentries(0xc,0x4e000,0x1000,0x4d014)
21198 httpd RET getdirentries 0
21198 httpd CALL close(0xc)
21198 httpd RET close 0
21198 httpd CALL stat(0xe0a154,0xe0a098)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml.art/index"
21198 httpd RET stat -1 errno 2 No such file or directory
21198 httpd CALL open(0xe0aaa8,0,0xefbf7970)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml.art/"
21198 httpd RET open 12/0xc
21198 httpd CALL fcntl(0xc,0x2,0x1)
21198 httpd RET fcntl 0
21198 httpd CALL getdirentries(0xc,0x4e000,0x1000,0x4d014)
21198 httpd RET getdirentries 512/0x200
21198 httpd CALL break(0xe4effc)
21198 httpd RET break 0
21198 httpd CALL stat(0xe4c158,0xe4c098)
21198 httpd NAMI "/export/pub/vrml/vrml.tech/vrml.art/index.html"
21198 httpd RET stat 0
21198 httpd CALL getdirentries(0xc,0x4e000,0x1000,0x4d014)
21198 httpd RET getdirentries 0
21198 httpd CALL close(0xc)
21198 httpd RET close 0
21198 httpd CALL break(0xe51ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe54ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe57ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe5affc)
21198 httpd RET break 0
21198 httpd CALL break(0xe5dffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe60ffc)
21198 httpd RET break 0
21198 httpd CALL break(0xe63ffc)
..... loop ....


Any thoughts? Not a big issue, but I did find a 16 meg core dump today :)

Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com brian@hyperreal.com http://www.[hyperreal,organic].com/
Re: 0.8.1 bug report [ In reply to ]
Date: Mon, 17 Jul 1995 23:47:09 -0700 (PDT)
From: Brian Behlendorf <brian@organic.com>

There's a loop somewhere in the directory index generation code, that causes
apache to go into a neverending loop sucking down memory until it exhausts
the system and core dumps. Here's a snippet of a backtrace on the stack:

Ouch. Basically, what's going on here is that the directory indexing
code can't handle being MultiViews'ed to --- the infinite loop only
happens when the directory in question has an index.* file, but even
if it doesn't, the listing you get won't work. There's got to be a
better way, but for the first release, we can paper over the problem
like so.

(FWIW, the *tricky* part of this is that any relative links in the
generated directory index, or the index.html file (if you found it
correctly) would all be wrong, since they would be referring to the
directory by its abstracted name, which doesn't actually exist).

*** mod_negotiation.c.orig Tue Jul 18 08:31:29 1995
--- mod_negotiation.c Tue Jul 18 08:33:56 1995
***************
*** 1027,1032 ****
--- 1027,1036 ----
if (sub_req->status != 200) return sub_req->status;
}

+ /* BLETCH --- don't multi-resolve non-ordinary files */
+
+ if (!S_ISREG(sub_req->finfo.st_mode)) return NOT_FOUND;
+
/* Otherwise, use it. */

if (!do_cache_negotiated_docs(r->server)) r->no_cache = 1;