Bug 74780 - [patch] php5 crashes with threaded apache2
Summary: [patch] php5 crashes with threaded apache2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
Depends on:
Reported: 2004-12-06 17:40 UTC by Peter Jeffery
Modified: 2005-01-10 17:02 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeffery 2004-12-06 17:40:20 UTC
(Sorry if this is a duplicate, but I think the original didn't make it using command line send-pr)

When using the php5 module in apache2 (apache-worker-2.0.52_3) it regularly crashes when trying to process non-trivial php files. After some experimentation it seemed that this was due to stack overflow problems and to back that up I found this:


Which is a patch for HPUX which also has 64k thread stack sizes. This seems to have fixed the problem


-#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(__darwin__) && !defined(__APPLE__)
+#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(__darwin__) && !defined(__APPLE__) && !(defined(ZTS) && defined(__FreeBSD__))
 # define do_alloca(p) alloca(p)
 # define free_alloca(p)
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- Zend/zend.h.orig    Mon Dec  6 15:42:56 2004
+++ Zend/zend.h Mon Dec  6 15:46:40 2004
@@ -176,7 +176,7 @@
How-To-Repeat: compile apache2 WITH_MPM=worker and then php5 so that it builds itself in threaded mode.

I don't have any specific php files to provide as they are not yet public, but a normal 650 line file with a bunch of functions in it crashed httpd everytime. Also compiling Smarty templates would pretty much always crash httpd. This patch fixes that.
Comment 1 Thierry Thomas freebsd_committer 2004-12-06 17:45:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer.
Comment 2 Henri Hennebert 2005-01-10 11:24:12 UTC
I encounter this problem with PHP_4.3.10 and the submitted patch fix it.


Comment 3 Alex Dupre freebsd_committer 2005-01-10 17:02:01 UTC
State Changed
From-To: open->closed

Committed, thanks!