php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66468 Class implementing Serializable is crashing PHP
Submitted: 2014-01-11 17:41 UTC Modified: 2014-01-11 20:27 UTC
From: post-christian at freenet dot de Assigned: krakjoe (profile)
Status: Closed Package: pthreads (PECL)
PHP Version: 5.5.8 OS: openSUSE 11.4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: post-christian at freenet dot de
New email:
PHP Version: OS:

 

 [2014-01-11 17:41 UTC] post-christian at freenet dot de
Description:
------------
Classes which implement the Serializable interface and were serialized and unserialized and than used inside a thread crashes PHP inside the run() function.


Test script:
---------------
class Test implements Serializable
{
	public function serialize()
	{
		return serialize( array() );
	}
	
	public function unserialize( $serialized )
	{
		$cfg = unserialize( $serialized );
	}
	
	public function foo()
	{
	}
}

$test = new Test();

// Does the magic:
$test = unserialize( serialize( $test ) );

class MyThread extends Thread
{
	private $test;
	
	public function __construct( $test )
	{
		$this->test = $test;
	}
	
	public function run()
	{
		$this->test->foo();
	}
}

$thread = new MyThread( $test );
$thread->start();
$thread->join();


Expected result:
----------------
Normal workflow

Actual result:
--------------
Memory access violation


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-11 20:27 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-01-11 20:27 UTC] krakjoe@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Thanks for report, pull git master ...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 17:01:31 2024 UTC