Edit report at http://bugs.php.net/bug.php?id=49937&edit=1

 ID:                 49937
 Comment by:         kkaminski at itens dot pl
 Reported by:        basa...@php.net
 Summary:            [PATCH] Race condition in PDOStatement
 Status:             Feedback
 Type:               Bug
 Package:            PDO related
 Operating System:   Linux
 PHP Version:        5.2.11
 Assigned To:        basantk
 Block user comment: N

 New Comment:

I confirm that basantk's patch fixes issue reported here.

But as I said before, I hit very similar problem in different place -
PDOStatement::prepare. I think it is related to queryString written in
prepare().



basantk: I have patched correctly PHP's source, your new function does
not show up in crash dump, because prepare() does not use it.



Best regards


Previous Comments:
------------------------------------------------------------------------
[2010-09-23 01:11:13] basa...@php.net

The following patch has been added/updated:

Patch Name: pdo_race_condition_fix_53.patch
Revision:   1285197073
URL:       
http://bugs.php.net/patch-display.php?bug=49937&patch=pdo_race_condition_fix_53.patch&revision=1285197073

------------------------------------------------------------------------
[2010-09-23 01:06:58] basa...@php.net

kkaminski, I am not sure if you have applied the patch and compiled
correctly. I have not seen the crash after the fix. I had ran the
benchmark test under stress for hours after this patch without any
issue. Also it has been confirmed by one of the olio user.

------------------------------------------------------------------------
[2010-09-21 15:12:55] paj...@php.net

What's the status on this patch? Does it fix the issue shown in
kkaminski at itens dot pl's last backtrace?



Does it apply to 5.3 as well? If yes, please provide against 5.3+.

------------------------------------------------------------------------
[2010-08-25 08:27:31] kkaminski at itens dot pl

basantk: As promised call stack (Visual Studio 2010) for my new problem
below:

        php5ts.dll!_zend_mm_free_int(_zend_mm_heap * heap, void * p)  Line 1979
+ 0x84 bytes    C

        php5ts.dll!_efree(void * ptr)  Line 2311 + 0xb bytes    C

        php5ts.dll!_zval_ptr_dtor(_zval_struct * * zval_ptr)  Line 415 + 0x25
bytes   C

        php5ts.dll!zend_std_write_property(_zval_struct * object, _zval_struct
* member, _zval_struct * value, void * * * tsrm_ls)  Line 417 + 0xc
bytes   C

        php_pdo.dll!pdo_stmt_construct(_pdo_stmt_t * stmt, _zval_struct *
object, _zend_class_entry * dbstmt_ce, _zval_struct * ctor_args, void *
* * tsrm_ls)  Line 447  C

        php_pdo.dll!zim_PDO_prepare(int ht, _zval_struct * return_value,
_zval_struct * * return_value_ptr, _zval_struct * this_ptr, int
return_value_used, void * * * tsrm_ls)  Line 581 + 0x16 bytes   C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 200 + 0x3d bytes        C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 235     C

        php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data *
execute_data, void * * * tsrm_ls)  Line 322 + 0x11 bytes        C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(_zend_execute_data
* execute_data, void * * * tsrm_ls)  Line 2106  C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(_zend_execute_data
* execute_data, void * * * tsrm_ls)  Line 2106  C

        php5ts.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls) 
Line 92 + 0xc bytes     C

        php5ts.dll!zend_execute_scripts(int type, void * * * tsrm_ls,
_zval_struct * * retval, int file_count, ...)  Line 1135        C

        php5ts.dll!php_execute_script(_zend_file_handle * primary_file, void *
* * tsrm_ls)  Line 2036 + 0x12 bytes    C

        php5apache2_2.dll!php_handler(request_rec * r)  Line 639 + 0xb bytes    
C

------------------------------------------------------------------------
[2010-08-25 02:16:03] basa...@php.net

Sorry pajoye, I didn't know that there was a "patch upload" feature in
bug database. I somehow missed the link in webpage.



Anyway, I have attached the patch now. Thanks.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=49937


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=49937&edit=1

Reply via email to