Cron Status 1.0.0 - Installation memory exhaustion
I am getting a reproducible PHP memory exhaustion error while installing Cron Status 1.0.0 on phpBB.
Environment:
- Debian 12
- Plesk
- PHP 8.5
- phpBB
- Cron Status 1.0.0
With
memory_limit = 512M, installation fails with:
Code: Select all
Fatal error: Allowed memory size of 536870912 bytes exhausted
(tried to allocate 400556096 bytes)
in /var/www/vhosts/spiderpiggy.com/forum.spiderpiggy.com/phpbb/db/driver/driver.php
on line 1112
I then increased the PHP memory limit to
1024M.
The effective PHP configuration was confirmed with:
The installation still fails, but now with:
Code: Select all
Fatal error: Allowed memory size of 1073741824 bytes exhausted
(tried to allocate 803209680 bytes)
in /var/www/vhosts/spiderpiggy.com/forum.spiderpiggy.com/phpbb/db/driver/driver.php
on line 1112
What is particularly suspicious is that the requested allocation appears to scale almost proportionally with the PHP memory limit:
Code: Select all
512M limit -> tried to allocate 400,556,096 bytes
1024M limit -> tried to allocate 803,209,680 bytes
This suggests that simply increasing
memory_limit does not solve the problem.
I also noticed something unusual in the migration files.
m1_install.php already creates:
Code: Select all
['config.add', ['cronstatus_crash_task', '']],
['config.add', ['cronstatus_crash_time', 0]],
['custom', [[$this, 'add_crash_message_text']]],
including the
cronstatus_crash_message entry in
CONFIG_TEXT_TABLE.
However,
m2_add_crash_detection.php appears to add the same settings again:
Code: Select all
['config.add', ['cronstatus_crash_task', '', true]],
['config.add', ['cronstatus_crash_time', 0, true]],
['custom', [[$this, 'add_config_text']]],
Its
effectively_installed() method is:
Code: Select all
public function effectively_installed()
{
return $this->config->offsetExists('cronstatus_crash_task');
}
Since
cronstatus_crash_task is already created by
m1_install,
m2_add_crash_detection will appear to be effectively installed immediately after
m1_install.
Then
m3_add_last_run_tracking depends on
m2_add_crash_detection:
Code: Select all
public static function depends_on()
{
return ['dmzx\cronstatus\migrations\m2_add_crash_detection'];
}
I cannot confirm yet whether this migration structure is the direct cause of the memory exhaustion, but it looks unusual and may be worth checking.
There are no obviously huge SELECT queries in these migrations.
m3_add_last_run_tracking only performs:
Code: Select all
SELECT config_name
FROM phpbb_config_text
WHERE config_name = 'cronstatus_last_runs'
So the amount of memory being allocated seems disproportionate to the actual migration queries.
Could you please check the migration chain and whether phpBB's migration/dependency handling could be looping or building an excessively large result while installing this version?