php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23565 Displaying Highlighted Syntax (php -s) or (.phps) seg faults
Submitted: 2003-05-09 10:24 UTC Modified: 2003-05-23 09:54 UTC
From: tim at timcrider dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.2RC4 OS: Red Hat 8.0
Private report: No CVE-ID: None
 [2003-05-09 10:24 UTC] tim at timcrider dot com
Whenever I try to use the source highlight features, PHP seg faults in both CLI and Apache Module. The apache module just displays "Page cannot be displayed", but CLI dumps a seg fault.

-----[ Source ]-----
<?php
 print "hello";
?>
-----[ CLI Output ]-----
(towely) tim# php -s test.php 
<code><font color="#000000">
<font color="#0000CC">&lt;?php<br /> </font><font color="#006600">print </font><font color="#CC0000">"hello"</font><font color="#006600">;<br /></font><font color="#0000CC">?&gt;<br /></font>
</font>
Segmentation fault
-----[ Configuration ]-----
./configure --prefix=/usr/local \
--with-apache=../www \
--with-gettext \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-mcrypt=/usr/local \
--with-mcal=/usr/local \
--with-ming=/usr/local \
--with-mhash=/usr/local \
--with-mysql=/usr/local \
--with-pdflib=/usr/local \
--with-zlib=/usr/local \
--with-ncurses=/usr/local \
--with-tiff-dir="/usr/local" \
--with-unixODBC=/usr/local/unixODBC \
--with-xml \
--with-calendar=shared \
--with-png-dir=/usr/local \
--with-freetype=/usr/local \
--with-freetype-dir=/usr/local \
--with-ttf=/usr/local \
--with-fdftk=/usr/local \
--with-openssl=/usr/local \
--with-bz2 \
--with-dom \
--with-mm \
--with-pspell=/usr/local \
--enable-localizer \
--enable-bcmath \
--enable-calendar \
--enable-dio \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-shmop \
--enable-sigchild \
--enable-sockets \
--enable-track-vars \
--enable-magic-quotes \
--enable-trans-sid \
--enable-libgcc \
--enable-wddx \
--enable-sysvshm \
--enable-sysvsem \
--enable-sysvmsg \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-dbase \
--enable-mbregex

If you need any other information please drop me a line.

 Tim

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-09 11:03 UTC] neon at neon-line dot net
I can't verify that. It outputs html and exits without error.
Tryed with php 4.3.2RC2 and php5-dev. Platforms FreeBSD 4.7, 4.8 and Debian Linux 2.4.x.
 [2003-05-13 19:55 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

And try the snapshot with this configure line:

./configure --disable-all --disable-cgi

(ie. just plain CLI)

I don't get any segfault either..


 [2003-05-16 14:57 UTC] tim at timcrider dot com
I found out what was causing the crash, so this can be updated to be more accurate. In my php.ini file I had this set:

output_handler = ob_gzhandler

It worked fine for serving pages, and command line, but the source seg faults. I commented out that line:

;output_handler = ob_gzhandler

and everything works fine now.
 [2003-05-17 12:06 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Cannot replicate using latest CVS.
 [2003-05-22 16:40 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-05-23 06:05 UTC] tim at timcrider dot com
I am still getting the error whenever I add in an 'output_handler'

-----[ test ]-----
(towely) htdocs# php -s inf.php 
<code><font color="#000000">
<font color="#0000CC">&lt;?php<br /><br />phpinfo</font><font color="#006600">();<br /><br /></font><font color="#0000CC">?&gt;<br /></font>
</font>
Segmentation fault

-----[ script ]-----
<?php
phpinfo();
?>

-----[ Version info ]-----
(towely) htdocs# php -v
PHP 4.3.2RC4 (cli) (built: May 22 2003 13:16:57)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
    with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge

-----[ ini entry ]-----
output_handler = ob_gzhandler
 [2003-05-23 09:54 UTC] sniper@php.net
It's that 3rd party accelerator..remove it and this will
work.

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 08:00:02 2026 UTC