php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63872 random crashes when using ressources
Submitted: 2012-12-29 02:21 UTC Modified: 2012-12-30 14:47 UTC
From: bobwei9 at hotmail dot com Assigned: krakjoe (profile)
Status: Closed Package: pthreads (PECL)
PHP Version: master-Git-2012-12-29 (Git) OS: Mac OS X Mountain Lion
Private report: No CVE-ID: None
 [2012-12-29 02:21 UTC] bobwei9 at hotmail dot com
Description:
------------
Pthreads now random crashes when ressources are instantiated (not nessessarily in a Stackable).

Could you please provide a switch option in ./configure for this ressource sharing-test? (Or should I simply use an old commit and not inform you anymore about bugs...?)

Test script:
---------------
Sorry, I cannot provide a reproduce script as the crashes seem to be random, but what I can tell you: I instantiate a mysqli-object in the run-methods of the threads. (or is one backtrace the main thread and the other the executing thread?). The backtraces you see below, is twice the same script, twice executed.

Actual result:
--------------
#0  0x0000000100925b5a in _zend_is_inconsistent (ht=0xde055254, file=0x100fa6318 "/var/root/php-src/Zend/zend_hash.c", line=1096) at zend_hash.c:54
#1  0x000000010092ab8b in zend_hash_internal_pointer_reset_ex (ht=0xde055254, pos=0x10297e858) at zend_hash.c:1096
#2  0x00000001020de097 in pthreads_resources_kept (resources=0xde055254, entry=0x102b23c10, tsrm_ls=0x102810980) at resources.c:56
#3  0x00000001020db4e4 in pthreads_prepared_resource_dtor (entry=0x102b23c10) at prepare.c:488
#4  0x0000000100928e8c in zend_hash_del_key_or_index (ht=0x1018c9a70, arKey=0x0, nKeyLength=0, h=1, flag=1) at zend_hash.c:531
#5  0x00000001007bfe7f in php_mysqlnd_net_open_tcp_or_unix_pub (net=0x102b220d0, scheme=0x102b23658 "unix:///var/mysql/mysql.sock", scheme_len=28, persistent=0 '\0', conn_stats=0x102c03150, error_info=0x102b21d80, tsrm_ls=0x102810980) at mysqlnd_net.c:226
#6  0x00000001007c0c8b in php_mysqlnd_net_connect_ex_pub (net=0x102b220d0, scheme=0x102b23658 "unix:///var/mysql/mysql.sock", scheme_len=28, persistent=0 '\0', conn_stats=0x102c03150, error_info=0x102b21d80, tsrm_ls=0x102810980) at mysqlnd_net.c:303
#7  0x00000001007710b5 in php_mysqlnd_conn_data_connect_handshake_pub (conn=0x102b21c48, host=0x102b21758 "localhost", user=0x102b21840 "xxxxxx", passwd=0x102b201f8 "xxxxxx", passwd_len=16, db=0x102b219a8 "xxxxxx", db_len=6, mysql_flags=959117, tsrm_ls=0x102810980) at mysqlnd.c:760
#8  0x0000000100773bda in php_mysqlnd_conn_data_connect_pub (conn=0x102b21c48, host=0x102b21758 "localhost", user=0x102b21840 "xxxxxx", passwd=0x102b201f8 "xxxxxxxxxxxxxxxx", passwd_len=16, db=0x102b219a8 "xxxxxx", db_len=6, port=3306, socket_or_pipe=0x102b05c00 "/var/mysql/mysql.sock", mysql_flags=959117, tsrm_ls=0x102810980) at mysqlnd.c:948
#9  0x0000000100776e5c in php_mysqlnd_conn_connect_pub (conn_handle=0x102b21ba0, host=0x102b21758 "localhost", user=0x102b21840 "xxxxxx", passwd=0x102b201f8 "xxxxxx", passwd_len=16, db=0x102b219a8 "xxxxxx", db_len=6, port=3306, socket_or_pipe=0x102b05c00 "/var/mysql/mysql.sock", mysql_flags=131072, tsrm_ls=0x102810980) at mysqlnd.c:1087
#10 0x0000000100777562 in mysqlnd_connect (conn_handle=0x102b21ba0, host=0x102b21758 "localhost", user=0x102b21840 "xxxxxx", passwd=0x102b201f8 "xxxxxx", passwd_len=16, db=0x102b219a8 "xxxxxx", db_len=6, port=3306, socket_or_pipe=0x102b05c00 "/var/mysql/mysql.sock", mysql_flags=131072, tsrm_ls=0x102810980) at mysqlnd.c:1119
#11 0x00000001003baec1 in mysqli_common_connect (ht=4, return_value=0x102b21a90, return_value_ptr=0x0, this_ptr=0x102b20bd0, return_value_used=0, tsrm_ls=0x102810980, is_real_connect=0 '\0', in_ctor=1 '\001') at mysqli_nonapi.c:241
#12 0x00000001003bb587 in zif_mysqli_link_construct (ht=4, return_value=0x102b21a90, return_value_ptr=0x0, this_ptr=0x102b20bd0, return_value_used=0, tsrm_ls=0x102810980) at mysqli_nonapi.c:319
#13 0x0000000100971277 in zend_do_fcall_common_helper_SPEC (execute_data=0x10248cbe0, tsrm_ls=0x102810980) at zend_vm_execute.h:546
#14 0x0000000100973466 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x10248cbe0, tsrm_ls=0x102810980) at zend_vm_execute.h:678
#15 0x000000010096e112 in execute_ex (execute_data=0x10248cbe0, tsrm_ls=0x102810980) at zend_vm_execute.h:356
#16 0x000000010096f22c in zend_execute (op_array=0x102b0fbd8, tsrm_ls=0x102810980) at zend_vm_execute.h:381
#17 0x00000001008f029d in zend_call_function (fci=0x102980db0, fci_cache=0x102980d88, tsrm_ls=0x102810980) at zend_execute_API.c:941
#18 0x00000001020e1c7e in pthreads_routine (arg=0x102810400) at object.c:714
#19 0x00007fff8c4dc742 in _pthread_start ()
#20 0x00007fff8c4c9181 in thread_start ()


or


#0  0x00007fff84d8e0fa in __psynch_cvwait ()
#1  0x00007fff8c4e0f89 in _pthread_cond_wait ()
#2  0x0000000104a5177b in pthreads_synchro_wait_ex (sync=0x7f888cd00150, timeout=0, tsrm_ls=0x7f888bc11930) at synchro.c:69
#3  0x0000000104a517e0 in pthreads_synchro_wait (sync=0x7f888cd00150, tsrm_ls=0x7f888bc11930) at synchro.c:80
#4  0x0000000104a51d1d in pthreads_state_wait (state=0x7f888cd000e0, mask=2, tsrm_ls=0x7f888bc11930) at state.c:110
#5  0x0000000104a57035 in pthreads_start (thread=0x7f888cd00000, tsrm_ls=0x7f888bc11930) at object.c:497
#6  0x0000000104a4c365 in zim_Thread_start (ht=0, return_value=0x104ad1720, return_value_ptr=0x0, this_ptr=0x104ad3120, return_value_used=0, tsrm_ls=0x7f888bc11930) at thread.h:94
#7  0x0000000103adf277 in zend_do_fcall_common_helper_SPEC (execute_data=0x1048b38e8, tsrm_ls=0x7f888bc11930) at zend_vm_execute.h:546
#8  0x0000000103ae1466 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x1048b38e8, tsrm_ls=0x7f888bc11930) at zend_vm_execute.h:678
#9  0x0000000103adc112 in execute_ex (execute_data=0x1048b38e8, tsrm_ls=0x7f888bc11930) at zend_vm_execute.h:356
#10 0x0000000103add22c in zend_execute (op_array=0x1048ec818, tsrm_ls=0x7f888bc11930) at zend_vm_execute.h:381
#11 0x0000000103a7c7c3 in zend_execute_scripts (type=8, tsrm_ls=0x7f888bc11930, retval=0x0, file_count=3) at zend.c:1309
#12 0x0000000103999cbc in php_execute_script (primary_file=0x7fff5ca917c8, tsrm_ls=0x7f888bc11930) at main.c:2468
#13 0x0000000103cb1fff in do_cli (argc=2, argv=0x7fff5ca91ab8, tsrm_ls=0x7f888bc11930) at php_cli.c:988
#14 0x0000000103cb40ae in main (argc=2, argv=0x7fff5ca91ab8) at php_cli.c:1364

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-29 02:23 UTC] bobwei9 at hotmail dot com
Oh. May one with edit-rights here delete the password and user from the backtrace (#7, first bt)?
 [2012-12-30 14:47 UTC] krakjoe@php.net
Some work has been done to stabilize the sharing of resources, both the 
SQLWorker and Socket examples are now working in git without errors or leaks.

I do appreciate the bug reporting a LOT, please do always always always report 
anything you find. 
Please also bare in mind that I am just one guy, working on my own in my spare 
time, the code in git has to be considered unstable, I understand you want to 
use the latest and greatest features, but they are unfinished until a release is 
rolled out. I hope this goes some way to explaining why code in git may crash, I 
do hope you persevere and keep testing with me :)

Ta
 [2012-12-30 14:47 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC