FAQ
Hi,
There is a race condition in pdo's
PDOStatement->ce.default_properties.ref_count. The integer
is incremented without any lock around it (or using any other atomic APIs).
This causes PDO to crash under stress. Details are given in bug report
http://bugs.php.net/bug.php?id=49937&thanks=1

I have attached the patch for review.

Note :
I could not find any easy locking mechanism available in php sources so needed
to use tsrm_mutex to implement atomic increments. It can be done very
efficiently in many modern OSes but for php 5.2.x, I didn't want to introduce
many changes.

Search Discussions

  • Basant Kukreja at Oct 23, 2009 at 6:22 pm
    I have revised the patch for the race condition. New patch is much
    less invasive and
    scope of the change is restricted to pdo only.

    Details are there in the bug.
    Patch is attached.

    Regards,
    Basant.

    On Tue, Oct 20, 2009 at 4:03 PM, Basant Kukreja
    wrote:
    Hi,
    There is a race condition in pdo's
    PDOStatement->ce.default_properties.ref_count. The integer
    is incremented without any lock around it (or using any other atomic APIs).
    This causes PDO to crash under stress. Details are given in bug report
    http://bugs.php.net/bug.php?id=49937&thanks=1

    I have attached the patch for review.

    Note :
    I could not find any easy locking mechanism available in php sources so needed
    to use tsrm_mutex to implement atomic increments. It can be done very
    efficiently in many modern OSes but for php 5.2.x, I didn't want to introduce
    many changes.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedOct 20, '09 at 11:03p
activeOct 23, '09 at 6:22p
posts2
users1
websitephp.net

1 user in discussion

Basant Kukreja: 2 posts

People

Translate

site design / logo © 2022 Grokbase