Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Infinite loop?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
troy
Smarty n00b


Joined: 07 May 2003
Posts: 2

PostPosted: Wed May 07, 2003 5:45 pm    Post subject: Infinite loop? Reply with quote

Using Smarty 2.5.0-RC1 (Apache 1.3.26, PHP 4.1.2) we appear to be experiencing an infinite loop in the httpd process on occassion. The httpd process goes to 99% CPU utilization and server-status shows that the process just runs and runs writing data to the client. This will go on until we kill the process. This only happens when pages that use Smarty are requested.

I was wondering if anyone else had a similar experience or knew of a case where Smarty could get into an infinite loop once it's done with display().

I know, we're running an RC of Smarty and PHP is an old version, but aside from upgrading and hoping it works better, is there a way to track this down?

Thanks!
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed May 07, 2003 7:15 pm    Post subject: Reply with quote

First thing is first, upgrade to 2.5.0. I don't know of anything that might cause a loop in there, but certainly get to a stable version first.

Monte
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed May 07, 2003 11:09 pm    Post subject: Reply with quote

Quote:
Smarty 2.5.0-RC1 (Apache 1.3.26, PHP 4.1.2)

Hmmm.

latest releases:
------------------
Apache : 1.3.27
PHP : 4.3.1
Smarty : 2.5.0

In all cases, the associated groups gave high reccomendations to upgrade to the latest versions, if only for security reasons.

What platform are you running this on? What other libraries are you using?

Now, as for the problem you mentioned, you should at MOST be getting script time-outs--PHP aborts long running scripts.

Quote:
knew of a case where Smarty could get into an infinite loop once it's done with display().

Did you say after display()? After display(), you're back into your code, so you may want to check there Wink
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu May 08, 2003 11:38 am    Post subject: Reply with quote

Update: Might be unrelated, but I just noticed a similar problem when using persistent connections to a mysql db through the dbx module on a smarty site. I think this must be a dbx / mysql (4.1) problem. It was really bad with the PHP Accelerator active, but still had problems without it.

@Troy: does that sound familiar??
Back to top
View user's profile Send private message
troy
Smarty n00b


Joined: 07 May 2003
Posts: 2

PostPosted: Thu May 08, 2003 9:41 pm    Post subject: Reply with quote

I upgraded to Smarty 2.5.0 and just saw it happen again today. This specific server has been running with this same config for a long time (years?) without ever seeing this. Yeah, I realize it's not the absolute latest, some people don't have the luxury of upgrading all components every 2 weeks. Wink

We recently used Smarty for 2 pages and the httpd process running indefinitely started the day the new pages went up and it only happens on the pages that use Smarty. So, I really suspect Smarty moreso than Apache or PHP. I also suspected PHP Accelerator (although it's been running fine for months as well) and turned it off to see if it stopped it, but it still happens. This is on Linux 2.4.18, btw.

server-status says W (Sending Reply). I'm sure PHP times out, but the httpd process itself just seems to run and never serves another request until it's killed. It will run for hours until it's killed.

Unfortunately, I can't reproduce it on other servers configured identically. The same URL works fine in my experience. I just notice the httpd process monopolizing the CPU once or twice a day.

Any other ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP