__toString() which stores $this reference triggers segfault
Bug #1198882 reported by
Alexey Skryabin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php |
Unknown
|
Unknown
|
|||
php5 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Description:
Passing object with __toString() causes segfault in random script iteration. When casted to string beforehand, it runs OK.
Test case:
Code as
<?php
class A {
public $a;
public function __toString()
{
}
}
$a = new A;
echo trim($a);
echo trim($a->a);
?>
crashes in CLI, and run as php mod in apache
Enviroment:
DISTRIB_
php --version
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch
description: | updated |
description: | updated |
Changed in php5 (Ubuntu): | |
status: | Confirmed → Triaged |
tags: | added: bitesize patch |
description: | updated |
Changed in php5 (Ubuntu): | |
status: | Triaged → In Progress |
To post a comment you must log in.
Thank you for taking the time to report this bug and helping to make Ubuntu better.
Confirmed with php5-cli 5.3.10-1ubuntu3.7.
Could you please test the upstream 5.3.27 version built from source? If this fixes the problem, then we'll need to identify and cherry-pick the fix in Ubuntu and issue a stable release update.