-
Bug
-
Resolution: Fixed
-
Minor
-
3.11.10, 4.0.4
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MDL-75876-master -
Step to replicate:
1. Go to: "/calendar/export.php"
2. Select as much data as possible. The files which failed to export in our case was ~26 MB
3. Click get calendar url and save it in your clipboard
4. Go to: "/calendar/import.php"
4. Enter a name, set import from: "Calendar URL" and paste your clipboard into the calendar url, click import calendar.
5. Run the \core\task\calendar_cron_task scheduled task
6. The requests performed by the scheduled task should now cause a memory exhaustion. (the requests to /calendar/export_execute.php)
/calendar/export_execute.php uses a lot of memory, but does not call raise_memory_limit().
This can cause a memory exhaustion when working with large amounts of data.
We've tested the patch on our live server and it fixed our issue.
Stack trace:
PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/example.com/moodle/calendar/classes/local/event/factories/event_abstract_factory.php on line 146