Bug #49937 [Com]: [PATCH] Race condition in PDOStatement

From: Date: Tue, 24 Aug 2010 17:38:20 +0000
Subject: Bug #49937 [Com]: [PATCH] Race condition in PDOStatement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153753@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=49937&edit=1

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

 New Comment:

basantk: I used the patch you published in pdo_bug_52trunk.txt (this is
complete
patch, riight?). The patch fixed
my original problem but introduced a new one - in
pdo's constructor. As far I understood the code it is something with
memory
(de)allocation for queryString property.
I don't have access to crash dumps at the moment, but I will provide
full stack
trace tomorrow.


Previous Comments:
------------------------------------------------------------------------
[2010-08-24 19:24:42] pajoye@php.net

Can you attach the patch to the report please? Much more easier to
follow/review :)

------------------------------------------------------------------------
[2010-08-24 18:45:42] basantk@php.net

pajoye, my first patch was a rough patch which used
zval_add_ref_atomic.

Second patch posted on 2009-11-17 is my final patch. This patch doesn't
need
any enhancement to php core and it worked for me and several others
without 
crashes. I had tested with iplanet web server on Solaris and Linux and I
believe 
it will work with other multithreaded web servers.

Please review the patch posted on 2009-11-17,

kkaminski, which patch did you tested. You should test the revised patch

submitted on 2009-11-17. Please post the stack trace of the crash if you
tested 
the right patch.

Unfortunately php's bug tracker is very primitive in terms of feature.
Apache's 
bug tracker is lot better :-)

------------------------------------------------------------------------
[2010-08-23 13:50:14] pajoye@php.net

I'm not sure the fix is correct (while it can work). It should be done
inside zend_hash_copy instead of adding a zval_add_ref_atomic. Or?

zval_ref_atomic could be added but then I would rather not use the
expensive TSRM locking system but atomic declarations and the OS
specific atomic APIs.

------------------------------------------------------------------------
[2010-08-23 12:30:01] kkaminski at itens dot pl

Tested patch and it works, but now I'm having similar problem.
Apache is crashing in
pdo_stmt_construct
on
std_object_handlers.write_property(object, &z_key, query_string
TSRMLS_CC);

Could you please verify this?

------------------------------------------------------------------------
[2010-07-13 09:57:04] kkaminski at itens dot pl

Any chances of getting this patch into PHP 5.2.14? Or getting a windows
build for testing?
I'd like to give it a try but having problems building PHP under
winblows :/

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


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


Thread (22 messages)

« previous php.bugs (#153753) next »