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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 39 = ?
Subscribe to this entry?

 
 [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: Fri Apr 19 20:01:29 2024 UTC