Discussion:
[TYPO3-english] typo3 7.6.16 Allowed memory size error
Riccardo Coletta
2017-03-13 11:59:54 UTC
Permalink
I'm very new to the forum and I apologize for my english and for any error in posting things in right way and section. Point me out any mistake and I will correct it

I've got a typo3 site that throw this error every now and then, and we're not able to reproduce it on will

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3963167672086036512 bytes) in /var/www/typo3_src-7.6.16/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php on line 106

As you can see, the memory it seems php is trying to allocate is an unbelivable high value and look not possible, expecially because line 106 is only a string concatenation.

Unfortunately I've not direct accesso to the server (Red Hat 7) but only to the typo3 administration and cannot direct access the typo3 source but I've to ask server administrator for every single code line to be changed in the core.

Hope someone can help me

Apache: 2.4.6
PHP: 7.0.12
MySql: 5.7.16
Typo3: 7.6.16
Florian Rival
2017-03-14 09:07:14 UTC
Permalink
Hi,

When there is a problem with memory allocation it's often because there is a loop in the code.
You should check your code and have look at the heap.
Set your Typo3 in developer mode with the install tool.

Florian
--
-- Florian Rival --
www.oktopuce.fr
Riccardo Coletta
2017-03-14 10:12:10 UTC
Permalink
Unfortunately that's not the case.

We get the error on random pages and we do not get the error every time we access a page.
Thìs week it happened two times during home page visualization, once during the day and once at night time, with low traffic, and we had to restart apache both times.

I hoped to read about some php bug, because I'm pretty sure the typo3 code is ok.

Thanks for the reply
Philipp Gampe
2017-03-14 13:04:10 UTC
Permalink
Hi Riccardo,
Post by Riccardo Coletta
Unfortunately I've not direct accesso to the server (Red Hat 7) but only
to the typo3 administration and cannot direct access the typo3 source but
I've to ask server administrator for every single code line to be changed
in the core.
Looks like an integer overflow. Try to update php to the latest version on
your OS. If you use xdebug, then disable it (should not be enabled in
production anyway).
Other than that, you can only contact RedHat (in case you have a support
subscription).

I had similar errors on Fedora before, and in was the result of a not
matching xdebug version.

Best regards
--
Philipp Gampe – PGP-Key 0AD96065 – LFCS
TYPO3 CMS Certified Integrator – Certified Developer – Active contributor
TYPO3 ... inspiring people to share!
Riccardo Coletta
2017-03-30 06:41:53 UTC
Permalink
A little step to understand what's happening

The line that throw the error is this one, in the file "typo3/sysext/core/Classes/Cahce/Backend/SimpleFileBackend.php"

$finalCacheDirectory = $temporaryCacheDirectory . 'Cache/' . $codeOrData . '/' . $this->cacheIdentifier . '/';

I modified the file adding a write on a text file log, with the "strlen" of the three variables. It happens that $temporaryCacheDirectory length appears to be 7926335344172072960 bytes, that it's obviously impossible, because the error should be given at the first variable assign and not when trying to use it... I look like the variable length information are someway corrupted

I'm far to discover how can it be, but I'm considering to add an instruction like this before the string concatenation

if( strlen( $temporaryCacheDirectory ) > 100 ) {
$temporaryCacheDirectory = PATH_site . 'typo3temp/';
}

These are the same code lines that appears immediately beofre the error line.

Can this lend to some issue I'm not aware of?

Thanks
Paolo Mistretta
2017-10-19 08:22:15 UTC
Permalink
Ciao Riccardo,

sto cercando di risolvere lo stesso problema.
hai per caso fatte delle ulteriori analisi e risolto il problema o almeno capito perchè capita.

Grazie
---
Hello Riccardo,

I am trying to solve the same problem.
have you made further analyzes and solved the problem or at least understand why it happens?

Thank you

Loading...