|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2005-10-04 08:38 UTC] david at tulloh dot id dot au
 Description:
------------
Using the 5.1 branch.
PHP segmentation faults at the end of running the simplest code.
Reproduce code:
---------------
<?php
echo 'hello world';
?>
(CLI)
Actual result:
--------------
hello world is printed perfectly, after the PHP program completes the segmentation fault occurs:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211463456 (LWP 25258)]
0xb7a88840 in ?? ()
(gdb) bt
#0  0xb7a88840 in ?? ()
#1  0x08131730 in tsrm_shutdown () at php-cvs-5.1/TSRM/TSRM.c:180
#2  0x081f425d in main (argc=2, argv=0xbffffb94)
    at php-cvs-5.1/sapi/cli/php_cli.c:1152
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
./configure \ '--enable-cli' \ '--with-pear' \ '--disable-cgi' \ '--prefix=/usr'\ '--with-apxs2=/usr/bin/apxs2' \ '--with-config-file-path=/etc/php5' \ '--enable-memory-limit' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--enable-sysvmsg' \ '--enable-sockets' \ '--enable-bcmath' \ '--enable-calendar' \ '--enable-shmop' \ '--enable-libxml' \ '--enable-xml' \ '--enable-spl' \ '--with-layout=GNU' \ '--with-inifile' \ '--with-exec-dir=/usr/lib/php5/libexec' \ '--with-regex=php' \ '--with-libxml-dir=/usr' \ '--with-zlib' \ '--with-zlib-dir=/usr' \ '--with-gettext' \ '--with-kerberos=shared,/usr' \ '--with-mime-magic=/usr/share/php5/magic.mime' \ '--with-pcre-regex=shared,/usr' \ '--with-pgsql=shared,/usr' \ '--with-tidy' \ '--disable-rpath' \ '--disable-debug' \ '--disable-dbx' \ '--disable-filepro' \ '--disable-gd-native-ttf' \ '--disable-gd-jis-conv' \ '--disable-dom' \ '--disable-exif' \ '--disable-simplexml' \ '--disable-ftp' \ '--disable-pdo' \ '--without-mm' \ '--without-iconv' \ '--without-sqlite' \ '--without-mysql' \ '--without-sybase-ct' \ '--without-gdbm' \ '--without-db4' \ '--without-cdb' \ '--without-flatfile' \ "$@"I managed to track this down to a much more specific test case. The following configure line is the smallest reproducable test case I could find. ./configure \ '--disable-all' \ '--enable-cli' \ '--disable-cgi' \ '--with-apxs2=/usr/bin/apxs2' \ '--with-pcre-regex=shared,/usr' Removing the apxs2 line, or making the pcre extension non-shared hides the fault, it's also not visible if the pcre extension isn't loaded. The tests were done with the latest CVS version, 5.1 branch. apache2-mpm-prefork (debian stable) - 2.0.54 libpcre3 - 5.0Repeated with --enable-debug Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1210001728 (LWP 23835)] 0xb7c07840 in ?? () (gdb) bt #0 0xb7c07840 in ?? () #1 0x080e5ce0 in tsrm_shutdown () at php-cvs-5.1/TSRM/TSRM.c:180 #2 0x081a82f4 in main (argc=3, argv=0xbffffb54) at php-cvs-5.1/sapi/cli/php_cli.c:1155 http://tulloh.id.au/php/bugs/34725/fail.debug.valgrind