|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-17 22:57 UTC] keith at ksmith dot com
[2003-12-18 03:16 UTC] sniper@php.net
[2004-01-01 20:48 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ This is an example of code that will cause PHP to segfault on exit. It will otherwise perform all functions, the *exit* causes the segfault The combination appears to be the use of TWO(2) include files coupled with a *persistent* odbc connection Run this, type something for input, that is not a file or hit ctrl-d Below is segfault2.php: <?php function do_nothing() {print "I did nothing\n";} ?> Does same thing with cgi/sapi && much lighter weight options list, this was a recent re-compile to see if problem still in 4.3.4. Tested with 4.3.1 cli/cgi also. Configure Command => './configure' '--prefix=/usr' '--with-cpdflib' '--with-db2' '--with-dba' '--enable-dbase' '--with-gdbm' '--with-ndbm' '--with-curl' '--with-freetype-dir=/usr/X11R6' '--with-gd' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-imagick=/usr/X11R6' '--with-jpeg-dir=/usr' '--with-mcrypt' '--with-mhash' '--with-pgsql=/opt/pgsql' '--with-png-dir=/usr' '--with-tiff-dir=/usr' '--with-unixODBC=/opt/unixODBC' '--with-xpm-dir=/usr/X11R6' '--enable-bcmath' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--with-zlib' '--with-bz2' '--enable-ftp' '--disable-url-fopen-wrapper' '--with-openssl' '--disable-short-tags' '--enable-pcntl' Reproduce code: --------------- <?php include_once("./segfault2.php"); // db_webdoc.inc.php appropriate php wrappings: // $dsn = "some_dsn"; // $dbuser = "username"; // $dbpass = "password"; $dbcfg = getcwd() . "/includes/db_webdoc.inc.php"; include_once($dbcfg); $dbh = odbc_pconnect($dsn, $dbuser, $dbpass); while($fbase = fgets(STDIN, 1024)) { $fbase = trim($fbase); clearstatcache(); if(!is_file($fbase)) { print "No such file: $fbase\n"; break; } } exit(0); ?> Expected result: ---------------- Should exit with status 0. Actual result: -------------- Exits by segfaulting with status 139