Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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.

  1. @include/txp_plugin.php@ in plugin_verify() (I’ve checked this and textpattern survives fine.)
  2. lib/txplib_db.php in safe_query() (fail path makes a similar call)
  3. lib/txplib_misc.php in pluginErrorHandler() and assert_int()

That’s from a txp4.0.5 install but not from svn; so Ruud’s recent feed handler wasn’t covered.


Steve

Offline

#17 2007-12-12 15:37:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#18 2007-12-12 15:41:59

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

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

#20 2007-12-12 15:52:46

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

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

#23 2008-01-08 20:36:20

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

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

#24 2008-01-08 20:49:50

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#25 2008-01-08 20:52:30

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [issue] Running site in debugging mode gives internal server error

you forgot a semi-colon on the first line of the first block

Offline

#26 2008-01-09 01:11:34

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: [issue] Running site in debugging mode gives internal server error

I gave both scripts a try and both passed successfully with no segfaults (strange considering I still get segfaults with txp):

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

Last edited by variaas (2008-01-09 01:12:54)

Offline

#27 2008-01-09 06:01:23

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,416
Website GitHub Mastodon

Re: [issue] Running site in debugging mode gives internal server error

Both minimal cases run without errors on PHP 5.2.3 and PHP 4.4.7.

Apache’s log entry for the Textpattern abort on PHP 5.2.3: [Wed Jan 9 06:53:10 2008] [notice] child pid 5342 exit signal Segmentation fault (11)

Offline

#28 2008-02-21 08:45:50

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: [issue] Running site in debugging mode gives internal server error

strange..i’ve been getting this on my site as well. when i switch to debugging, i get 500 internal error along with huge 10mb core dumps. running php 5.2.1 (as cgi), txp 4.0.6, and apache error reads:

PHP Notice: Undefined variable: out in /home/***/public_html/textpattern/lib/txplib_misc.php on line 343 each time i try to switch to debugging. backend works just fine.

Last edited by iblastoff (2008-02-21 09:54:30)

Offline

Board footer

Powered by FluxBB