Last modified: 2010-05-15 16:03:11 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 T17563, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15563 - Segfault observed on parse for certain input text using the old parser
Segfault observed on parse for certain input text using the old parser
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.13.x
All All
: Normal major (vote)
: ---
Assigned To: Tim Starling
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-11 14:17 UTC by Emil Podlaszewski
Modified: 2010-05-15 16:03 UTC (History)
1 user (show)

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


Attachments
a patch for Parser_OldPP.php (1.10 KB, patch)
2008-09-11 14:19 UTC, Emil Podlaszewski
Details
this is a correct patch (1.14 KB, text/plain)
2008-09-11 14:36 UTC, Emil Podlaszewski
Details

Description Emil Podlaszewski 2008-09-11 14:17:53 UTC
http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=30144 should be applied to Parser_OldPP.php too. Below is the patch:

Index: includes/parser/Parser_OldPP.php
===================================================================
--- includes/parser/Parser_OldPP.php    (revision 40727)
+++ includes/parser/Parser_OldPP.php    (working copy)
@@ -578,6 +578,10 @@
                                        break;
                                default:
                                        if( isset( $this->mTagHooks[$tagName] ) ) {
+                                               # Workaround for PHP bug 35229 and similar
+                                               if ( !is_callable( $this->mTagHooks[$name] ) ) {
+                                                       throw new MWException( "Tag hook for $name is not callable\n" );
+                                               }
                                                $output = call_user_func_array( $this->mTagHooks[$tagName],
                                                        array( $content, $params, $this ) );
                                        } else {
@@ -2999,6 +3003,11 @@
                                if ( $function ) {
                                        $funcArgs = array_map( 'trim', $args );
                                        $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs );
+
+                                       # Workaround for PHP bug 35229 and similar
+                                       if ( !is_callable( $this->mFunctionHooks[$function] ) ) {
+                                               throw new MWException( "Function hook for $function is not callable\n" );
+                                       }
                                        $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs );
                                        $found = true;




Emil
Comment 1 Emil Podlaszewski 2008-09-11 14:19:48 UTC
Created attachment 5315 [details]
a patch for Parser_OldPP.php
Comment 2 Emil Podlaszewski 2008-09-11 14:36:28 UTC
Created attachment 5316 [details]
this is a correct patch

the previous patch had a wrong variable name
Comment 3 Brion Vibber 2008-09-11 17:41:51 UTC
Note I'd like to kill the old parser on 1.14 dev trunk, but the patch should probably go on 1.13 branch.
Comment 4 Chad H. 2008-09-11 18:08:06 UTC
(In reply to comment #3)
> Note I'd like to kill the old parser on 1.14 dev trunk, but the patch should
> probably go on 1.13 branch.
> 

Actually kill it, or just not load it by default and keep it around like DatabaseFunctions?
Comment 5 Tim Starling 2008-09-12 02:34:43 UTC
It's already not loaded by default. DatabaseFunctions is just a collection of wrapper functions for a stable interface, it doesn't need any maintenance. Parser_OldPP is large and complex and easily broken by interface changes. So I think deleting it is quite reasonable. 

Is there some reason Wikia is still using it?
Comment 6 Emil Podlaszewski 2008-09-12 08:20:15 UTC
It is a problem with migrating so many wikis automatically to the new parser. Many of our communities actually don't understand http://meta.wikimedia.org/wiki/Migration_to_the_new_preprocessor and they don't know what they should change on their pages. They will just think that Wikia screwed up their stuff. So we are still not quite sure how to do it smoothly. 
Comment 7 Tim Starling 2008-09-12 14:17:48 UTC
You could write a script to scan your database for HTML output changes, and post lists of affected articles. 
Comment 8 Emil Podlaszewski 2008-09-12 14:41:11 UTC
Yes, that's the plan. Initially I had an impression that it would give me too many false positives. See for example: http://muppet.wikia.com/wiki/Special:ParserDiffTest/Wait_Wait..._Don%27t_Tell_Me!

But then I discovered there is a "timing" parameter (http://muppet.wikia.com/wiki/Special:ParserDiffTest/Wait_Wait..._Don%27t_Tell_Me!?timing=1) which for some reason doesn't give the false positive. Additionally I can compare old parser vs. new parser performance across all Wikia articles :)

Comment 9 Tim Starling 2008-10-06 08:23:05 UTC
Patch applied in r41736.

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


Navigation
Links