From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/72715 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: mod_php vs context: tight loop Date: Fri, 25 Nov 2011 09:17:08 +0100 Message-ID: <4ECF4F04.7040304@wxs.nl> References: <4ECF23B3.4030005@achievecorp.com.au> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1322209062 26965 80.91.229.12 (25 Nov 2011 08:17:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2011 08:17:42 +0000 (UTC) Cc: Brendan Jurd To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 25 09:17:37 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTqyV-00023O-VK for gctc-ntg-context-518@m.gmane.org; Fri, 25 Nov 2011 09:17:36 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7F59ACB1B9; Fri, 25 Nov 2011 09:17:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id m4j1wD9A-RZY; Fri, 25 Nov 2011 09:17:31 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A1E4DCB1BC; Fri, 25 Nov 2011 09:17:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2938ECB1BC for ; Fri, 25 Nov 2011 09:17:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iiqfOhLb6tnh for ; Fri, 25 Nov 2011 09:17:25 +0100 (CET) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id 0B0BECB1B9 for ; Fri, 25 Nov 2011 09:17:25 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAP8HNH8017859 for ; Fri, 25 Nov 2011 09:17:24 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.3h2) with ESMTP (TLS) id 829-1713362 for multiple; Fri, 25 Nov 2011 09:17:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <4ECF23B3.4030005@achievecorp.com.au> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=11; city=Den Haag; latitude=52.0833; longitude=4.3000; http://maps.google.com/maps?q=52.0833,4.3000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0aG1kho9V - 0153b1cd68ab - 20111125 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:72715 Archived-At: On 25-11-2011 06:12, Brendan Jurd wrote: > Hello list, > > I have a PHP application which generates documentation on the fly with > context. This has been working really well, but I am now testing > deployment on a new server with a more recent version of context, and it > seems to be somehow getting itself into a tight loop. > > When I run texexec via the mod_php apache module, the command never > returns, and `ps ax` shows the following: > > 9709 ? S 0:00 sh -c texexec --check 2>&1 > 9710 ? S 0:00 /bin/sh /usr/bin/texexec --check > 9711 ? R 9:59 /usr/bin/texlua /usr/bin/mtxrun --usekpse --execute > texexec --check > > `top` shows the mtxrun process eating 99.9% CPU. Attaching an strace to > this process, once it is underway, shows no output. > > My test script is as follows: > > $result = null; > system("texexec --check 2>&1", $result); > print $result . "\n"; > ?> > > When this same test script is run directly from the command line with > `php5 -f test.php`, it works as expected and outputs the following: > > MTXrun | kpse fallback with progname 'context' initialized in 0.01 > secondsTeXExec | current distribution: web2c > TeXExec | context source date: 2010.07.30 11:35 > TeXExec | format path: . /root/.texmf-config/web2c/luatex > /root/.texmf-var/web2c/luatex /root/texmf/web2c/luatex > /etc/texmf/web2c/luatex /var/lib/texmf/web2c/luatex > /usr/local/share/texmf/web2c/luatex /usr/share/texmf/web2c/luatex > /usr/share/texmf-texlive/web2c/luatex /root/.texmf-config/web2c > /root/.texmf-var/web2c /root/texmf/web2c /etc/texmf/web2c > /var/lib/texmf/web2c /usr/local/share/texmf/web2c /usr/share/texmf/web2c > /usr/share/texmf-texlive/web2c > TeXExec | start of analysis > TeXExec | end of analysis > TeXExec | > TeXExec | TeXExec | version 6.2.1 - 1997-2009 - PRAGMA ADE/POD > > 0 > > Using --timeout=30 in the arguments to texexec makes no difference; > mtxrun nonetheless runs forever until it is signalled. > > It seems that this must be down to some kind of difference in Apache's > execution environment -- I don't see any other way to explain the same > PHP code working in cli and failing in mod_php, even when running as the > same user. But what possible environmental factor could lead to mtxrun > freaking out like this? I'm hoping someone on this list may be able to > point me in the right direction. > > This server is a VZ instance running under proxmox, with the following > relevant ubuntu packages installed (per the 'natty' release): > > context 2010.07.30-1 > libapache2-mod-php5 5.3.5-1ubuntu7.3 > apache2 2.2.17-1ubuntu1.4 in such cases I always run with --batch to make sure that the job itself cannot block i have no clue Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________