httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject PHP apache2filter problem
Date Mon, 08 Apr 2002 17:06:38 GMT
I'm trying to get a PHP4 OS/2 port working with Apache 2.0.35 but have hit
a problem that may need a filtering guru to fix. I'm working with the 4.2.0
branch as that's what's slated to be released before long.

The problem I've found is that the SG(server_context), which holds a
pointer to data allocated from the request pool, lives into the next
request which causes a crash in ap_save_brigade() called from
php_output_filter().

Tracing through with a debugger, the sequence of events is:

- SG(server_context) starts life as NULL
- php_output_filter() sets it, uses it, executes script, NULLs it again
- php_input_filter() sets it, uses it
- request ends
- next request, php_output_filter() sees it's non-null & tries to use it,
SEGFAULT!

So it looks like SG(server_context) needs to be NULLed at the end of the
request but I can't see an appropriate place to do that.

It also seems fishy to me (and is probably the real problem) that
php_input_filter() is run AFTER php_execute_script() has finished. Isn't
that's too late?

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message