Page MenuHomePhabricator

CodeReview SVN shell-out fails with default $wgMaxShellMemory (false locale, DNS errors)
Open, LowPublic

Description

Testing on Ubuntu 10.10 64-bit with a fairly stock trunk install as of r80753.

I plopped CodeReview in, added the MediaWiki repository, and went to initialize it with svnImport.php, and got this exciting failure:

$ php extensions/CodeReview/svnImport.php MediaWiki

svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_US.UTF-8
svn: warning: please check that your locale name is correct
svn: OPTIONS of 'http://svn.wikimedia.org/svnroot/mediawiki': Could not resolve hostname `svn.wikimedia.org': Host not found (http://svn.wikimedia.org)

I tracked it down to the memory limit being applied on the shell-out: poking $wgMaxShellMemory from the default 102400 up to 1024000 gets it working just fine.

Can repro the error here like so:

bash # start a new shell so you don't break your old one!
ulimit -v 102400
svn info --non-interactive --trust-server-cert 'http://svn.wikimedia.org/svnroot/mediawiki'
exit

I guess a hundred megabytes doesn't go as far as it used to. :( strace shows a lot of mmap() failures; for instance we get a hostname resolution failure because the NSS plugin for DNS lookups can't be loaded:

open("/lib/libnss_dns.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\17\0\0\0\0\0\0"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0644, st_size=22928, ...}) = 0
mmap(NULL, 2117888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = -1 ENOMEM (Cannot allocate memory)
close(4) = 0

The failure mode is weird, and it's *totally* unobvious how to fix it from the error messages. If adjusting defaults isn't feasible, we at least need some documentation warning of the issue.


Version: unspecified
Severity: normal

Details

Reference
bz26867

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:19 PM
bzimport set Reference to bz26867.
bzimport added a subscriber: Unknown Object (MLST).
brion created this task.Jan 22 2011, 6:07 PM
brion added a comment.Jan 22 2011, 8:59 PM

I added a brief note in the install directions on http://www.mediawiki.org/wiki/Extension:CodeReview to try bumping the memory limit variable. (It previously recommended going straight to the PECL extension which is all very well and good, but harder to do. :)

Reedy added a comment.Jan 22 2011, 9:06 PM

Weird, when I installed it, without changing Max Shell memory, it was fine. I don't remember what version of Ubuntu that would've been on.. 9.10/10.04 maybe?

I never reset

I have "php5-svn" installed though...

That seemingly causes it to use SubversionPecl (based on Chads changes causing svn to hang during using importing to do an update).

So maybe just never experienced the shelling out to use svn..

demon added a comment.Jan 22 2011, 9:53 PM

php5-svn is the pecl extension, yes.

A lot of things fail with the default $wgMaxShellMemory. I doubled it on the cluster some time ago because shelling out to ImageMagick failed on some machines. It didn't have enough memory to load libraries like libpng, so it died with a confusing error message like "No delegate found for image format: png", essentially claiming it didn't support PNG.

demon removed a subscriber: demon.Aug 19 2015, 5:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 19 2015, 5:23 PM
Meno25 removed a subscriber: Meno25.Feb 8 2016, 7:52 PM