ID:               45749
 Updated by:       fel...@php.net
 Reported By:      mazzarelli at gmail dot com
-Status:           Verified
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: Ubuntu 8.04
 PHP Version:      5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2009-06-03 23:22:57] asti at informatik dot uni-kiel dot de

Hi! 
I have the same problem
OS: Fedora 9
uname -r :2.6.27.24-78.2.53.fc9.i686
php -v: 5.2.9(cli)

Everything worked fine until I made the following combination of
bash-commands:
su;pear upgrade-all;<trying to get an external libary to work>;pecl
install pdflib;pear install File_PDF;yum -y install php-Zend*;

The External libaries was fpdf(aquired from their homepage).

Trying to get the pdf-routines to work caused a segfault.
Looking back all startet using pear upgrade-all ;

So I uninstalled php and all of it's components and manually clensed
the system from any reamainds of php-files(required for the interpreter
to run) and Config-files using locate,updatedb and rm -fr.
And made several reboots.

After that I reinstalled php step by step.
yum -y install php; worked well.
The interpreter runs good but as soon as I 
execute require_once(),include() or require() using the Interactive
shell I get a Segmentation fault.
This fault remained after I reinstalled the pearcomponents.
yum -y install php-pear*;

The strange things is that the skripts running on my Apache(Version
2.2.9(Unix)) are executing normally but grepping through the logs of the
server I get a stacktrace everytime I executed a script containing one
of the 3 functions mentioned earlier.
sincerly

------------------------------------------------------------------------

[2008-08-08 14:12:48] lbarn...@php.net

Reproducing:

$ php -a
Interactive shell

php > include "example2.php";
WTF?!

------------------------------------------------------------------------

[2008-08-08 01:39:03] mazzarelli at gmail dot com

In case it wasn't clear, I forgot to mention what seems to be
happening.

In interactive mode, upon reaching the "if (false)" containing a
try/catch block, the interactive session tries to include the file
again. This never stops and in continually includes the file over and
over. If you change the function to print out $i, you will see this
clearly.

If the condition is "true", it exhibits the correct behavior. False, or
a condition that evaluates to false, introduces the bug.

------------------------------------------------------------------------

[2008-08-07 23:52:52] mazzarelli at gmail dot com

Description:
------------
when running a bit of code from the command line, it works. Running the
same code interactively causes it to hang.

Reproduce code:
---------------
<?php
// example1.php
if (false) {
  try {} catch (Exception $e) {}
}
?>

<?php
// example2.php
function stop_the_madness () {
  static $i;
  if (++$i > 1) exit("WTF?!\n");
}

stop_the_madness();

if (false) {
  try {} catch (Exception $e) {}
}

exit("A-OK\n");
?>

Expected result:
----------------
In the first snippet, nothing should happen. But when that is in a
file, and require_once'ed from the interactive shell, it hangs.

In the second example, when ran from CLI, it says A-OK. But when ran
interactively, it says "WTF?!"



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45749&edit=1

Reply via email to