Yeah I was running into this bug about a month back.  When you ns_respond,
AOLServer frees the outputheaders, but [ns_conn outputheaders] still
returns a valid setId, so when you deal in the output headers after an
ns_respond, you crash the server.

-T

On Sun, 9 Jun 2002 18:35:04 -0700, Jim Wilcoxson <[EMAIL PROTECTED]> wrote:

>For an esoteric reason which I won't go into, we were doing something that
>occasionally caused server crashes.  It caused them in 2.3.3, and it causes
>them in 3.4.
>
>The problem seems to be using -headers, which eventually calls
>Ns_ConnReplaceHeaders (return.c) from NsTclRespondCmd (tclresp.c).  If the
>-headers argument is omitted, it works okay.
>
>
>Here is a test case:
>
>set setid [ns_conn outputheaders]
>   ns_log notice "tst: setid=$setid"
>ns_set put $setid abc def
>   ns_log notice "tst: put abc:def into set $setid; doing ns_respond"
>set newset [ns_set copy [ns_conn outputheaders]]
>ns_respond -status 200 -type text/plain -string "hi" -headers $newset
>   ns_log notice tst: back from ns_respond #1"
>set setid [ns_conn outputheaders]
>   ns_log notice "tst: setid=$setid"
>ns_set put $setid abc def
>ns_log notice "tst: done"
>return
>
>
>Here is the server log:
>
>[09/Jun/2002:18:25:44][13118.9226][-conn4-] Notice: tst: setid=t1
>[09/Jun/2002:18:25:44][13118.9226][-conn4-] Notice: tst: put abc:def into
set t1; doing ns_respond
>[09/Jun/2002:18:25:44][13118.9226][-conn4-] Notice: tst: back from
ns_respond #1"
>[09/Jun/2002:18:25:44][13118.9226][-conn4-] Notice: tst: setid=t1
>nsthread(13131) error: Ns_Pool: invalid block: 0x8c6ecf8
>[09/Jun/2002:18:25:45][14779.1024][-main-] Notice: nsmain: AOLserver/3.4
starting
>
>The exact error message varies: one time it said it couldn't allocate
>635xxxxxx bytes of memory.  Yeah, I could see how that might be tough on
our
>dev server...
>
>Jim

Reply via email to