php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45617 ZTS causes crashes
Submitted: 2008-07-24 17:12 UTC Modified: 2008-07-24 20:11 UTC
From: herps at raqtweak dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
 [2008-07-24 17:12 UTC] herps at raqtweak dot com
Description:
------------
Hi,

I am using a custom written PHP module, originally written for PHP4. It is a connector for a custom written database. The script works fine, even under PHP5.

Problems arise when I compile Apache as MPM Worker, which means ZTS for PHP. When we use ZTS, things crash.

The piece of code it concerns, according to the gdb output, can be found in the link provided to the source.

I also included a GDB backtrace. The problem ONLY occurs when a script, which of course uses the module, is called. In all other cases, PHP and Apache will remain running!

Reproduce code:
---------------
http://www.raqtweak.com/downloads/source.txt

Actual result:
--------------
0x00cdd1d8 in _zend_list_find (id=14, type=0xa4652e08, tsrm_ls=0xb97b2ef4) at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:72
72              if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-24 18:23 UTC] johannes@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This place is not for support for writing extensions but reporting errors in PHP. Best place for such questions would be the pecl-dev mailing list.

For you're problem: Please learn how ZTS/TSRM works before randomly placing macros in the code, a good start might be Sara's book about extending PHP or her blog article on TSRM stuff (use your favorite search engine for finding that...)
 [2008-07-24 18:27 UTC] herps at raqtweak dot com
I'm sorry, I must have forgotten to mention that Zeev (php team) mentioned that ZTS is not very stable, and since it works without ZTS, but not with....

And yes, I did look at Sara's articles, and already tried everything she put in there. No go...

I'm not using this as a support list, so I do think we should at least look at it?
Thanks.
 [2008-07-24 20:11 UTC] herps at raqtweak dot com
Sorry, noticed I was missing a proper backtrace:



Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa252bb90 (LWP 3955)]
0x00cdd1d8 in _zend_list_find (id=14, type=0xa2527e08, tsrm_ls=0xb8c952a4) at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:72
72              if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
Missing separate debuginfos, use: debuginfo-install base-admserv.i686
(gdb) bt
#0  0x00cdd1d8 in _zend_list_find (id=14, type=0xa2527e08, tsrm_ls=0xb8c952a4)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:72
#1  0x1c90334a in get_handle (index=14) at cce.c:799
#2  0x1c9019d9 in zif_ccephp_connect (ht=2, return_value=0xb8cb34a8, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
    tsrm_ls=0xb8bc5630) at cce.c:128
#3  0x00cf7b1e in zend_do_fcall_common_helper_SPEC (execute_data=0xa2528084, tsrm_ls=0xb8bc5630)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:200
#4  0x00cfe875 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xa2528084, tsrm_ls=0xb8bc5630)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:1679
#5  0x00cf75a6 in execute (op_array=0xb8ca22f0, tsrm_ls=0xb8bc5630) at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:92
#6  0x00cf7dab in zend_do_fcall_common_helper_SPEC (execute_data=0xa2528e74, tsrm_ls=0xb8bc5630)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:234
#7  0x00cf8c02 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xa2528e74, tsrm_ls=0xb8bc5630)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:322
#8  0x00cf75a6 in execute (op_array=0xb8be62ec, tsrm_ls=0xb8bc5630) at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_vm_execute.h:92
#9  0x00cce2be in zend_execute_scripts (type=8, tsrm_ls=0xb8bc5630, retval=0x0, file_count=3)
    at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend.c:1134
#10 0x00c66ac9 in php_execute_script (primary_file=0xa252b164, tsrm_ls=0xb8bc5630)
    at /usr/src/redhat/BUILD/php-5.2.6/main/main.c:2005
#11 0x00d57107 in php_handler (r=0xb8bd0b58) at /usr/src/redhat/BUILD/php-5.2.6/sapi/apache2handler/sapi_apache2.c:629
#12 0xb808bded in ap_run_handler (r=0xb8bd0b58) at /usr/src/redhat/BUILD/httpd-2.2.9/server/config.c:158
#13 0xb808f73f in ap_invoke_handler (r=0xb8bd0b58) at /usr/src/redhat/BUILD/httpd-2.2.9/server/config.c:372
#14 0xb809b8a1 in ap_process_request (r=0xb8bd0b58) at /usr/src/redhat/BUILD/httpd-2.2.9/modules/http/http_request.c:258
#15 0xb80984b8 in ap_process_http_connection (c=0xb8bcccf8) at /usr/src/redhat/BUILD/httpd-2.2.9/modules/http/http_core.c:190
#16 0xb8093ccd in ap_run_process_connection (c=0xb8bcccf8) at /usr/src/redhat/BUILD/httpd-2.2.9/server/connection.c:43
#17 0xb80a1d84 in worker_thread (thd=0xb8a14590, dummy=0xb8bc5728)
    at /usr/src/redhat/BUILD/httpd-2.2.9/server/mpm/worker/worker.c:544
#18 0x003c89f6 in ?? () from /usr/lib/libapr-1.so.0
#19 0x003d932f in start_thread () from /lib/libpthread.so.0
#20 0x004cf27e in clone () from /lib/libc.so.6
(gdb)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 11:01:33 2024 UTC