Re: [AOLSERVER] internal server redirects
On Thursday, September 7, 2006 8:22 pm, Dossy Shiobara [EMAIL PROTECTED] wrote: Phew! I guess it's time to start thinking about a 4.5.1 release ... 4.0.11? Regards, Jeremy Henty -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
Guys, I have a similar issue with redirects crashing the nsd 4.5.0, and I got a quickie fix to prevent the crash. Please check out this thread http://openacs.org/forums/message-view?message_id=471882 Of course, this does not fix the root cause (and apparently produces zombies), but at least it makes nsd more stable. Thanks, ~ Alex. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 2006.09.07, Alex Andryushkin [EMAIL PROTECTED] wrote: I have a similar issue with redirects crashing the nsd 4.5.0, and I got a quickie fix to prevent the crash. Please check out this thread http://openacs.org/forums/message-view?message_id=471882 Of course, this does not fix the root cause (and apparently produces zombies), but at least it makes nsd more stable. Ah, thanks for pointing to the OpenACS forum thread ... I think Nate Folkman fixed this in CVS HEAD: || 2006-06-28 Nathan Folkman [EMAIL PROTECTED] || || * nsd/adpeval.c: Fixed crash bug in NsAdpLogError() when || a NULL adp-framePtr is encountered. Can you try CVS HEAD ... see if it fixes the crash bug properly? -- Dossy -- Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 2006.09.07, Daniel P. Stasinski [EMAIL PROTECTED] wrote: On 9/7/06, Dossy Shiobara [EMAIL PROTECTED] wrote: Can you try CVS HEAD ... see if it fixes the crash bug properly? Done and fixed. Thank you :) Phew! I guess it's time to start thinking about a 4.5.1 release ... -- Dossy -- Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 9/7/06, Dossy Shiobara [EMAIL PROTECTED] wrote: Can you try CVS HEAD ... see if it fixes the crash bug properly? Done and fixed. Thank you :) Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
However, the bug I found was due to an API using a page level global var, not sure exactly what you call this in C, but the API was on another page. Mine seems to be unrelated. I did further checking and when ns_returnredirect refers to -any- local URL it causes a segfault. The relocated URL is passed back to the browser, but the server is dead before it can load it. Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On Wednesday 06 September 2006 08:02, Daniel P. Stasinski wrote: However, the bug I found was due to an API using a page level global var, not sure exactly what you call this in C, but the API was on another page. Mine seems to be unrelated. I did further checking and when ns_returnredirect refers to -any- local URL it causes a segfault. The relocated URL is passed back to the browser, but the server is dead before it can load it. What version, etc? I'm using 4.5.0a and I don't seem to have problem with ns_returnredirect. Also maybe try telnetting in: [EMAIL PROTECTED]:~ telnet maria Trying 192.168.111.108... Connected to maria. Escape character is '^]'. GET /redirect.tcl HTTP/1.0 Host: maria: HTTP/1.0 302 Found Location: inspect MIME-Version: 1.0 Date: Wed, 06 Sep 2006 16:10:28 GMT Server: AOLserver/4.5.0a Content-Type: text/html; charset=UTF-8 Content-Length: 279 Connection: close You could further test building up this response without using ns_returnredirect. Seems weird. tom jackson -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
What version, etc? I'm using 4.5.0a and I don't seem to have problem with ns_returnredirect. This is on 4.5a on CentOs 4.4 server. I tried this snippet: % ### x.adp set headerSet [ns_conn outputheaders] ns_set put $headerSet Location http://beta.blahblah.com/headers.adp; ns_return $conn 302 text/html Nada\n % Upon telnetting in and making the request, it replied and then crashed. The server log showed: [06/Sep/2006:08:51:28][2828.3082869680][-conn:0-] Fatal: received fatal signal 11 Here is the session: [EMAIL PROTECTED] ~]$ telnet 192.168.0.89 80 Trying 192.168.0.89... Connected to 192.168.0.89 (192.168.0.89). Escape character is '^]'. GET /x.adp HTTP/1.0 Host: beta.blahblah.com:80 HTTP/1.0 302 Found Location: http://beta.blahblah.com/headers.adp MIME-Version: 1.0 Date: Wed, 06 Sep 2006 15:51:28 GMT Server: AOLserver/4.5.0 Content-Type: text/html; charset=utf-8 Content-Length: 5 Connection: close Nada Connection closed by foreign host. [EMAIL PROTECTED] ~]$ (server dead at this point) -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
Daniel, A few things: 1. try this on a tcl page, not an adp. 2. this is not a relative redirect, this is a full url redirect (not sure what distinction you were making with this, didn't you say one was a problem?) 3. what is the $conn argument for? just 'ns_return 302 text/html something here' tom jackson On Wednesday 06 September 2006 09:02, Daniel P. Stasinski wrote: What version, etc? I'm using 4.5.0a and I don't seem to have problem with ns_returnredirect. This is on 4.5a on CentOs 4.4 server. I tried this snippet: % ### x.adp set headerSet [ns_conn outputheaders] ns_set put $headerSet Location http://beta.blahblah.com/headers.adp; ns_return $conn 302 text/html Nada\n % Upon telnetting in and making the request, it replied and then crashed. The server log showed: [06/Sep/2006:08:51:28][2828.3082869680][-conn:0-] Fatal: received fatal signal 11 Here is the session: [EMAIL PROTECTED] ~]$ telnet 192.168.0.89 80 Trying 192.168.0.89... Connected to 192.168.0.89 (192.168.0.89). Escape character is '^]'. GET /x.adp HTTP/1.0 Host: beta.blahblah.com:80 HTTP/1.0 302 Found Location: http://beta.blahblah.com/headers.adp MIME-Version: 1.0 Date: Wed, 06 Sep 2006 15:51:28 GMT Server: AOLserver/4.5.0 Content-Type: text/html; charset=utf-8 Content-Length: 5 Connection: close Nada Connection closed by foreign host. [EMAIL PROTECTED] ~]$ (server dead at this point) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
1 1. try this on a tcl page, not an adp. 2. this is not a relative redirect, this is a full url redirect was a problem?) 3. what is the $conn argument for? As a registered tcl proc it works fine. With further testing, both ns_return and ns_returnredirect within an adp crash the server. Normally ns_return would never be used with an adp, but ns_returnredirect should be permitted. As of 4.0.10 it was working as expected. The $conn parameter is an artifact from long ago. It is/was the connection id. Even with it gone, it still crashes. Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
it still crashes. Ok, I just found this on the new docs NOTE: The script does not end at the time this command is invoked. ns_adp_abort or ns_adp_return should be called to end script processing after ns_returnredirect This does stop the crash but I would still consider it to be a bug. Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) -Titi -Original Message- From: Daniel P. Stasinski [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 2:10 PM To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] internal server redirects it still crashes. Ok, I just found this on the new docs NOTE: The script does not end at the time this command is invoked. ns_adp_abort or ns_adp_return should be called to end script processing after ns_returnredirect This does stop the crash but I would still consider it to be a bug. Daniel -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 9/6/06, Titi Ala'ilima [EMAIL PROTECTED] wrote: It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) That's exactly why its a bug. You may indeed want to continue processing after sending a response to the client but you can't do that if the server crashes. Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
And the segfaulting when you do this? Also a feature? I'd call it a bug. Nothing you can do in an adp, scheduled proc, etc, etc (plain tcl) should cause the server to crash. Rusty Titi Ala'ilima wrote: It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) -Titi -Original Message- From: Daniel P. Stasinski [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 2:10 PM To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] internal server redirects it still crashes. Ok, I just found this on the new docs NOTE: The script does not end at the time this command is invoked. ns_adp_abort or ns_adp_return should be called to end script processing after ns_returnredirect This does stop the crash but I would still consider it to be a bug. Daniel -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
The segfault is obviously a bug... I think what's being referring to is the behavior that allows code to continue executing after an ns_returnredirect unless an ns_adp_abort is explicitly specified. - n [EMAIL PROTECTED] wrote: And the segfaulting when you do this? Also a feature? I'd call it a bug. Nothing you can do in an adp, scheduled proc, etc, etc (plain tcl) should cause the server to crash. Rusty Titi Ala'ilima wrote: It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) -Titi -Original Message- From: Daniel P. Stasinski [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 2:10 PM To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] internal server redirects it still crashes. Ok, I just found this on the new docs NOTE: The script does not end at the time this command is invoked. ns_adp_abort or ns_adp_return should be called to end script processing after ns_returnredirect This does stop the crash but I would still consider it to be a bug. Daniel -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On Wednesday 06 September 2006 11:49, Daniel P. Stasinski wrote: On 9/6/06, Titi Ala'ilima [EMAIL PROTECTED] wrote: It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) That's exactly why its a bug. You may indeed want to continue processing after sending a response to the client but you can't do that if the server crashes. It's a bug because it crashes the server due to a programmers mistake. It may be due to the adp parser screwing up, but I don't use adps tom jackson -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
Sorry, I was narrowly viewing the question of whether the behavior of the redirect itself was a bug. Since you can successfully call an abort command afterwards, it seems that the bug is not in the redirect itself, but how the mess gets cleaned up after the fact. Namely, it seems, that ADP handler gets freaks out when you've already sent a fully formed response before it gets to do so, and nobody told it not to. It's still a coding error not to inform the ADP that it needn't return a response, but crashing is of course an unacceptable result particularly for such a minor breach of protocol. -Titi -Original Message- From: Daniel P. Stasinski [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 2:50 PM To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] internal server redirects On 9/6/06, Titi Ala'ilima [EMAIL PROTECTED] wrote: It's not a bug, it's a feature. Seriously. Sometimes you want to return a response to the connection and then continue processing afterwards. Or at least, sometimes _I_ want to do that. :-) That's exactly why its a bug. You may indeed want to continue processing after sending a response to the client but you can't do that if the server crashes. Daniel -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 2006.09.06, Daniel P. Stasinski [EMAIL PROTECTED] wrote: I tried this snippet: % ### x.adp set headerSet [ns_conn outputheaders] ns_set put $headerSet Location http://beta.blahblah.com/headers.adp; ns_return $conn 302 text/html Nada\n % Upon telnetting in and making the request, it replied and then crashed. The server log showed: [06/Sep/2006:08:51:28][2828.3082869680][-conn:0-] Fatal: received fatal signal 11 What's your config .tcl look like? Any filters? Oh, and ... can you give us a backtrace from the corefile? -- Dossy -- Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 2006.09.06, Daniel P. Stasinski [EMAIL PROTECTED] wrote: it still crashes. Ok, I just found this on the new docs NOTE: The script does not end at the time this command is invoked. ns_adp_abort or ns_adp_return should be called to end script processing after ns_returnredirect This does stop the crash but I would still consider it to be a bug. I absolutely agree, the crash is most certainly a bug. A stacktrace would be most helpful, unless I can reproduce it here ... -- Dossy -- Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On 9/5/06, Tom Jackson [EMAIL PROTECTED] wrote: I spent several hours fixing a bug with internal redirects, then found out it had already been fixed. If a status had been mapped to a url, then the server redirects (internally) to that url. Can you elaborate more on this? I'm having a similar problem right now with 4.5. I have a registered adp as: ns_register_adp GET /checkout [ns_info pageroot]/rewrites/checkout.adp and when I do a ns_returnredirect http://blahblah.com/checkout; from another ADP, I get a segfault. I can redirect to any other site, just not the same site. Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | [EMAIL PROTECTED] | http://www.disabilities-r-us.com | Google Talk: mooo| http://www.scriptkitties.com | Jabber: [EMAIL PROTECTED] | http://www.avenues.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] internal server redirects
On Tuesday 05 September 2006 12:42, Daniel P. Stasinski wrote: On 9/5/06, Tom Jackson [EMAIL PROTECTED] wrote: I spent several hours fixing a bug with internal redirects, then found out it had already been fixed. If a status had been mapped to a url, then the server redirects (internally) to that url. Can you elaborate more on this? I'm having a similar problem right now with 4.5. I have a registered adp as: ns_register_adp GET /checkout [ns_info pageroot]/rewrites/checkout.adp and when I do a ns_returnredirect http://blahblah.com/checkout; from another ADP, I get a segfault. I can redirect to any other site, just not the same site. Internal redirects are those which don't send a response back to the client, the code justs changes the target url and runs the 'page' which is at that location. I haven't noticed (or looked for) any problems with ns_returnredirect. However, the bug I found was due to an API using a page level global var, not sure exactly what you call this in C, but the API was on another page. The two files involved were server.c (defined var) and return.c (tried to use it). The result was the var was NULL, so the registering procedure didn't do anything. You could have a similar problem. tom jackson Here is what I changed: return.c: void Ns_RegisterReturn2(NsServer *servPtr, int status, char *url) { Tcl_HashEntry *hPtr; intnew; if (servPtr != NULL) { hPtr = Tcl_CreateHashEntry(servPtr-request.redirect, (char *) status, new); if (!new) { ns_free(Tcl_GetHashValue(hPtr)); } if (url == NULL) { Tcl_DeleteHashEntry(hPtr); Ns_Log(Error, return: redirect not registered status = '%i' url = '%s', status, url); } else { Tcl_SetHashValue(hPtr, ns_strdup(url)); Ns_Log(Notice, return: redirect registered status = '%i' url = '%s', status, url); } } else { Ns_Log(Error, return: redirect server not found); } } in server.c: /* * Configure the url, proxy and redirect requests. */ Tcl_InitHashTable(servPtr-request.proxy, TCL_STRING_KEYS); Ns_MutexInit(servPtr-request.plock); Ns_MutexSetName2(servPtr-request.plock, nsd:proxy, server); path = Ns_ConfigGetPath(server, NULL, redirects, NULL); set = Ns_ConfigGetSection(path); Tcl_InitHashTable(servPtr-request.redirect, TCL_ONE_WORD_KEYS); for (i = 0; set != NULL i Ns_SetSize(set); ++i) { key = Ns_SetKey(set, i); map = Ns_SetValue(set, i); status = atoi(key); if (status = 0 || *map == '\0') { Ns_Log(Error, return: invalid redirect '%s=%s', key, map); } else { Ns_Log(Notice, return: redirect mapped '%s=%s', key, map); -- added this Ns_RegisterReturn2(servPtr, status, map); --- changed this } } /* * Initialize ADP. */ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.