r69013 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69012‎ | r69013 | r69014 >
Date:19:44, 4 July 2010
Author:avar
Status:reverted (Comments)
Tags:
Comment:
new-installer: Use `` instead of wfShellExec() like the old installer

This avoids runnin into the memory limitation of ulimit.sh when
auto-detecting if programs exist during installation. On my 64 bit
Debian system calling e.g. diff3 --version takes more than the default
10MB memory limit.

Can be reproduced as:

<?php
require 'maintenance/commandLine.inc';
$var = wfShellExec("/usr/bin/diff3 --version 2>&1");
echo "<$var>\n";
?>

Which on my system gives you:

php test.php
/home/avar/g/phase3/bin/ulimit4.sh: xmalloc: ../bash/variables.c:3446: cannot allocate 1270 bytes (53248 bytes allocated)
<>

The old installer just did ``, revert to this behavior until we raise
the default memory limit, or find some workaround for this issue.
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -581,7 +581,9 @@
582582 return $command;
583583
584584 $file = str_replace( '$1', $command, $versionInfo[0] );
585 - if ( strstr( wfShellExec( $file ), $versionInfo[1]) !== false )
 585+ # Should maybe be wfShellExec( $file), but runs into a ulimit, see
 586+ # http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=prev&oldid=335456
 587+ if ( strstr( `$file`, $versionInfo[1]) !== false )
586588 return $command;
587589 }
588590 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r74918* Revert r69013 (Use `` instead of wfShellExec() like the old installer). Thi...demon20:34, 17 October 2010

Comments

#Comment by 😂 (talk | contribs)   16:59, 16 October 2010

This won't work for a lot of shared hosts. It doesn't have the sanity checks for shell_exec and friends like wfShellExec does. Maybe we could set $wgMaxShellMemory to 0 for installation so we can skip ulimit4.sh?

#Comment by Platonides (talk | contribs)   22:54, 17 October 2010

Works for me with values as low as

bin/ulimit4.sh 1 4000 0 "diff3 --version"

The default $wgMaxShellMemory of 102400 should have been more than enough.

Does it still fail when you use the C locale?

Status & tagging log