php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63292 Accessing members from outside causes segfault
Submitted: 2012-10-16 19:06 UTC Modified: 2012-10-18 20:56 UTC
From: chibisuke at web dot de Assigned: krakjoe (profile)
Status: Closed Package: pthreads (PECL)
PHP Version: 5.4.7 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chibisuke at web dot de
New email:
PHP Version: OS:

 

 [2012-10-16 19:06 UTC] chibisuke at web dot de
Description:
------------
When trying to access a member of the threadclass from outside the thread after the thread was joined causes a segfault.

I used the latest git version of the code, since a part of the problem is fixed there already

Test script:
---------------
<?php
class Test3 extends Thread {
    var $x;
    public function run() {
        $this->x = 7;
        sleep(5);
        return 0;
    }
}

$thread3 = new Test2();
$thread3->x = 5;
1echo $thread3->x; //works(5)
$thread3->start();
echo $thread3->x; //works(5 or 7 - racecondition)
sleep(3);
echo $thread3->x; //works(7)
$thread3->join();
echo $thread3->x; //segfault

?>


Expected result:
----------------
5577

Actual result:
--------------
557Segmentation fault: 11 (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-18 20:56 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2012-10-18 20:56 UTC] krakjoe@php.net
write access to thread members has been removed on account of it's instability.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 15:01:41 2019 UTC