Project

General

Profile

Actions

Bug #46584

closed

FAL: Segfault with some PHP versions in copy/move operations

Added by Andreas Wolf about 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2013-03-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Due to a (meanwhile fixed) bug in PHP 5.4 < 5.4.6 (?), object comparisons can lead to segfaults. See https://bugs.php.net/bug.php?id=61557 for details.

We experienced this in the ResourceStorage class in copy/move operations, where the source and target storages have to be compared to check if the operation is within the same or between two different storages.

The segfaults occured on these environments:
  • Linux, PHP 5.4.6, mod_php
  • Windows, PHP 5.4.8, FastCGI

The fix is simple: Use strict object comparison (===) for comparing the storages. This only checks the internal object identifier, not the object properties (see http://php.net/manual/en/language.oop5.object-comparison.php). The only problem is that this will fail if there are two objects for the same storage - but this is an unsupported behaviour that should not arise when the FAL API (Repositories, Factories) are properly used.

Actions

Also available in: Atom PDF