php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61253 Wrappers opened with errors concurrency problem
Submitted: 2012-03-02 22:08 UTC Modified: 2012-03-09 19:08 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cataphract@php.net Assigned: mattficken (profile)
Status: Closed Package: Streams related
PHP Version: 5.4SVN-2012-03-02 (SVN) OS: Any (ZTS)
Private report: No CVE-ID: None
 [2012-03-02 22:08 UTC] cataphract@php.net
Description:
------------
When opening the same wrapper in several threads and this generates errors, a segfault may result.

Test script:
---------------
<?php
file_get_contents('http://localhost/notfound');

Expected result:
----------------
Each requests shows a 404 error.

Actual result:
--------------
Segfault given enough concurrency

Patches

bug61253.diff (last revision 2012-03-07 14:05 UTC by cataphract@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-02 22:13 UTC] cataphract@php.net
The following patch has been added/updated:

Patch Name: bug61253.diff
Revision:   1330726381
URL:        https://bugs.php.net/patch-display.php?bug=61253&patch=bug61253.diff&revision=1330726381
 [2012-03-02 22:13 UTC] cataphract@php.net
Pierre, please see if this fixes the problem.
 [2012-03-02 22:13 UTC] cataphract@php.net
-Assigned To: +Assigned To: pajoye
 [2012-03-03 20:42 UTC] pajoye@php.net
-Assigned To: pajoye +Assigned To: mattficken
 [2012-03-03 20:42 UTC] pajoye@php.net
Matt, can you test this patch please? and add the test to our suites while being 
at it :)
 [2012-03-07 14:05 UTC] cataphract@php.net
The following patch has been added/updated:

Patch Name: bug61253.diff
Revision:   1331129135
URL:        https://bugs.php.net/patch-display.php?bug=61253&patch=bug61253.diff&revision=1331129135
 [2012-03-08 12:30 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=324020
Log: - Fixed bug #61253: Wrappers opened with errors concurrency problem
#NOTE: There is a very small possibility that this will further break
#extensions that access wrapper-&gt;{err_stack, err_count}. On PECL SVN, rar is the
#only one and it may leak memory after this. I say &quot;further break&quot; because
#extensions that do that are already broken (will segfault) under ZTS, which is
#why this patch is necessary.
#There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
 [2012-03-08 12:32 UTC] cataphract@php.net
I've committed the patch. Testing would still be useful.
 [2012-03-08 12:39 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=324021
Log: - Oops committed old version of the patch in r324020. Fixed. See bug #61253.
 [2012-03-09 18:29 UTC] mattficken@php.net
As of 5_4 rev324027, I can no longer reproduce this bug using Apache 2.2 on Windows 2008r2.

I think the fix works.
 [2012-03-09 19:08 UTC] mattficken@php.net
-Status: Assigned +Status: Closed
 [2012-03-09 19:08 UTC] mattficken@php.net
Closing bug.
 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of cataphract
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0169020e49951a489fe0237ed6696a1b241ae7e4
Log: - Fixed bug #61253: Wrappers opened with errors concurrency problem #NOTE: There is a very small possibility that this will further break #extensions that access wrapper-&gt;{err_stack, err_count}. On PECL SVN, rar is the #only one and it may leak memory after this. I say &quot;further break&quot; because #extensions that do that are already broken (will segfault) under ZTS, which is #why this patch is necessary. #There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
 [2012-07-24 23:36 UTC] rasmus@php.net
Automatic comment on behalf of cataphract
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0169020e49951a489fe0237ed6696a1b241ae7e4
Log: - Fixed bug #61253: Wrappers opened with errors concurrency problem #NOTE: There is a very small possibility that this will further break #extensions that access wrapper-&gt;{err_stack, err_count}. On PECL SVN, rar is the #only one and it may leak memory after this. I say &quot;further break&quot; because #extensions that do that are already broken (will segfault) under ZTS, which is #why this patch is necessary. #There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of cataphract
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0169020e49951a489fe0237ed6696a1b241ae7e4
Log: - Fixed bug #61253: Wrappers opened with errors concurrency problem #NOTE: There is a very small possibility that this will further break #extensions that access wrapper-&gt;{err_stack, err_count}. On PECL SVN, rar is the #only one and it may leak memory after this. I say &quot;further break&quot; because #extensions that do that are already broken (will segfault) under ZTS, which is #why this patch is necessary. #There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC