Page MenuHomePhabricator

config/index.php line 244- memlimit check faulty if memory_limit set to -1 in /etc/php.ini - causes rebuildall to fail
Closed, ResolvedPublic

Description

Author: lgasslein

Description:
After installing, I went to the config page (config/index.php) by following a link to configure my
wiki as instructed. I entered in the data as requested (db user, sysop account, etc.)
After submitting the form, a check is done on the memory_limit INI variable in /etc/php.ini... I had
this variable set to -1 (which means give PHP unlimited memory.) This check, which occurs starting
at line 244 of config/index.php, determines if the memory_limit is greater than 20 MB. If not, then
these two things occur: ini_set( "memory_limit", "20M" ) AND $conf->raiseMemory = true; - the second
line writes to the LocalSettings.php file.
Now, when I went to run rebuildall.php to get my links up to date, rebuildall.php will always fail
because it reads LocalSettings.php (via inclusion of commandLine.inc) to get the value of the
memory_limit INI variable. The value during execution of rebuildall.php will be 20M, (because of
line 12 - "ini_set( 'memory_limit', '20M' );" - in LocalSettings.php, written during
configuration)... and 20M is NEVER enough to run rebuildall.php - it will die with "Fatal error:
Allowed memory size of x bytes exhausted at x (tried to allocate 43 bytes)"- where the first x is 20
MB. I have found that for the current database dump, the cur table has almost 1.5 million records
and at least 300MB is required.
It took me a while to track this down. I know it's unusual to have memory_limit set to -1
in /etc/php.ini, but the config/index.php code should account for that possibility anyway. I do not
want my memory limit to be 20 MB for rebuildall.php, I want it to be unlimited. I think the problem
could be solved by just adding a case into config/index.php that checks for the special case of
unlimited memory (-1), instead of just checking that the value of memory_limit is not empty, and
that it is greater than 20MB.
Thanks for your time!
-->Laura Gasslein


Version: 1.4.x
Severity: normal

Details

Reference
bz1509
TitleReferenceAuthorSource BranchDest Branch
Add `mwoauth` craterepos/mwbot-rs/mwbot!67legoktmmwoauthmain
envvars-api: bump to 0.0.36-20231207081457-ea699741repos/cloud/toolforge/toolforge-deploy!152project_1317_bot_df3177307bed93c3f34e421e26c86e38bump_envvars-apimain
envvars-api: bump to 0.0.36-20231207081457-ea699741repos/cloud/toolforge/toolforge-deploy!151project_1317_bot_df3177307bed93c3f34e421e26c86e38bump_envvars-apimain
envvars-api: bump to 0.0.36-20231207081457-ea699741repos/cloud/toolforge/toolforge-deploy!149project_1317_bot_df3177307bed93c3f34e421e26c86e38bump_envvars-apimain
envvars-api: bump to 0.0.36-20231207081457-ea699741repos/cloud/toolforge/toolforge-deploy!148project_1317_bot_df3177307bed93c3f34e421e26c86e38bump_envvars-apimain
builds-api: bump to 0.0.112-20231207081230-2d86b8e2repos/cloud/toolforge/toolforge-deploy!144sstefanovabump_builds-apimain
[builds-api] force nginx reload on buildrepos/cloud/toolforge/builds-api!56raymond-ndibeforce_nginx_reload_on_buildmain
[envvars-api] force nginx reload on buildrepos/cloud/toolforge/envvars-api!19raymond-ndibeforce_nginx_reload_on_buildmain
Customize query in GitLab

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:12 PM
bzimport set Reference to bz1509.
bzimport added a subscriber: Unknown Object (MLST).

You're right, we should be checking for -1. Adding to 1.4 release blockers...

Separately, we really _shouldn't_ be ballooning to 300 megabytes (even if 20 isn't
enough, 300 seems like waayyyyy too much). Probably either a) we have a memory leak
or b) something is fetching every record at once when it should be working in smaller
chunks.

Can you check which part of the rebuild process is eating up the memory? Its
components are callable as separate scripts too, so try them individually if it's not clear
from watching memory usage while it runs.

1.4.0 released; kicking back to 1.5 blockers.

jeluf wrote:

Fixed in config/index.php, rev 1.114

Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:22 AM