Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [issue] Running site in debugging mode gives internal server error
I can confirm this bug, and also the healing powers of Steve’s workaround
$callers = get_caller(10);
print "\n<pre style=\"padding-left: 2em;\" class=\"backtrace\"><code>".escape_output( join( "\n", $callers ) )."</code></pre>";
for
Apache/1.3.33 (Debian GNU/Linux) FrontPage/5.0.2.2623 mod_ssl/2.8.10 OpenSSL/0.9.7 PHP/5.2.3
EDIT: Bug does not occur with PHP 4.4.7, does occur with PHP 5.2.3 on two distinct hosts.
Last edited by wet (2007-12-12 13:27:37)
Offline
#14 2007-12-12 14:21:57
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [issue] Running site in debugging mode gives internal server error
Robert
just wondering if php is running as a cgi on those hosts?
— Steve
Offline
Re: [issue] Running site in debugging mode gives internal server error
One runs as CGI, the other runs as an Apache module.
Offline
#16 2007-12-12 15:06:58
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [issue] Running site in debugging mode gives internal server error
Ruud, Robert, Mary
searching the textpattern source code shows similar patterns that may trigger this error in other places.
@include/txp_plugin.php@ in(I’ve checked this and textpattern survives fine.)plugin_verify()
lib/txplib_db.php
insafe_query()
(fail path makes a similar call)lib/txplib_misc.php
inpluginErrorHandler()
andassert_int()
That’s from a txp4.0.5 install but not from svn; so Ruud’s recent feed handler wasn’t covered.
— Steve
Offline
Re: [issue] Running site in debugging mode gives internal server error
Does this also occur in PHP 5.2.4 or 5.2.5?
I mean, if we can’t rely on join() working properly when it is fed a simple array, we might as well dump PHP and switch to a different language.
Offline
Re: [issue] Running site in debugging mode gives internal server error
Does not occur on my localhost (XAMPP, Apache2, PHP 5.2.4). I do not have access to any PHP 5.2.4++ install “in the wild”.
Offline
#19 2007-12-12 15:47:21
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [issue] Running site in debugging mode gives internal server error
Ruud
Sorry, I don’t have access to anything higher than 5.2.3 without pulling the source code and learning how to build it myself. As it’s just about midnight here I don’t intend going through that learning curve today :)
I mean, if we can’t rely on join() working properly when it is fed a simple array, we might as well dump PHP and switch to a different language.
I feel the pain there too. Perhaps the news isn’t so bad. <g> It seems the problem is limited to cases where the second is an array directly returned by a function. Thankfully there are just a few of these cases in the source.
— Steve
Offline
Re: [issue] Running site in debugging mode gives internal server error
This one was fixed in 5.2.4. Looks familiar…
Offline
#21 2007-12-13 08:22:54
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [issue] Running site in debugging mode gives internal server error
I mean, if we can’t rely on join() working properly when it is fed a simple array, we might as well dump PHP and switch to a different language.
I vote for pig latin.
Works correctly for me on my local setup: PHP 5.2.5, Apache 2 module, Windows.
Offline
#22 2007-12-13 16:11:09
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [issue] Running site in debugging mode gives internal server error
Mary wrote:
I vote for pig latin. Works correctly for me on my local setup: PHP 5.2.5, Apache 2 module, Windows.
Sounds more acceptable than developing with Klingon bite-code, especially on Windows.
— Steve
Offline
Re: [issue] Running site in debugging mode gives internal server error
From a seperate thread, but I can confirm that it happened on 5.2.4 for me:
PHP version: 5.2.4
Register globals: 1
GD Image Library: version bundled (2.0.34 compatible), supported formats: GIF, JPG, PNG
Server Local Time: 2008-01-08 02:41:24
MySQL: 5.0.45-community
Locale: en_US.UTF-8
Server: Apache/1.3.39 (Unix) PHP/5.2.4 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.30 OpenSSL/0.9.7a
Apache version: Apache/1.3.39 (Unix) PHP/5.2.4 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.30 OpenSSL/0.9.7a
PHP Server API: apache
RFC 2616 headers:
Server OS: Linux 2.6.9-67.ELsmp
Offline
Re: [issue] Running site in debugging mode gives internal server error
Let’s try to get a minimal code example that still triggers this error:
<?php
$callers = join("\n", get_caller(10))
function get_caller($id)
{
$out = array();
$bt = debug_backtrace();
return $out;
}
?>
and with a non-empty array.
<?php
level1();
function level1() {level2();}
function level2() {level3();}
function level3() {
$callers = join("\n", get_caller(10));
}
function get_caller($id)
{
$out = array();
$bt = debug_backtrace();
$out[] = 'something';
$out[] = 'else';
return $out;
}
?>
Offline