Last modified: 2014-09-05 11:05:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72357, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70357 - wfShellExec() causes web-installer (and possible more) to hang
wfShellExec() causes web-installer (and possible more) to hang
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.23.3
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.mediawiki.org/wiki/Thread...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-03 17:51 UTC by Daniel
Modified: 2014-09-05 11:05 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel 2014-09-03 17:51:51 UTC
Trying to upgrade a 1.22 version of mediawiki to any of the 1.23 versions will on my shared host result in the following behaviour:

After entering the Upgrade Key and moving on to the "Welcome to MediaWiki"-page, the installer hangs and the page never finishes loading, that is you only see white.

With strategic outcommenting of code, we have narrowed the issue down to the wfShellExec()-Function, however no error was produced. Only when we extracted the offending piece of code where we able to get a warning message.

Test code and warning message: http://slexy.org/view/s2frnrvJCP
Hosteurope's (provider) PHP Version: http://www.hosteurope-infos.de/phpinfo.php
Comment 1 Kunal Mehta (Legoktm) 2014-09-03 19:14:08 UTC
(In reply to Daniel from comment #0)

> Test code and warning message: http://slexy.org/view/s2frnrvJCP

Contents:

Error message:

PHP Warning:  stream_select() [[a href='function.stream-select']function.stream-select[/a]]: You MUST recompile PHP with a larger value of FD_SETSIZE.\nIt is set to 1024, but you have descriptors numbered at least as high as 1438.\n --enable-fd-setsize=2048 is recommended, but you may want to set it\nto equal the maximum number of open files supported by your system,\nin order to avoid seeing this error again at a later date. in /is/htdocs/wp1017571_H5Q0RI8Q57/www/sys/scripts/stream_select_debug.php on line 13


Test code:

<?php
$cmd = "/bin/bash '/is/htdocs/wp1017571_H5Q0RI8Q57/www/sfrs/hauptcomputer/w-1.23/includes/limit.sh' ''\''/usr/bin/diff3'\'' --version 2>&1' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=0; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes";
$desc = array(
	0 => array('file', 'php://stdin', 'r'),
	1 => array('pipe', 'w' ),
	2 => array('file', 'php://stderr', 'w'),
	3 => array( 'pipe', 'w' )
);

$readyPipes = null;
$proc = proc_open($cmd, $desc, $readyPipes);
$emptyArray = array();
var_dump(stream_select($readyPipes, $emptyArray, $emptyArray, null));
Comment 2 Jesús Martínez Novo (Ciencia Al Poder) 2014-09-03 20:48:03 UTC
Apparently, seems to be a problem with hosteurope

See this similar report from dokuwiki:

https://bugs.dokuwiki.org/?do=details&task_id=2276

> The problem lies with a hardcoded limit of a maximum of 1024 file descriptors
> within the libc-client library. Because HostEurope uses mod_php which is shared
> for all clients/apache processes this limit can arbitrarily reached. HostEurope
> refuses to maintain a custom version of this library, so the limit can't be
> increased.

Maybe you can try again in off-peak hours, when there are less concurrent users loading webpages on the server.

Dokuwiki "fixed" this by retrying in an infinite loop (yuk!)
Comment 3 Andre Klapper 2014-09-03 20:50:56 UTC
(In reply to Kunal Mehta (Legoktm) from comment #1)
> You MUST recompile PHP with a larger value of FD_SETSIZE.

So is there anything that can actually be done in MediaWiki? 
Ticket sounds like INVALID to me and a support question instead.
Comment 4 Daniel 2014-09-03 20:56:25 UTC
Updates have always been done in off-peak hours, so that's not a solution. Even if it was, isn't wfShellExec() used in other scenarios? So I'd end up with a malfuncitoning installation, if I managed to update at night.

That said, the previous incarnation of wfShellExec() that used passthru() instead of stream_select() worked perfectly.
Comment 5 Jesús Martínez Novo (Ciencia Al Poder) 2014-09-03 21:01:46 UTC
(In reply to Andre Klapper from comment #3)
> So is there anything that can actually be done in MediaWiki? 
> Ticket sounds like INVALID to me and a support question instead.

The question was posted in Support Desk as the URL describes) and I convinced Daniel to post it here, in the hope that the issue could be investigated, in case there's some leak in file descriptors or something that could be done.

The fact that this error didn't happened on previous versions may indicate this could introduce a bug, or maybe something could be done to detect this and "fallback" to the old way of doing this.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links