php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27773 Segmentation fault (core dumped) if -DZTS
Submitted: 2004-03-30 05:27 UTC Modified: 2004-03-30 10:32 UTC
From: krasnov at euroweb dot ru Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.5 OS: FreeBSD 4.8 RELEASE
Private report: No CVE-ID: None
 [2004-03-30 05:27 UTC] krasnov at euroweb dot ru
Description:
------------
If I compile PHP 4.3.5 with --enable-experimental-zts or with --with-apxs2=/usr/local/apache2/bin/apxs (which affection are the same), I see "Segmentation fault (core dumped)" as a result of any php script in CLI mode.

And if I uses --with-apxs2, I get result like bug #17735, which you have closed as Bogus, but it is not right, cause it does not depend on Apache.

Here is compilation options:

CFLAGS='-O -pipe -march=pentiumpro -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE -DHAVE_BROKEN_REALPATH -I/usr/local/include/pthread
/linuxthreads -L/usr/local/lib -llthread -llgcc_r' \
LIBS='-L/usr/local/lib -llthread -llgcc_r' \
./configure \
        --prefix=/usr/local/php \
        --with-tsrm-pthreads \
        --enable-experimental-zts


Actual result:
--------------
=====================================================================
CWD         : /usr/local/src/php.new.test/php-4.3.5
PHP         : /usr/local/src/php.new.test/php-4.3.5/sapi/cli/php
PHP_SAPI    : cli
PHP_VERSION : 4.3.5
ZEND_VERSION: 1.3.0
PHP_OS      : FreeBSD - FreeBSD xx.xxx.ru 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu Aug i386
INI actual  : /usr/local/php/lib/php.ini
More .INIs  : Segmentation fault (core dumped)

Extra dirs  :
=====================================================================
TIME START 2004-03-30 14:25:44
=====================================================================
FAIL EXPECT [tests/run-test/test001.phpt]
FAIL EXPECTF [tests/run-test/test002.phpt]
FAIL EXPECTREGEX [tests/run-test/test003.phpt]
FAIL INI section allows '=' [tests/run-test/test004.phpt]
SKIP Error message handling (without ZendOptimizer) [tests/run-test/test005.phpt] (reason: Zend Optimizer is loadedSegmentation fault (core dumped))
PASS Error messages are shown [tests/run-test/test006.phpt]
FAIL dirname test [tests/run-test/test007.phpt]
FAIL Error message handling (with ZendOptimizer) [tests/run-test/test008.phpt]
FAIL Trivial "Hello World" test [tests/basic/001.phpt]
FAIL Simple POST Method test [tests/basic/002.phpt]
FAIL GET and POST Method combined [tests/basic/003.phpt]
FAIL Two variables in POST data [tests/basic/004.phpt]
FAIL Three variables in POST data [tests/basic/005.phpt]
FAIL Add 3 variables together and print result [tests/basic/006.phpt]
FAIL Multiply 3 variables and print result [tests/basic/007.phpt]
FAIL Divide 3 variables and print result [tests/basic/008.phpt]
FAIL Subtract 3 variables and print result [tests/basic/009.phpt]
FAIL Testing | and & operators [tests/basic/010.phpt]
FAIL Testing $argc and $argv handling (GET) [tests/basic/011.phpt]
FAIL Testing $argc and $argv handling (cli) [tests/basic/012.phpt]
FAIL Bug #20539 (PHP CLI Segmentation Fault) [tests/basic/bug20539.phpt]
FAIL Methods via variable name, bug #20120 [tests/classes/bug20120.phpt]


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-30 05:29 UTC] krasnov at euroweb dot ru
I ma really sorry it was misprint, I meant bug #27735
 [2004-03-30 05:30 UTC] krasnov at euroweb dot ru
And i have forgot about this option in php_config.h

/* #undef HAVE_REALPATH */
 [2004-03-30 06:44 UTC] krasnov at euroweb dot ru
I have found that php NOT crash if i remove the following code from TSRM_API void tsrm_shutdown(void) (file TSRM.c)

-----------------------------------
if (resource_types_table && resource_types_table[j].dtor) {
   resource_types_table[j].dtor(p->storage[j], &p->storage);
}
-----------------------------------
 [2004-03-30 07:17 UTC] krasnov at euroweb dot ru
After removal of this code Apache 2.0.49 and Apache 2.0.48 stop to throw exceptions (means Segmentation Faults) in main thread upon -HUP (-1) or graceful restart. (Bug #27735)
 [2004-03-30 08:46 UTC] iliaa@php.net
Do you have any PHP or Zend extensions loaded via php.ini? 
 [2004-03-30 08:55 UTC] krasnov at euroweb dot ru
Complete list of directives in pnp.ini
--------------------------------------
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
--------------------------------------

Without php.ini all works and do not carshes.
The same config with php 4.3.4 works fine.
 [2004-03-30 09:06 UTC] krasnov at euroweb dot ru
The same effect with the latest ZendOptimizer-2.5.1
 [2004-03-30 09:51 UTC] derick@php.net
Report this bug to the zend guys then, as it is not a problem with PHP but with their optimizer.

regards,
Derick
 [2004-03-30 09:59 UTC] krasnov at euroweb dot ru
But you have changed PHP code while version of Zend Optimizer ramains the same!
 [2004-03-30 10:02 UTC] derick@php.net
So? It might mean that it's just no longer compatible with PHP 4.3.5; those things happen.

Anyway, the problem does seem related to something else though: persistent resources in zend extensions.
 [2004-03-30 10:11 UTC] krasnov at euroweb dot ru
Thank you for your attention, so I think this bug may be closed as Bogus.

Regard, Oleg
 [2004-03-30 10:32 UTC] krasnov at euroweb dot ru
Zend Support was notified.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC