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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 23 10:01:29 2024 UTC