Last modified: 2013-09-28 01:03:43 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 T56662, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54662 - wfArrayDiff2_cmp noisy
wfArrayDiff2_cmp noisy
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
GlobalBlocking (Other open bugs)
master
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-26 19:33 UTC by Sam Reed (reedy)
Modified: 2013-09-28 01:03 UTC (History)
3 users (show)

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


Attachments

Description Sam Reed (reedy) 2013-09-26 19:33:10 UTC
Warning:  strcmp() expects parameter 1 to be string, array given in /usr/local/apache/common-local/php-1.22wmf19/includes/GlobalFunctions.php on line 134


No idea on the cause but there's quite a few of them appearing in wmf19
Comment 1 Sam Reed (reedy) 2013-09-26 19:38:14 UTC
25 Warning:  strcmp() expects parameter 1 to be string, array given in /usr/local/apache/common-local/php-1.22wmf19/includes/GlobalFunctions.php on line 134
5 Warning:  Variable passed to each() is not an array or object in /usr/local/apache/common-local/php-1.22wmf19/includes/GlobalFunctions.php on line 133
5 Warning:  strcmp() expects parameter 2 to be string, array given in /usr/local/apache/common-local/php-1.22wmf19/includes/GlobalFunctions.php on line 127
5 Warning:  reset() expects parameter 1 to be array, string given in /usr/local/apache/common-local/php-1.22wmf19/includes/GlobalFunctions.php on line 132
Comment 2 Sam Reed (reedy) 2013-09-27 01:34:26 UTC
Assigning to me as a TODO for post sleep. This is very noisy on just the "test" wikis, so cluster wide it's going to be awful.

Need to hack in some debugging to get a stack trace and find out where it's coming from...
Comment 3 Sam Reed (reedy) 2013-09-27 01:39:09 UTC
reedy@tin:/a/common/php-1.22wmf19/includes$ git diff
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 414c822..23e75ff 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -123,6 +123,10 @@ function wfArrayDiff2( $a, $b ) {
  * @return int
  */
 function wfArrayDiff2_cmp( $a, $b ) {
+       if( is_array( $a ) || is_array( $b ) ) {
+               var_dump( $a, $b );
+               debug_print_backtrace();
+       }
        if ( !is_array( $a ) ) {
                return strcmp( $a, $b );
        } elseif ( count( $a ) !== count( $b ) ) {
Comment 4 Sam Reed (reedy) 2013-09-27 01:46:20 UTC
Except that won't put the info anywhere useful. Bed time.
Comment 5 Sam Reed (reedy) 2013-09-27 18:07:00 UTC
Pushing to page editing, will do some more digging

2013-09-27 18:05:46 mw1112 mediawikiwiki: require/MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditAction::show/EditPage::edit/EditPage::getEditPermissionErrors/wfArrayDiff2/array_udiff/wfArrayDiff2_cmp
Comment 6 Sam Reed (reedy) 2013-09-27 18:38:02 UTC
Moving to GlobalBlocking based on the content of the message keys, thought it maybe should be WikimediaMessages as they would look to be causing the problem
Comment 7 Sam Reed (reedy) 2013-09-27 18:41:11 UTC
			wfRunHooks( 'GlobalBlockingBlockedIpMsg', array( &$blockedIpMsg ) );
			return $result = array( $blockedIpMsg,
				$blockingUser, $display_wiki, $block->gb_reason, $blockTimestamp, $blockExpiry, $ip );

-----

function efWikimediaGlobalBlockingBlockedIpMsg( &$msg ) {
	$msg = array( 'wikimedia-globalblocking-ipblocked' );
	return true;
}


Looks like the same issue will occur in TorBlock
Comment 8 Gerrit Notification Bot 2013-09-27 19:08:59 UTC
Change 86296 had a related patch set uploaded by Reedy:
Fix up noise in wfArrayDiff2_cmp due to messages being wrapped in an array

https://gerrit.wikimedia.org/r/86296
Comment 9 Gerrit Notification Bot 2013-09-27 19:11:44 UTC
Change 86298 had a related patch set uploaded by Reedy:
In wfArrayDiff2_cmp only compare $a and $b as string if they both are strings

https://gerrit.wikimedia.org/r/86298
Comment 10 Gerrit Notification Bot 2013-09-27 21:17:39 UTC
Change 86296 merged by jenkins-bot:
Fix up noise in wfArrayDiff2_cmp due to messages being wrapped in an array

https://gerrit.wikimedia.org/r/86296
Comment 11 Gerrit Notification Bot 2013-09-28 01:03:43 UTC
Change 86298 merged by Adamw:
In wfArrayDiff2_cmp only compare $a and $b as string if they both are strings

https://gerrit.wikimedia.org/r/86298

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


Navigation
Links